/* Estilos Generales */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    margin: 0;
    padding: 20px;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.98);
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.loading-spinner {
    text-align: center;
    color: white;
}

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e6ed;
}

.header h1 {
    color: #2c3e50;
    margin: 0 0 10px 0;
    font-size: 2.2em;
    font-weight: 700;
}

.header .subtitle {
    color: #7f8c8d;
    font-size: 1.1em;
    margin: 0;
    font-weight: 400;
}

.icon {
    margin-right: 8px;
}

h1, h2, h3 {
    color: #2c3e50;
}

hr {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 20px 0;
}

/* Stats Container */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-card h3 {
    margin: 0 0 10px 0;
    font-size: 0.9em;
    color: #666;
    font-weight: 600;
}

.stat-card span {
    font-size: 2em;
    font-weight: bold;
    display: block;
}

.stat-total span { color: #3498db; }
.stat-complete span { color: #27ae60; }
.stat-incomplete span { color: #e74c3c; }

/* Controles y Botones */
.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.search-section {
    flex: 1;
    min-width: 300px;
}

#searchInput {
    width: 100%;
    padding: 12px 18px;
    border: 2px solid #e1e8ed;
    border-radius: 25px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
}

#searchInput:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary { 
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%); 
    color: white; 
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}
.btn-primary:hover { 
    background: linear-gradient(135deg, #2980b9 0%, #3498db 100%); 
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.btn-success { 
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%); 
    color: white; 
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.3);
}
.btn-success:hover { 
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%); 
    transform: translateY(-2px);
}

.btn-danger { 
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%); 
    color: white; 
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}
.btn-danger:hover { 
    background: linear-gradient(135deg, #c0392b 0%, #e74c3c 100%); 
    transform: translateY(-2px);
}

.btn-outline-danger {
    background: transparent;
    border: 2px solid #e74c3c;
    color: #e74c3c;
}
.btn-outline-danger:hover {
    background: #e74c3c;
    color: white;
}

/* Filtros */
.filter-controls {
    margin-bottom: 20px;
    padding: 15px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.btn-filter {
    background-color: #fff;
    border: 2px solid #dee2e6;
    color: #495057;
    padding: 10px 18px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
}

.btn-filter:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
    transform: translateY(-1px);
}

.btn-filter.active {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border-color: #3498db;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

/* Tabla */
.table-container { 
    overflow-x: auto; 
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

#studentTable { 
    width: 100%; 
    border-collapse: collapse; 
    background: white;
}

#studentTable th, #studentTable td {
    padding: 18px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

#studentTable th { 
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%); 
    font-weight: 700; 
    color: #495057;
    position: sticky;
    top: 0;
    z-index: 10;
}

#studentTable tbody tr {
    transition: all 0.2s ease;
}

#studentTable tbody tr:hover { 
    background-color: #f8f9fa; 
    transform: scale(1.01);
}

/* Loading states */
.table-loading {
    text-align: center;
    padding: 20px;
}

.loading-dots::after {
    content: '...';
    animation: dots 2s steps(5, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60% { content: '...'; }
    90%, 100% { content: ''; }
}

.table-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

.loading-cell {
    text-align: center;
}

/* Estados */
.status {
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 12px;
    text-transform: uppercase;
    border: 2px solid;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.status-incomplete, .status-incompleto {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #b91c1c;
    border-color: #fecaca;
}

.status-complete, .status-completo {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #166534;
    border-color: #bbf7d0;
}

.action-btn {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    border: 2px solid #3498db;
    color: #3498db;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.action-btn:hover { 
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%); 
    color: white; 
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.status-ok {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #166534;
    font-weight: bold;
    font-size: 1.2em;
}

.missing-docs-list {
    margin: 0;
    padding-left: 20px;
    list-style-type: none;
}

.missing-docs-list li::before {
    content: '⚠️ ';
    margin-right: 8px;
}

/* Error Container */
.error-container {
    text-align: center;
    padding: 40px;
    background: #fee2e2;
    border-radius: 10px;
    margin: 20px 0;
}

.error-message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.error-icon {
    font-size: 2em;
}

.error-content h3 {
    color: #b91c1c;
    margin: 0 0 10px 0;
}

.error-content p {
    color: #991b1b;
    margin: 0 0 15px 0;
}

/* Modal */
.modal {
    display: none; 
    position: fixed; 
    z-index: 1000;
    left: 0; 
    top: 0; 
    width: 100%; 
    height: 100%;
    overflow: auto; 
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    margin: 2% auto; 
    padding: 0;
    border-radius: 15px; 
    max-width: 700px; 
    position: relative;
    animation: slide-down 0.4s ease-out;
    box-shadow: 0 25px 50px rgba(0,0,0,0.25);
    max-height: 95vh;
    overflow-y: auto;
}

.modal-header {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    padding: 20px 30px;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    color: white;
}

@keyframes slide-down {
    from { 
        transform: translateY(-50px) scale(0.9); 
        opacity: 0; 
    }
    to { 
        transform: translateY(0) scale(1); 
        opacity: 1; 
    }
}

.close-btn {
    color: rgba(255,255,255,0.8); 
    font-size: 28px;
    font-weight: bold; 
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: rgba(255,255,255,0.2);
    color: white;
}

/* Formulario */
.form-section {
    padding: 25px 30px;
    border-bottom: 1px solid #e9ecef;
}

.form-section:last-child {
    border-bottom: none;
}

.form-section h3 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    display: flex;
    align-items: center;
}

.form-group { 
    margin-bottom: 20px; 
}

.form-group label { 
    display: block; 
    margin-bottom: 8px; 
    font-weight: 600; 
    color: #2c3e50;
    display: flex;
    align-items: center;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%; 
    padding: 12px 16px; 
    border: 2px solid #e1e8ed;
    border-radius: 8px; 
    box-sizing: border-box;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.checklist {
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
    max-height: 300px;
    overflow-y: auto;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.checklist label { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    padding: 10px;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.checklist label:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.checklist input[type="checkbox"] {
    width: auto;
    margin: 0;
    transform: scale(1.2);
}

.checklist-placeholder {
    grid-column: 1 / -1;
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 30px;
    background: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

#observations.missing {
    border: 2px solid #e74c3c;
    background-color: #fbeae5;
}

#observations { 
    font-weight: 500; 
    color: #c0392b; 
    font-family: 'Courier New', monospace;
    resize: vertical;
}

.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    padding: 25px 30px;
    background: #f8f9fa;
    border-radius: 0 0 15px 15px;
}

.right-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Notifications */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.notification {
    padding: 15px 20px;
    margin-bottom: 10px;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    min-width: 300px;
    animation: slide-in 0.3s ease-out;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 10px;
}

.notification-success {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
}

.notification-error {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

@keyframes slide-in {
    from { 
        transform: translateX(100%); 
        opacity: 0; 
    }
    to { 
        transform: translateX(0); 
        opacity: 1; 
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
        margin: 10px;
    }
    
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-section {
        min-width: auto;
    }
    
    .filter-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .stats-container {
        grid-template-columns: 1fr;
    }
    
    .checklist {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .right-actions {
        justify-content: center;
    }
    
    .modal-content {
        margin: 5% 10px;
        max-width: none;
    }
    
    .notification {
        min-width: auto;
        margin: 0 10px 10px 10px;
    }
}