/* 
 * Estilos del frontend para el plugin Consulta Procesos
 * Archivo: assets/css/frontend.css
 * AGREGADO: Estilos para indicador de progreso
 */

/* Contenedor principal */
.cp-frontend-container {
    max-width: 1100px;
    margin: 0 auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.cp-frontend-title {
    text-align: center;
    color: #233A79;
    margin: 0 0 30px 0;
    padding: 30px 30px 0 30px;
    font-size: 28px;
    font-weight: 600;
}

/* Barra de progreso */
.cp-progress-bar {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    position: relative;
}

.cp-progress-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 10px;
    position: relative;
    transition: all 0.3s ease;
    cursor: pointer;
}

.cp-progress-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 32px;
    right: -1px;
    width: 2px;
    height: 16px;
    background: #dee2e6;
    z-index: 1;
}

.cp-progress-step.completed::after {
    background: #28a745;
}

.cp-step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #dee2e6;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.cp-progress-step.active .cp-step-number {
    background: #233A79;
    color: white;
}

.cp-progress-step.completed .cp-step-number {
    background: #28a745;
    color: white;
}

.cp-step-label {
    font-size: 12px;
    color: #6c757d;
    font-weight: 500;
    text-align: center;
}

.cp-progress-step.active .cp-step-label {
    color: #233A79;
    font-weight: 600;
}

.cp-progress-step.completed .cp-step-label {
    color: #28a745;
}

/* Pasos del formulario */
.cp-form-step {
    display: none;
    padding: 40px;
    min-height: 400px;
    animation: slideIn 0.3s ease;
}

.cp-form-step.active {
    display: block;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Etapa 1: Términos */
.cp-terms-container h3 {
    color: #1d2327;
    margin-bottom: 25px;
    font-size: 24px;
}

.cp-terms-content {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 25px;
    margin-bottom: 25px;
    max-height: 300px;
    overflow-y: auto;
    line-height: 1.6;
}

.cp-terms-content h4 {
    color: #495057;
    margin-top: 20px;
    margin-bottom: 10px;
}

.cp-terms-content ul, .cp-terms-content ol {
    padding-left: 20px;
    margin-bottom: 15px;
}

.cp-terms-content li {
    margin-bottom: 8px;
}

.cp-terms-content a {
    color: #007cba;
    text-decoration: none;
}

.cp-terms-content a:hover {
    text-decoration: underline;
}

.cp-terms-acceptance {
    display: flex;
    align-items: flex-start;
    margin-bottom: 30px;
    padding: 20px;
    background: #e7f3ff;
    border-radius: 6px;
    border-left: 4px solid #007cba;
}

.cp-checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-size: 16px;
    line-height: 1.5;
}

.cp-checkbox-label input[type="checkbox"] {
    margin-right: 12px;
    margin-top: 2px;
    transform: scale(1.2);
}

.cp-checkbox-text {
    color: #495057;
    font-weight: 500;
}

/* Etapa 2: Perfiles */
.cp-profile-container h3 {
    color: #1d2327;
    margin-bottom: 25px;
    font-size: 24px;
    text-align: center;
}

.cp-profile-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.cp-profile-option {
    height: 100%;
}

.cp-radio-card {
    display: block;
    height: 100%;
    cursor: pointer;
}

.cp-radio-card input[type="radio"] {
    display: none;
}

.cp-radio-content {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 30px 20px 20px 20px;
    text-align: center;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #fff;
}

.cp-radio-card:hover .cp-radio-content {
    border-color: #007cba;
    box-shadow: 0 4px 12px rgba(0,124,186,0.1);
}

.cp-radio-card input[type="radio"]:checked + .cp-radio-content {
    border-color: #007cba;
    background: #e7f3ff;
    box-shadow: 0 4px 16px rgba(0,124,186,0.15);
}

.cp-radio-icon {
    font-size: 48px;
    color: #6c757d;
    margin-bottom: 15px;
    transition: color 0.3s ease;
}

.cp-radio-card:hover .cp-radio-icon,
.cp-radio-card input[type="radio"]:checked + .cp-radio-content .cp-radio-icon {
    color: #007cba;
}

.cp-icon-perfil {
    font-size: 60px;
    line-height: 1;
    text-align: center;
    display: inline-block;
    width: 60px;
    height: 60px;
    vertical-align: middle;
}

.cp-radio-content h4 {
    margin: 0 0 10px 0;
    color: #1d2327;
    font-size: 20px;
    font-weight: 600;
}

.cp-radio-content p {
    margin: 0;
    color: #6c757d;
    font-size: 14px;
    line-height: 1.4;
}

/* Etapa 3: Búsqueda */
.cp-search-container h3 {
    color: #1d2327;
    margin-bottom: 25px;
    font-size: 24px;
}

.cp-search-form {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.cp-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

.cp-form-group {
    display: flex;
    flex-direction: column;
}

.cp-form-group-full {
    grid-column: 1 / -1;
}

.cp-form-group label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.cp-help-text {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 13px;
}

.required {
    color: #dc3545;
    font-weight: 700;
}

.cp-form-group input {
    padding: 12px 16px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    background: white;
}

.cp-form-group input:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0,124,186,0.1);
}

.cp-form-group input:invalid {
    border-color: #dc3545;
}

.cp-profile-info {
    background: #e7f3ff;
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 25px;
    border-left: 4px solid #007cba;
}

.cp-profile-info p {
    margin: 0;
    color: #495057;
}

#cp-selected-profile {
    font-weight: 600;
    color: #007cba;
    text-transform: capitalize;
}

/* NUEVO: Indicador de progreso de búsqueda */
.cp-search-progress-container {
    padding: 40px;
    background: linear-gradient(135deg, #233A79 0%, #3F4C6B 100%);
    color: white;
    animation: progressSlideIn 0.5s ease;
}

@keyframes progressSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cp-search-progress-header {
    text-align: center;
    margin-bottom: 30px;
}

.cp-search-progress-header h3 {
    color: white;
    font-size: 24px;
    margin-bottom: 20px;
    font-weight: 600;
}

.cp-overall-progress {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    height: 12px;
    margin-bottom: 10px;
    overflow: hidden;
    position: relative;
}

.cp-progress-bar-fill {
    background: linear-gradient(90deg, #28a745, #20c997);
    height: 100%;
    border-radius: 25px;
    transition: width 0.8s ease;
    position: relative;
    overflow: hidden;
}

.cp-progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: progressShimmer 2s infinite;
}

@keyframes progressShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.cp-progress-percentage {
    font-size: 18px;
    font-weight: 600;
    color: white;
}

/* Progreso de fuentes de datos */
.cp-search-sources-progress {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
}

.cp-source-progress {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.cp-source-progress:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.cp-source-progress.pending {
    opacity: 0.7;
}

.cp-source-progress.running {
    animation: sourcePulse 2s infinite;
}

.cp-source-progress.completed {
    background: rgba(40, 167, 69, 0.2);
    border-color: rgba(40, 167, 69, 0.4);
}

.cp-source-progress.error {
    background: rgba(220, 53, 69, 0.2);
    border-color: rgba(220, 53, 69, 0.4);
}

@keyframes sourcePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.cp-source-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    gap: 12px;
}

.cp-source-icon {
    font-size: 20px;
    color: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
}

.cp-source-progress.running .cp-source-icon .dashicons-update-alt {
    animation: spin 1s linear infinite;
}

.cp-source-progress.completed .cp-source-icon {
    color: #28a745;
}

.cp-source-progress.error .cp-source-icon {
    color: #dc3545;
}

.cp-source-title {
    font-weight: 600;
    font-size: 16px;
    color: white;
    flex: 1;
}

.cp-source-status {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cp-source-progress.completed .cp-source-status {
    background: rgba(40, 167, 69, 0.3);
    color: #28a745;
}

.cp-source-progress.error .cp-source-status {
    background: rgba(220, 53, 69, 0.3);
    color: #dc3545;
}

.cp-source-progress-bar {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    height: 8px;
    margin-bottom: 10px;
    overflow: hidden;
}

.cp-source-progress-fill {
    background: linear-gradient(90deg, #00d4ff, #007cba);
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease;
    position: relative;
}

.cp-source-progress.completed .cp-source-progress-fill {
    background: linear-gradient(90deg, #28a745, #20c997);
}

.cp-source-progress.error .cp-source-progress-fill {
    background: linear-gradient(90deg, #dc3545, #fd7e14);
}

.cp-source-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.cp-source-message {
    color: rgba(255, 255, 255, 0.9);
    flex: 1;
}

.cp-source-records {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    font-size: 12px;
}

.cp-source-progress.completed .cp-source-records {
    background: rgba(40, 167, 69, 0.2);
    color: white;
}

/* Acciones de progreso */
.cp-progress-actions {
    text-align: center;
}

/* Botones */
.cp-form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    padding-top: 30px;
    margin-top: 30px;
}

.cp-btn {
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    min-width: 120px;
    justify-content: center;
}

.cp-btn-primary {
    background: #233A79;
    color: white;
}

.cp-btn-primary:hover {
    background: #005a87;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,124,186,0.3);
}

.cp-btn-secondary {
    background: #6c757d;
    color: white;
}

.cp-btn-secondary:hover {
    background: #545b62;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(108,117,125,0.3);
}

.cp-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.cp-btn-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Resultados parciales y timeout */
.cp-partial-results {
    background: #fff3cd !important;
    border-left-color: #ffc107 !important;
}

.cp-partial-results p {
    color: #856404 !important;
}

.cp-timeout-info {
    background: #d1ecf1;
    color: #0c5460;
    padding: 15px 20px;
    border-radius: 6px;
    border: 1px solid #bee5eb;
    margin: 15px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: messageSlideIn 0.3s ease;
}

.cp-timeout-info .dashicons {
    font-size: 18px;
    color: #0c5460;
}

.cp-partial-no-results {
    text-align: center;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 6px;
    color: #6c757d;
    margin: 20px 0;
}

.cp-partial-no-results .dashicons {
    font-size: 32px;
    margin-bottom: 10px;
    opacity: 0.7;
    display: block;
}

.cp-partial-no-results p {
    margin: 0;
    font-style: italic;
}

/* Resultados */
.cp-results-container {
    margin-top: 30px;
    padding: 30px 40px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.cp-results-container h3 {
    color: #1d2327;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cp-results-summary {
    background: #e7f3ff;
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    border-left: 4px solid #007cba;
}

.cp-results-summary p {
    margin: 0;
    color: #495057;
}

.cp-results-content {
    background: white;
    border-radius: 6px;
    padding: 20px;
    border: 1px solid #dee2e6;
}

.cp-result-section {
    margin-bottom: 30px;
}

.cp-result-section:last-child {
    margin-bottom: 0;
}

.cp-result-section h4 {
    color: #007cba;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 8px;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.cp-result-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 14px;
}

.cp-result-table th,
.cp-result-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
    vertical-align: top;
}

.cp-result-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
}

.cp-result-table tr:hover {
    background: #f8f9fa;
}

.cp-result-table td {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cp-result-table td:hover {
    white-space: normal;
    overflow: visible;
    word-wrap: break-word;
}

.cp-more-records {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    background: #f8f9fa !important;
    font-weight: 500;
}

.cp-no-results {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.cp-no-results .dashicons {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.cp-no-results h4 {
    color: #495057;
    margin-bottom: 10px;
}

/* Estados de carga */
.cp-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #6c757d;
}

.cp-loading .dashicons {
    animation: spin 1s linear infinite;
    margin-right: 10px;
    font-size: 20px;
}

/* Mensajes de error */
.cp-error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px 20px;
    border-radius: 6px;
    border: 1px solid #f5c6cb;
    margin: 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: messageSlideIn 0.3s ease;
}

.cp-success-message {
    background: #d4edda;
    color: #155724;
    padding: 15px 20px;
    border-radius: 6px;
    border: 1px solid #c3e6cb;
    margin: 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: messageSlideIn 0.3s ease;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .cp-frontend-container {
        margin: 0 10px;
        border-radius: 0;
    }
    
    .cp-frontend-title {
        font-size: 24px;
        padding: 20px 20px 0 20px;
    }
    
    .cp-form-step {
        padding: 20px;
    }
    
    .cp-search-progress-container {
        padding: 20px;
    }
    
    .cp-progress-bar {
        flex-direction: column;
    }
    
    .cp-progress-step {
        flex-direction: row;
        justify-content: flex-start;
        padding: 15px 20px;
    }
    
    .cp-progress-step:not(:last-child)::after {
        display: none;
    }
    
    .cp-step-number {
        margin-bottom: 0;
        margin-right: 15px;
    }
    
    .cp-profile-options {
        grid-template-columns: 1fr;
    }
    
    .cp-form-grid {
        grid-template-columns: 1fr;
    }
    
    .cp-form-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .cp-btn {
        min-width: auto;
    }
    
    .cp-results-container {
        padding: 20px;
    }
    
    .cp-result-table {
        font-size: 12px;
    }
    
    .cp-result-table th,
    .cp-result-table td {
        padding: 8px;
    }
    
    .cp-search-sources-progress {
        grid-template-columns: 1fr;
    }
    
    .cp-source-header {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .cp-source-details {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .cp-frontend-title {
        font-size: 20px;
    }
    
    .cp-terms-content {
        padding: 15px;
    }
    
    .cp-radio-content {
        padding: 5px 25px;
    }
    
    .cp-radio-icon {
        font-size: 36px;
    }
    
    .cp-search-form {
        padding: 20px;
    }
    
    .cp-search-progress-header h3 {
        font-size: 20px;
    }
    
    .cp-source-progress {
        padding: 15px;
    }
    
    .cp-source-title {
        font-size: 14px;
    }
    
    .cp-result-table th,
    .cp-result-table td {
        padding: 6px;
        font-size: 11px;
    }
}

/* Accesibilidad */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Alto contraste */
@media (prefers-contrast: high) {
    .cp-frontend-container {
        border: 2px solid #000;
    }
    
    .cp-btn-primary {
        background: #000;
        color: #fff;
        border: 2px solid #000;
    }
    
    .cp-btn-secondary {
        background: #fff;
        color: #000;
        border: 2px solid #000;
    }
    
    .cp-search-progress-container {
        background: #000;
        color: #fff;
    }
    
    .cp-source-progress {
        border: 1px solid #fff;
    }
}

/* Modo oscuro (para temas que lo soporten) */
@media (prefers-color-scheme: dark) {
    .cp-frontend-container {
        background: #1a1a1a;
        color: #e0e0e0;
        border: 1px solid #404040;
    }
    
    .cp-frontend-title {
        color: #e0e0e0;
    }
    
    .cp-progress-bar {
        background: #2a2a2a;
        border-bottom-color: #404040;
    }
    
    .cp-form-step {
        background: #1a1a1a;
    }
    
    .cp-terms-content {
        background: #2a2a2a;
        border-color: #404040;
        color: #e0e0e0;
    }
    
    .cp-search-form {
        background: #2a2a2a;
        border-color: #404040;
    }
    
    .cp-form-group input {
        background: #1a1a1a;
        border-color: #404040;
        color: #e0e0e0;
    }
    
    .cp-form-group input:focus {
        border-color: #007cba;
    }
    
    .cp-radio-content {
        background: #2a2a2a;
        border-color: #404040;
    }
    
    .cp-radio-card:hover .cp-radio-content {
        background: #333;
    }
    
    .cp-results-container {
        background: #2a2a2a;
        border-top-color: #404040;
    }
    
    .cp-results-content {
        background: #1a1a1a;
        border-color: #404040;
    }
    
    .cp-result-table th {
        background: #333;
        color: #e0e0e0;
    }
    
    .cp-result-table tr:hover {
        background: #333;
    }
    
    .cp-search-progress-container {
        background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
    }
    
    .cp-source-progress {
        background: rgba(255, 255, 255, 0.05);
        border-color: rgba(255, 255, 255, 0.1);
    }
}

/* Animaciones adicionales */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cp-result-section {
    animation: fadeInUp 0.5s ease forwards;
}

.cp-result-section:nth-child(2) {
    animation-delay: 0.1s;
}

.cp-result-section:nth-child(3) {
    animation-delay: 0.2s;
}

.cp-result-section:nth-child(4) {
    animation-delay: 0.3s;
}

/* Efectos de hover mejorados */
.cp-source-progress:hover .cp-source-title {
    color: #fff;
}

.cp-btn:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.cp-btn:active {
    transform: translateY(0);
}

/* Mejoras de usabilidad */
.cp-form-group input:invalid:not(:focus) {
    border-color: #dc3545;
    background-color: #fff5f5;
}

.cp-form-group input:valid:not(:focus) {
    border-color: #28a745;
}

/* Loading states */
.cp-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.cp-btn.loading .cp-btn-text {
    opacity: 0;
}

.cp-btn.loading .cp-btn-spinner {
    display: inline-block;
    position: absolute;
}

/* Scrollbar personalizado para tables */
.table-responsive::-webkit-scrollbar {
    height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}


/* ==========================================================================
   EXPORTACIÓN DE RESULTADOS
   ========================================================================== */

.cp-export-actions {
    background: #f8f9fa;
    border: 1px solid #e3e4e6;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}

.cp-export-excel {
    background: #217346 !important;
    border-color: #217346 !important;
    color: white !important;
    padding: 12px 24px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    transition: all 0.3s ease !important;
    text-decoration: none !important;
    cursor: pointer !important;
}

.cp-export-excel:hover {
    background: #1e6b3e !important;
    border-color: #1e6b3e !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(33, 115, 70, 0.3) !important;
}

.cp-export-excel:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 4px rgba(33, 115, 70, 0.3) !important;
}

.cp-export-excel:disabled {
    background: #6c757d !important;
    border-color: #6c757d !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

.cp-export-excel .dashicons {
    font-size: 16px !important;
    line-height: 1 !important;
}

.cp-export-help {
    display: block;
    margin-top: 10px;
    color: #6c757d;
    font-style: italic;
    font-size: 12px;
}

/* Mensaje de éxito de exportación */
.cp-export-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    padding: 16px 20px;
    margin: 15px 0;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: slideInDown 0.4s ease-out;
}

.cp-export-success .dashicons {
    color: #155724;
    font-size: 20px;
    margin-top: 2px;
    flex-shrink: 0;
}

.cp-export-message {
    color: #155724;
    font-size: 14px;
    line-height: 1.5;
}

.cp-export-message strong {
    color: #0f4419;
    font-weight: 600;
}

.cp-export-message small {
    color: #6c757d;
    font-size: 12px;
}

/* Animación de spinning para el indicador de carga */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.cp-spin {
    animation: spin 1s linear infinite;
}

/* Animación de entrada */
@keyframes slideInDown {
    0% {
        opacity: 0;
        transform: translateY(-20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive para botón de exportación */
@media (max-width: 768px) {
    .cp-export-actions {
        padding: 15px;
    }
    
    .cp-export-excel {
        padding: 10px 20px !important;
        font-size: 13px !important;
        width: 100%;
        justify-content: center !important;
    }
    
    .cp-export-help {
        font-size: 11px;
        margin-top: 8px;
    }
    
    .cp-export-success {
        padding: 12px 16px;
        flex-direction: column;
        gap: 8px;
    }
    
    .cp-export-success .dashicons {
        align-self: flex-start;
    }
}

.cp-auto-download-message {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 1px solid #c3e6cb;
    border-left: 4px solid #28a745;
    border-radius: 8px;
    padding: 16px 20px;
    margin: 15px 0 25px 0;
    display: flex;
    align-items: flex-start;
    gap: 15px;
    animation: autoDownloadSlideIn 0.5s ease-out;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.1);
    position: relative;
}

.cp-auto-download-icon {
    color: #155724;
    font-size: 24px;
    flex-shrink: 0;
    margin-top: 2px;
}

.cp-auto-download-icon .dashicons {
    animation: downloadBounce 2s ease-in-out infinite;
}

.cp-auto-download-content {
    color: #155724;
    font-size: 14px;
    line-height: 1.5;
    flex: 1;
}

.cp-auto-download-content strong {
    color: #0f4419;
    font-weight: 600;
    font-size: 15px;
}

.cp-auto-download-filename {
    color: #0f4419;
    font-weight: 500;
    font-family: 'Courier New', monospace;
    background: rgba(15, 68, 25, 0.1);
    padding: 2px 6px;
    border-radius: 3px;
    display: inline-block;
    margin: 4px 0;
}

.cp-auto-download-details {
    color: #6c757d;
    font-size: 12px;
    font-style: italic;
}

.cp-auto-download-close {
    color: #6c757d;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.cp-auto-download-close:hover {
    color: #495057;
    background: rgba(108, 117, 125, 0.1);
}

.cp-auto-download-close .dashicons {
    font-size: 16px;
}

/* Animaciones para descarga automática */
@keyframes autoDownloadSlideIn {
    0% {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes downloadBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-4px);
    }
}

/* Modificación del botón manual para diferenciarlo */
.cp-export-actions .cp-export-excel {
    background: #6c757d !important;
    border-color: #6c757d !important;
}

.cp-export-actions .cp-export-excel:hover {
    background: #545b62 !important;
    border-color: #545b62 !important;
}

.cp-export-help {
    color: #6c757d !important;
    font-size: 12px !important;
    font-style: italic !important;
    text-align: center !important;
    margin-top: 10px !important;
    line-height: 1.4 !important;
}

/* Estados de descarga automática */
.cp-auto-download-message.downloading {
    background: linear-gradient(135deg, #cce7ff 0%, #b8daff 100%);
    border-color: #007bff;
    border-left-color: #007bff;
}

.cp-auto-download-message.downloading .cp-auto-download-icon {
    color: #004085;
}

.cp-auto-download-message.downloading .cp-auto-download-content {
    color: #004085;
}

.cp-auto-download-message.downloading .cp-auto-download-content strong {
    color: #002752;
}

.cp-auto-download-message.error {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border-color: #dc3545;
    border-left-color: #dc3545;
}

.cp-auto-download-message.error .cp-auto-download-icon {
    color: #721c24;
}

.cp-auto-download-message.error .cp-auto-download-content {
    color: #721c24;
}

.cp-auto-download-message.error .cp-auto-download-content strong {
    color: #491217;
}

/* Responsive para descarga automática */
@media (max-width: 768px) {
    .cp-auto-download-message {
        padding: 12px 16px;
        gap: 12px;
        margin: 10px 0 20px 0;
    }
    
    .cp-auto-download-icon {
        font-size: 20px;
    }
    
    .cp-auto-download-content {
        font-size: 13px;
    }
    
    .cp-auto-download-content strong {
        font-size: 14px;
    }
    
    .cp-auto-download-filename {
        font-size: 11px;
        padding: 1px 4px;
    }
    
    .cp-auto-download-details {
        font-size: 11px;
    }
    
    .cp-export-help {
        font-size: 11px !important;
        margin-top: 8px !important;
    }
}

@media (max-width: 480px) {
    .cp-auto-download-message {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .cp-auto-download-close {
        position: absolute;
        top: 8px;
        right: 8px;
    }
    
    .cp-auto-download-filename {
        display: block;
        word-break: break-all;
    }
}

/* Mejoras visuales adicionales */
.cp-auto-download-message::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #28a745, #20c997, #28a745);
    border-radius: 8px 8px 0 0;
    animation: downloadProgress 3s ease-in-out;
}

@keyframes downloadProgress {
    0% {
        background-size: 0% 100%;
    }
    100% {
        background-size: 100% 100%;
    }
}

/* Mejorar el contraste del botón manual */
.cp-export-actions {
    border-left: 4px solid #6c757d !important;
}

.cp-export-actions::before {
    content: '📋';
    position: absolute;
    top: -8px;
    left: 16px;
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    border: 1px solid #dee2e6;
}

.cp-export-actions {
    position: relative;
    margin-top: 25px !important;
}

/* ==========================================================================
   EXPORTACIÓN DE PDF SIN RESULTADOS
   ========================================================================== */

.cp-export-pdf-actions {
    background: #f8f9fa;
    border: 1px solid #e3e4e6;
    border-left: 4px solid #233A79 !important;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
    position: relative;
}

.cp-export-pdf-actions::before {
    content: '📄';
    position: absolute;
    top: -8px;
    left: 16px;
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    border: 1px solid #dee2e6;
}

.cp-export-pdf-no-results {
    background: #233A79 !important;
    border-color: #233A79 !important;
    color: white !important;
    padding: 12px 24px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    transition: all 0.3s ease !important;
    text-decoration: none !important;
    cursor: pointer !important;
}

.cp-export-pdf-no-results:hover {
    background: #233A79 !important;
    border-color: #233A79 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3) !important;
}

.cp-export-pdf-no-results:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3) !important;
}

.cp-export-pdf-no-results:disabled {
    background: #6c757d !important;
    border-color: #6c757d !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

.cp-export-pdf-no-results .dashicons {
    font-size: 16px !important;
    line-height: 1 !important;
}

/* Mensaje de éxito de exportación PDF */
.cp-export-pdf-success {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border: 1px solid #f5c6cb;
    border-left: 4px solid #dc3545;
    border-radius: 8px;
    padding: 16px 20px;
    margin: 15px 0;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: slideInDown 0.4s ease-out;
}

.cp-export-pdf-success .dashicons {
    color: #721c24;
    font-size: 20px;
    margin-top: 2px;
    flex-shrink: 0;
}

.cp-export-pdf-success .cp-export-message {
    color: #721c24;
    font-size: 14px;
    line-height: 1.5;
}

.cp-export-pdf-success .cp-export-message strong {
    color: #491217;
    font-weight: 600;
}

.cp-export-pdf-success .cp-export-message small {
    color: #6c757d;
    font-size: 12px;
}

/* Mensaje de descarga automática de PDF */
.cp-auto-download-pdf-message {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border: 1px solid #f5c6cb;
    border-left: 4px solid #dc3545;
    border-radius: 8px;
    padding: 16px 20px;
    margin: 15px 0 25px 0;
    display: flex;
    align-items: flex-start;
    gap: 15px;
    animation: autoDownloadSlideIn 0.5s ease-out;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.1);
    position: relative;
}

.cp-auto-download-pdf-message .cp-auto-download-icon {
    color: #721c24;
    font-size: 24px;
    flex-shrink: 0;
    margin-top: 2px;
}

.cp-auto-download-pdf-message .cp-auto-download-icon .dashicons {
    animation: downloadBounce 2s ease-in-out infinite;
}

.cp-auto-download-pdf-message .cp-auto-download-content {
    color: #721c24;
    font-size: 14px;
    line-height: 1.5;
    flex: 1;
}

.cp-auto-download-pdf-message .cp-auto-download-content strong {
    color: #491217;
    font-weight: 600;
    font-size: 15px;
}

.cp-auto-download-pdf-message .cp-auto-download-filename {
    color: #491217;
    font-weight: 500;
    font-family: 'Courier New', monospace;
    background: rgba(73, 18, 23, 0.1);
    padding: 2px 6px;
    border-radius: 3px;
    display: inline-block;
    margin: 4px 0;
}

.cp-auto-download-pdf-message .cp-auto-download-details {
    color: #6c757d;
    font-size: 12px;
    font-style: italic;
}

.cp-auto-download-pdf-message .cp-auto-download-close {
    color: #6c757d;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.cp-auto-download-pdf-message .cp-auto-download-close:hover {
    color: #495057;
    background: rgba(108, 117, 125, 0.1);
}

.cp-auto-download-pdf-message .cp-auto-download-close .dashicons {
    font-size: 16px;
}

/* Efecto de progreso para PDF */
.cp-auto-download-pdf-message::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #dc3545, #fd7e14, #dc3545);
    border-radius: 8px 8px 0 0;
    animation: downloadProgress 3s ease-in-out;
}

/* Mejorar el mensaje de sin resultados */
.cp-no-results {
    text-align: center;
    padding: 40px;
    color: #6c757d;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.cp-no-results .dashicons {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
    color: #dc3545;
}

.cp-no-results h4 {
    color: #495057;
    margin-bottom: 10px;
    font-size: 18px;
}

.cp-no-results p {
    margin: 10px 0;
    font-size: 14px;
}

.cp-no-results-info {
    background: #e7f3ff;
    border: 1px solid #b8daff;
    border-radius: 6px;
    padding: 15px;
    margin-top: 20px;
    text-align: left;
}

.cp-no-results-info p {
    margin: 5px 0;
    color: #004085;
}

.cp-no-results-info small {
    font-size: 12px;
}

/* Responsive para PDF */
@media (max-width: 768px) {
    .cp-export-pdf-actions {
        padding: 15px;
    }
    
    .cp-export-pdf-no-results {
        padding: 10px 20px !important;
        font-size: 13px !important;
        width: 100%;
        justify-content: center !important;
    }
    
    .cp-auto-download-pdf-message {
        padding: 12px 16px;
        gap: 12px;
        margin: 10px 0 20px 0;
    }
    
    .cp-auto-download-pdf-message .cp-auto-download-icon {
        font-size: 20px;
    }
    
    .cp-auto-download-pdf-message .cp-auto-download-content {
        font-size: 13px;
    }
    
    .cp-auto-download-pdf-message .cp-auto-download-content strong {
        font-size: 14px;
    }
    
    .cp-auto-download-pdf-message .cp-auto-download-filename {
        font-size: 11px;
        padding: 1px 4px;
    }
    
    .cp-auto-download-pdf-message .cp-auto-download-details {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .cp-auto-download-pdf-message {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .cp-auto-download-pdf-message .cp-auto-download-close {
        position: absolute;
        top: 8px;
        right: 8px;
    }
    
    .cp-auto-download-pdf-message .cp-auto-download-filename {
        display: block;
        word-break: break-all;
    }
    
    .cp-no-results {
        padding: 20px;
    }
    
    .cp-no-results .dashicons {
        font-size: 36px;
    }
    
    .cp-no-results h4 {
        font-size: 16px;
    }
    
    .cp-no-results-info {
        padding: 10px;
    }
}

/* ==========================================================================
   PDF CON RESULTADOS - NUEVOS ESTILOS
   ========================================================================== */

/* Botón de PDF con resultados */
.cp-export-pdf-results {
    background: #dc3545 !important;
    border-color: #dc3545 !important;
    color: white !important;
    padding: 12px 24px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    transition: all 0.3s ease !important;
    text-decoration: none !important;
    cursor: pointer !important;
    margin-left: 15px !important;
}

.cp-export-pdf-results:hover {
    background: #c82333 !important;
    border-color: #c82333 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3) !important;
}

.cp-export-pdf-results:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3) !important;
}

.cp-export-pdf-results:disabled {
    background: #6c757d !important;
    border-color: #6c757d !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

.cp-export-pdf-results .dashicons {
    font-size: 16px !important;
    line-height: 1 !important;
}

/* Ajustar botones para que estén en línea */
.cp-export-actions {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 15px !important;
    flex-wrap: wrap !important;
}

/* Mensaje de éxito de exportación PDF con resultados */
.cp-export-pdf-results-success {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border: 1px solid #f5c6cb;
    border-left: 4px solid #dc3545;
    border-radius: 8px;
    padding: 16px 20px;
    margin: 15px 0;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: slideInDown 0.4s ease-out;
}

.cp-export-pdf-results-success .dashicons {
    color: #721c24;
    font-size: 20px;
    margin-top: 2px;
    flex-shrink: 0;
}

.cp-export-pdf-results-success .cp-export-message {
    color: #721c24;
    font-size: 14px;
    line-height: 1.5;
}

.cp-export-pdf-results-success .cp-export-message strong {
    color: #491217;
    font-weight: 600;
}

.cp-export-pdf-results-success .cp-export-message small {
    color: #6c757d;
    font-size: 12px;
}

/* Mensaje de descarga automática de PDF con resultados */
.cp-auto-download-pdf-results-message {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border: 1px solid #f5c6cb;
    border-left: 4px solid #dc3545;
    border-radius: 8px;
    padding: 16px 20px;
    margin: 15px 0 25px 0;
    display: flex;
    align-items: flex-start;
    gap: 15px;
    animation: autoDownloadSlideIn 0.5s ease-out;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.1);
    position: relative;
}

.cp-auto-download-pdf-results-message .cp-auto-download-icon {
    color: #721c24;
    font-size: 24px;
    flex-shrink: 0;
    margin-top: 2px;
}

.cp-auto-download-pdf-results-message .cp-auto-download-icon .dashicons {
    animation: downloadBounce 2s ease-in-out infinite;
}

.cp-auto-download-pdf-results-message .cp-auto-download-content {
    color: #721c24;
    font-size: 14px;
    line-height: 1.5;
    flex: 1;
}

.cp-auto-download-pdf-results-message .cp-auto-download-content strong {
    color: #491217;
    font-weight: 600;
    font-size: 15px;
}

.cp-auto-download-pdf-results-message .cp-auto-download-filename {
    color: #491217;
    font-weight: 500;
    font-family: 'Courier New', monospace;
    background: rgba(73, 18, 23, 0.1);
    padding: 2px 6px;
    border-radius: 3px;
    display: inline-block;
    margin: 4px 0;
}

.cp-auto-download-pdf-results-message .cp-auto-download-details {
    color: #6c757d;
    font-size: 12px;
    font-style: italic;
}

.cp-auto-download-pdf-results-message .cp-auto-download-close {
    color: #6c757d;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.cp-auto-download-pdf-results-message .cp-auto-download-close:hover {
    color: #495057;
    background: rgba(108, 117, 125, 0.1);
}

.cp-auto-download-pdf-results-message .cp-auto-download-close .dashicons {
    font-size: 16px;
}

/* Efecto de progreso para PDF con resultados */
.cp-auto-download-pdf-results-message::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #dc3545, #fd7e14, #dc3545);
    border-radius: 8px 8px 0 0;
    animation: downloadProgress 3s ease-in-out;
}

/* Actualizar el mensaje de ayuda para incluir ambos botones */
.cp-export-help {
    display: block !important;
    margin-top: 15px !important;
    color: #6c757d !important;
    font-size: 12px !important;
    font-style: italic !important;
    text-align: center !important;
    line-height: 1.4 !important;
}

/* Responsive para botones de PDF con resultados */
@media (max-width: 768px) {
    .cp-export-actions {
        flex-direction: column !important;
        gap: 10px !important;
    }
    
    .cp-export-pdf-results {
        margin-left: 0 !important;
        width: 100% !important;
        justify-content: center !important;
    }
    
    .cp-export-excel {
        width: 100% !important;
        justify-content: center !important;
    }
    
    .cp-auto-download-pdf-results-message {
        padding: 12px 16px;
        gap: 12px;
        margin: 10px 0 20px 0;
    }
    
    .cp-auto-download-pdf-results-message .cp-auto-download-icon {
        font-size: 20px;
    }
    
    .cp-auto-download-pdf-results-message .cp-auto-download-content {
        font-size: 13px;
    }
    
    .cp-auto-download-pdf-results-message .cp-auto-download-content strong {
        font-size: 14px;
    }
    
    .cp-auto-download-pdf-results-message .cp-auto-download-filename {
        font-size: 11px;
        padding: 1px 4px;
    }
    
    .cp-auto-download-pdf-results-message .cp-auto-download-details {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .cp-auto-download-pdf-results-message {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .cp-auto-download-pdf-results-message .cp-auto-download-close {
        position: absolute;
        top: 8px;
        right: 8px;
    }
    
    .cp-auto-download-pdf-results-message .cp-auto-download-filename {
        display: block;
        word-break: break-all;
    }
}

/* Mejorar el orden visual de los mensajes de descarga automática */
.cp-auto-download-message + .cp-auto-download-pdf-results-message {
    margin-top: 10px;
}

/* Efectos visuales adicionales */
.cp-export-pdf-results:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.25) !important;
}

/* Indicador de carga para PDF */
.cp-export-pdf-results .cp-spin {
    animation: spin 1s linear infinite;
}

/* Mejorar la separación entre botones cuando están en línea */
.cp-export-actions .cp-btn + .cp-btn {
    margin-left: 15px;
}

@media (max-width: 768px) {
    .cp-export-actions .cp-btn + .cp-btn {
        margin-left: 0;
        margin-top: 10px;
    }
}

/* ==========================================================================
   AVISO DE LÍMITE DE REGISTROS EXCEDIDO - ESTILOS MODERNOS
   ========================================================================== */

.cp-limit-exceeded-container {
    background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%);
    border: 2px solid #ff9800;
    border-radius: 16px;
    padding: 30px;
    margin: 20px 0;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(255, 152, 0, 0.2);
    animation: limitWarningSlideIn 0.6s ease-out;
}

.cp-limit-exceeded-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ff9800, #ffc107, #ff9800);
    animation: limitGradientShift 3s ease-in-out infinite;
}

/* Header del Aviso */
.cp-limit-header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

.cp-limit-icon {
    position: relative;
    display: inline-block;
    margin-bottom: 15px;
}

.cp-limit-emoji {
    font-size: 64px;
    display: inline-block;
    animation: limitIconBounce 2s ease-in-out infinite;
    filter: drop-shadow(0 4px 8px rgba(255, 152, 0, 0.3));
}

.cp-limit-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    border: 3px solid #ff9800;
    border-radius: 50%;
    opacity: 0;
    animation: limitPulse 2s ease-out infinite;
}

.cp-limit-title {
    text-align: center;
    color: #e65100;
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 5px 0;
    text-shadow: 0 2px 4px rgba(230, 81, 0, 0.1);
}

.cp-limit-subtitle {
    color: #f57c00;
    font-size: 16px;
    margin: 0;
    font-weight: 500;
}

.cp-limit-subtitle strong {
    color: #e65100;
    font-weight: 700;
}

/* Estadísticas por Fuente */
.cp-limit-stats {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 152, 0, 0.2);
}

.cp-limit-stats h4 {
    color: #e65100;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 15px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cp-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.cp-stat-item {
    background: white;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.cp-stat-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 8px 8px 0 0;
}

.cp-stat-item.high {
    border-color: #f44336;
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.2);
}

.cp-stat-item.high::before {
    background: linear-gradient(90deg, #f44336, #ff5722);
}

.cp-stat-item.medium {
    border-color: #ff9800;
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.2);
}

.cp-stat-item.medium::before {
    background: linear-gradient(90deg, #ff9800, #ffc107);
}

.cp-stat-item.low {
    border-color: #4caf50;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.2);
}

.cp-stat-item.low::before {
    background: linear-gradient(90deg, #4caf50, #8bc34a);
}

.cp-stat-number {
    font-size: 24px;
    font-weight: 700;
    color: #e65100;
    margin-bottom: 5px;
}

.cp-stat-label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
    margin-bottom: 10px;
}

.cp-stat-bar {
    height: 4px;
    background: #f0f0f0;
    border-radius: 2px;
    overflow: hidden;
}

.cp-stat-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 1s ease;
}

.cp-stat-item.high .cp-stat-fill {
    background: linear-gradient(90deg, #f44336, #ff5722);
}

.cp-stat-item.medium .cp-stat-fill {
    background: linear-gradient(90deg, #ff9800, #ffc107);
}

.cp-stat-item.low .cp-stat-fill {
    background: linear-gradient(90deg, #4caf50, #8bc34a);
}

/* Mensaje de Performance */
.cp-limit-message {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    display: flex;
    align-items: flex-start;
    gap: 15px;
    border-left: 4px solid #ff9800;
}

.cp-message-icon {
    font-size: 32px;
    flex-shrink: 0;
    margin-top: 5px;
}

.cp-message-content {
    flex: 1;
}

.cp-message-content p {
    margin: 0 0 10px 0;
    color: #555;
    line-height: 1.6;
}

.cp-message-content p:last-child {
    margin-bottom: 0;
}

.cp-message-content strong {
    color: #e65100;
    font-weight: 600;
}

/* Sugerencias */
.cp-limit-suggestions {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
}

.cp-limit-suggestions h4 {
    color: #e65100;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cp-suggestion-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
}

.cp-suggestion-item:hover {
    border-color: #ff9800;
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.1);
}

.cp-suggestion-item:last-child {
    margin-bottom: 0;
}

.cp-suggestion-icon {
    font-size: 28px;
    flex-shrink: 0;
    margin-top: 5px;
}

.cp-suggestion-content {
    flex: 1;
}

.cp-suggestion-content h5 {
    color: #e65100;
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 10px 0;
}

.cp-suggestion-content p {
    color: #666;
    margin: 5px 0;
    line-height: 1.5;
}

.cp-suggestion-content strong {
    color: #e65100;
    font-weight: 600;
}

/* Botones de Sugerencia de Fechas */
.cp-date-suggestions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.cp-btn-suggestion {
    background: linear-gradient(135deg, #ff9800, #ffc107) !important;
    color: white !important;
    border: none !important;
    padding: 8px 16px !important;
    border-radius: 20px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.3) !important;
}

.cp-btn-suggestion:hover {
    background: linear-gradient(135deg, #f57c00, #ffb300) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 16px rgba(255, 152, 0, 0.4) !important;
}

.cp-btn-suggestion:active {
    transform: translateY(0) !important;
}

/* Acciones Principales */
.cp-limit-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.cp-limit-actions .cp-btn {
    padding: 14px 28px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1) !important;
}

.cp-limit-actions .cp-btn-primary {
    background: linear-gradient(135deg, #ff9800, #f57c00) !important;
    border-color: #ff9800 !important;
    color: white !important;
}

.cp-limit-actions .cp-btn-primary:hover {
    background: linear-gradient(135deg, #f57c00, #ef6c00) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(255, 152, 0, 0.4) !important;
}

.cp-limit-actions .cp-btn-secondary {
    background: linear-gradient(135deg, #6c757d, #495057) !important;
    border-color: #6c757d !important;
    color: white !important;
}

.cp-limit-actions .cp-btn-secondary:hover {
    background: linear-gradient(135deg, #495057, #343a40) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.4) !important;
}

/* Información Adicional */
.cp-limit-info {
    margin-top: 20px;
}

.cp-technical-details {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    padding: 15px;
    border: 1px solid rgba(255, 152, 0, 0.2);
}

.cp-technical-details summary {
    cursor: pointer;
    font-weight: 600;
    color: #e65100;
    padding: 5px 0;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cp-technical-details summary:hover {
    color: #f57c00;
}

.cp-technical-details summary::before {
    content: '🔧';
    font-size: 16px;
}

.cp-details-content {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 152, 0, 0.2);
}

.cp-details-content p {
    color: #666;
    margin: 5px 0;
    line-height: 1.5;
}

.cp-details-content ul {
    color: #666;
    margin: 10px 0;
    padding-left: 20px;
}

.cp-details-content li {
    margin: 5px 0;
}

.cp-details-content strong {
    color: #e65100;
    font-weight: 600;
}

/* Campo Actualizado - Efecto Visual */
.cp-field-updated {
    background: linear-gradient(135deg, #e8f5e8, #c8e6c8) !important;
    border-color: #4caf50 !important;
    animation: fieldUpdateHighlight 3s ease !important;
}

/* Animaciones */
@keyframes limitWarningSlideIn {
    0% {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes limitGradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

@keyframes limitIconBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes limitPulse {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    50% {
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.2);
    }
}

@keyframes fieldUpdateHighlight {
    0% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.8);
    }
    50% {
        box-shadow: 0 0 20px 5px rgba(76, 175, 80, 0.4);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .cp-limit-exceeded-container {
        padding: 20px;
        margin: 10px 0;
        border-radius: 12px;
    }
    
    .cp-limit-emoji {
        font-size: 48px;
    }
    
    .cp-limit-title {
        font-size: 24px;
    }
    
    .cp-limit-subtitle {
        font-size: 14px;
    }
    
    .cp-stats-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .cp-suggestion-item {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .cp-date-suggestions {
        justify-content: center;
    }
    
    .cp-limit-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .cp-limit-actions .cp-btn {
        width: 100%;
        justify-content: center !important;
    }
    
    .cp-limit-message {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .cp-limit-exceeded-container {
        padding: 15px;
    }
    
    .cp-limit-emoji {
        font-size: 40px;
    }
    
    .cp-limit-title {
        font-size: 20px;
    }
    
    .cp-stat-number {
        font-size: 20px;
    }
    
    .cp-suggestion-content h5 {
        font-size: 14px;
    }
    
    .cp-suggestion-content p {
        font-size: 13px;
    }
    
    .cp-btn-suggestion {
        padding: 6px 12px !important;
        font-size: 12px !important;
    }
    
    .cp-limit-actions .cp-btn {
        padding: 12px 20px !important;
        font-size: 14px !important;
    }
}

/* Modo Oscuro */
@media (prefers-color-scheme: dark) {
    .cp-limit-exceeded-container {
        background: linear-gradient(135deg, #2d1810 0%, #3d2317 100%);
        border-color: #ff9800;
        color: #f0f0f0;
    }
    
    .cp-limit-stats,
    .cp-limit-message,
    .cp-limit-suggestions {
        background: rgba(0, 0, 0, 0.3);
        color: #f0f0f0;
    }
    
    .cp-suggestion-item {
        background: rgba(0, 0, 0, 0.2);
        border-color: #444;
        color: #f0f0f0;
    }
    
    .cp-technical-details {
        background: rgba(0, 0, 0, 0.2);
        color: #f0f0f0;
    }
    
    .cp-stat-item {
        background: rgba(0, 0, 0, 0.2);
        color: #f0f0f0;
    }
}

/* Alto Contraste */
@media (prefers-contrast: high) {
    .cp-limit-exceeded-container {
        border-width: 3px;
        border-color: #000;
    }
    
    .cp-limit-title {
        color: #000;
        text-shadow: none;
    }
    
    .cp-limit-actions .cp-btn {
        border: 2px solid #000 !important;
    }
}