* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}



/* Login Container */
.login-container {
    width: 100%;
    max-width: 500px;
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

/* Estilos para el buscador de asistencias */
.attendance-search {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.attendance-search h3 {
    color: #4e54c8;
    margin-bottom: 15px;
    text-align: center;
}

.search-form {
    margin-top: 15px;
}

.form-row {
    display: flex;
    gap: 15px;
    align-items: end;
    flex-wrap: wrap;
    justify-content: center;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group label {
    font-weight: bold;
    color: #495057;
    font-size: 14px;
}

.form-group select {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    min-width: 150px;
}

.btn-search {
    background: linear-gradient(to right, #28a745, #20c997);
    margin-top: 5px;
}

.btn-search:hover {
    background: linear-gradient(to right, #218838, #1e9e8a);
}





/* Resultados de asistencias */
.attendance-results {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.attendance-results h4 {
    color: #4e54c8;
    margin-bottom: 15px;
    text-align: center;
    border-bottom: 2px solid #4e54c8;
    padding-bottom: 10px;
}

.result-summary {
    text-align: center;
    margin-bottom: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.total-attendance {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.total-number {
    font-size: 3em;
    font-weight: bold;
    color: #28a745;
}

.total-label {
    font-size: 1.1em;
    color: #495057;
    font-weight: bold;
}

.attendance-details h5 {
    color: #495057;
    margin-bottom: 15px;
    text-align: center;
}

.table-container {
    overflow-x: auto;
    margin-top: 15px;
}

.attendance-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.attendance-table th {
    background: #4e54c8;
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: bold;
}

.attendance-table td {
    padding: 12px;
    border-bottom: 1px solid #dee2e6;
}

.attendance-table tr:hover {
    background: #f8f9fa;
}

.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: bold;
    text-transform: uppercase;
}

.badge-entrada {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.badge-salida {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.no-data {
    text-align: center;
    padding: 40px;
    color: #6c757d;
    background: #f8f9fa;
    border-radius: 10px;
    margin: 20px 0;
}

.no-data p {
    font-size: 1.1em;
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .form-group select {
        min-width: auto;
        width: 100%;
    }
    
    .attendance-table {
        font-size: 0.9em;
    }
    
    .attendance-table th,
    .attendance-table td {
        padding: 8px 4px;
    }
    
    .total-number {
        font-size: 2.5em;
    }
}

@media (max-width: 480px) {
    .attendance-search,
    .attendance-results {
        padding: 15px;
    }
    
    .total-number {
        font-size: 2em;
    }
}


/* Index Container */
.index-container {
    width: 100%;
    max-width: 800px;
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.header {
    background: linear-gradient(to right, #4e54c8, #8f94fb);
    color: white;
    padding: 30px;
    text-align: center;
    position: relative;
}

.header h1 {
    font-size: 28px;
    margin-bottom: 10px;
}

.header p {
    font-size: 16px;
    opacity: 0.9;
}

.logout-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.scanner-section {
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.content {
    padding: 30px;
}

#reader {
    width: 100%;
    max-width: 300px;
    height: 300px;
    border: 2px dashed #4e54c8;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    background-color: #f8f9fa;
    position: relative;
}

#reader video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.btn {
    background: linear-gradient(to right, #4e54c8, #8f94fb);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 50px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin: 5px;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 20px rgba(0, 0, 0, 0.15);
}

.btn-outline {
    background: transparent;
    border: 2px solid #4e54c8;
    color: #4e54c8;
}

.loading {
    text-align: center;
    padding: 20px;
    display: none;
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: #4e54c8;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.error-message {
    background-color: #ffe6e6;
    color: #d32f2f;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    margin-top: 20px;
    display: none;
    width: 100%;
}

.camera-permission {
    background-color: #fff3cd;
    color: #856404;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    margin-top: 20px;
    display: none;
    width: 100%;
}

.instructions {
    background-color: #f0f4ff;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
    font-size: 14px;
    color: #555;
    width: 100%;
}

.instructions h4 {
    color: #4e54c8;
    margin-bottom: 10px;
    text-align: center;
}

.instructions ol {
    padding-left: 20px;
}

.instructions li {
    margin-bottom: 8px;
}

.scanner-placeholder {
    text-align: center;
    color: #666;
    padding: 20px;
}

.scanner-placeholder i {
    font-size: 48px;
    margin-bottom: 15px;
    color: #4e54c8;
}

.btn-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
}

.permission-steps {
    background-color: #e7f3ff;
    border-left: 4px solid #4e54c8;
    padding: 15px;
    margin: 15px 0;
    border-radius: 0 8px 8px 0;
}

.permission-steps h5 {
    color: #4e54c8;
    margin-bottom: 10px;
}

#manualInput {
    display: none;
    width: 100%;
    margin-top: 20px;
}

#manualInput input {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

/* Student Info Styles */
.welcome-message {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border-radius: 10px;
}

.welcome-message h2 {
    font-size: 22px;
    margin-bottom: 10px;
}

.student-info {
    background-color: #f8f9fa;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 20px;
}

.student-info h3 {
    color: #4e54c8;
    margin-bottom: 20px;
    text-align: center;
    border-bottom: 2px solid #4e54c8;
    padding-bottom: 10px;
}

.info-row {
    display: flex;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
}

.info-label {
    font-weight: bold;
    width: 150px;
    color: #495057;
    font-size: 15px;
}

.info-value {
    flex: 1;
    color: #212529;
    font-size: 15px;
}

.actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 25px;
}

.error-container {
    text-align: center;
    padding: 40px;
}

.error-container h2 {
    color: #dc3545;
    margin-bottom: 20px;
}

.qr-badge {
    text-align: center;
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 2px dashed #4e54c8;
}

.qr-badge p {
    color: #6c757d;
    font-size: 14px;
    margin-bottom: 10px;
}

@media (max-width: 480px) {
    .info-row {
        flex-direction: column;
    }
    
    .info-label {
        width: 100%;
        margin-bottom: 5px;
    }
    
    .actions {
        flex-direction: column;
    }
    
    .btn-group {
        flex-direction: column;
    }
}

/* ===== ESTILOS MEJORADOS PARA EL CALENDARIO ===== */
.calendar-container {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin: 25px 0;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    border: 1px solid #e9ecef;
}

.calendar-container h5 {
    color: #4e54c8;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.3em;
    font-weight: bold;
    border-bottom: 3px solid #4e54c8;
    padding-bottom: 10px;
}

.calendar-legend {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-bottom: 25px;
    flex-wrap: wrap;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95em;
    font-weight: 500;
    color: #495057;
}

.legend-color {
    width: 25px;
    height: 25px;
    border-radius: 6px;
    border: 3px solid;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.legend-color.present {
    background: #d4edda;
    border-color: #28a745;
}

.legend-color.absent {
    background: #f8d7da;
    border-color: #dc3545;
}

.legend-color.weekend {
    background: #f8f9fa;
    border-color: #6c757d;
}

.calendar {
    max-width: 700px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border: 2px solid #e9ecef;
}

.calendar-header {
    background: linear-gradient(135deg, #4e54c8, #8f94fb);
    color: white;
    padding: 20px;
    text-align: center;
    border-bottom: 3px solid #3f51b5;
}

.calendar-title {
    font-size: 1.4em;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    background: #dee2e6;
    padding: 2px;
}

.day-header {
    background: #495057;
    color: white;
    padding: 15px 5px;
    text-align: center;
    font-weight: bold;
    font-size: 0.95em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #343a40;
}

.day {
    background: white;
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 8px;
    min-height: 80px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.day-number {
    font-weight: bold;
    font-size: 1.1em;
    margin-bottom: 5px;
    color: #212529;
}

.attendance-marker {
    color: #28a745;
    font-weight: bold;
    font-size: 1.4em;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

/* ===== ESTADOS DE LOS DÍAS ===== */
.day.present {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    border: 3px solid #28a745;
    box-shadow: 0 3px 8px rgba(40, 167, 69, 0.3);
}

.day.present .day-number {
    color: #155724;
    font-weight: 800;
}

.day.absent {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    border: 3px solid #dc3545;
    box-shadow: 0 3px 8px rgba(220, 53, 69, 0.3);
}

.day.absent .day-number {
    color: #721c24;
    font-weight: 800;
}

.day.weekend {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border: 3px solid #6c757d;
    box-shadow: 0 2px 6px rgba(108, 117, 125, 0.3);
}

.day.weekend .day-number {
    color: #6c757d;
    font-weight: 600;
}

.day.empty {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
}

.day.empty .day-number {
    color: transparent;
}

/* ===== EFECTOS HOVER ===== */
.day:not(.empty):hover {
    transform: scale(1.08);
    z-index: 2;
    box-shadow: 0 6px 15px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
}

.day.present:hover {
    border-color: #1e7e34;
    box-shadow: 0 6px 15px rgba(40, 167, 69, 0.5);
}

.day.absent:hover {
    border-color: #c82333;
    box-shadow: 0 6px 15px rgba(220, 53, 69, 0.5);
}

.day.weekend:hover {
    border-color: #495057;
    box-shadow: 0 6px 15px rgba(108, 117, 125, 0.5);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .calendar-container {
        padding: 15px;
        margin: 15px 0;
    }
    
    .calendar-days {
        gap: 1px;
    }
    
    .day {
        min-height: 60px;
        padding: 5px;
    }
    
    .day-number {
        font-size: 0.9em;
    }
    
    .attendance-marker {
        font-size: 1.1em;
    }
    
    .day-header {
        padding: 10px 3px;
        font-size: 0.8em;
    }
    
    .calendar-legend {
        gap: 15px;
        padding: 10px;
    }
    
    .legend-item {
        font-size: 0.85em;
    }
    
    .legend-color {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 480px) {
    .calendar-days {
        grid-template-columns: repeat(7, 1fr);
    }
    
    .day {
        min-height: 45px;
        padding: 2px;
    }
    
    .day-number {
        font-size: 0.75em;
        margin-bottom: 2px;
    }
    
    .attendance-marker {
        font-size: 0.9em;
    }
    
    .day-header {
        padding: 8px 2px;
        font-size: 0.7em;
    }
    
    .calendar-legend {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }
    
    .legend-item {
        gap: 8px;
    }
    
    .calendar-title {
        font-size: 1.1em;
    }
}

/* Asegurar que el calendario se vea bien en todos los navegadores */
.calendar * {
    box-sizing: border-box;
}

.calendar-days::after {
    content: "";
    display: table;
    clear: both;
}