/* Unified Attendance System Styles */
/* Shared styles across all interfaces: login, admin, student, kiosk */

/* ===== GLOBAL TOUCH & RESPONSIVE SETUP ===== */
html {
    /* Touch improvements */
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-overflow-scrolling: touch;
    -webkit-text-size-adjust: 100%;
}

/* Allow text selection in input fields */
input, textarea {
    -webkit-user-select: auto;
    -moz-user-select: auto;
    -ms-user-select: auto;
    user-select: auto;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

/* ===== BASE STYLES ===== */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Tahoma, Geneva, Verdana, sans-serif;
    background: #f8f9fa;
    color: #333;
    line-height: 1.6;
    touch-action: manipulation;
    -webkit-text-size-adjust: 100%;
    -webkit-overflow-scrolling: touch;
}

/* Zero-flash authentication support */
body {
    visibility: hidden;
}

body.token-validated {
    visibility: visible;
}

/* ===== LAYOUT COMPONENTS ===== */
.container {
    min-height: 100vh;
    width: 100%;
    max-width: none;
}

.dashboard {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
}

/* ===== HEADER STYLES ===== */
/* Admin and Student headers use gradient background */
body:not(.login-page):not(.kiosk-page) .header {
    background: linear-gradient(135deg, #021d4c 0%, #020202 100%);
    color: white;
    padding: 20px 30px;
    border-bottom: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: none;
}

body:not(.login-page):not(.kiosk-page) .header-left h1 {
    color: white;
    font-size: 1.8rem;
    margin-bottom: 5px;
}

body:not(.login-page):not(.kiosk-page) .header-left p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.header-right {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Student-specific header styles */
.student-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-photo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #667eea;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

body:not(.login-page):not(.kiosk-page) .student-details h1 {
    color: white;
    font-size: 1.5rem;
    margin-bottom: 3px;
}

body:not(.login-page):not(.kiosk-page) .student-details p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

/* ===== NAVIGATION STYLES ===== */
body:not(.login-page):not(.kiosk-page) .nav-menu {
    background: white;
    padding: 0 30px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    gap: 10px;
    width: 100%;
    max-width: none;
}

.nav-btn {
    background: none;
    border: none;
    padding: 15px 20px;
    font-size: 1rem;
    font-weight: 500;
    color: #6c757d;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    color: #495057;
    background: #f8f9fa;
}

.nav-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    padding: 30px;
    background: #f8f9fa;
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

/* Ensure reports section has consistent spacing */
#reports .section-header {
    margin-bottom: 30px;
    margin-top: 0;
}

.section-header h2 {
    color: #2c3e50;
    font-size: 1.8rem;
}

.section-note {
    color: #6c757d;
    font-size: 0.9rem;
    margin-top: 5px;
}

.header-actions {
    display: flex;
    gap: 10px;
}

/* ===== CARDS & STATS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-icon {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    background: #667eea;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-info h3 {
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 5px;
}

.stat-info p {
    color: #6c757d;
    font-size: 0.9rem;
}

.card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.card-header {
    padding: 20px 25px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2,
.card-header h3 {
    color: #2c3e50;
    font-size: 1.3rem;
}

.card-body {
    padding: 25px;
}

/* ===== FORMS ===== */
.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-row .form-group {
    flex: 1;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #495057;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    /* Improve mobile interaction */
    font-size: max(16px, 1rem);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.password-input {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: #6c757d;
    padding: 8px;
    min-width: 40px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.password-toggle:hover {
    color: #333;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 25px;
}

/* ===== BUTTONS ===== */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px; /* Touch-friendly minimum */
    touch-action: manipulation;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-outline:hover {
    background: #667eea;
    color: white;
    transform: translateY(-1px);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.85rem;
    min-height: 36px;
}

.btn:active {
    transform: translateY(0);
}

/* ===== TABLES ===== */
.table-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 15px;
}

.search-input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 0.9rem;
    width: 200px;
}

.table-container {
    overflow-x: auto;
    border-radius: 8px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.data-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
    position: sticky;
    top: 0;
}

.data-table tr:hover {
    background: #f8f9fa;
}

.data-table .actions {
    display: flex;
    gap: 5px;
}

/* ===== STATUS BADGES ===== */
.status-badge {
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    white-space: normal;
    min-width: 80px;
    word-break: break-word;
    display: inline-block;
    text-align: center;
}

.status-badge.on-time,
.status-badge.enrolled {
    background: #d4edda;
    color: #155724;
}

.status-badge.late,
.status-badge.not-enrolled {
    background: #f8d7da;
    color: #721c24;
}

.status-badge.completed {
    background: #b3d9ff;
    color: #004085;
}

/* Status indicators for attendance table */
.status-present {
    color: #28a745;
    font-weight: 600;
}

.status-late {
    color: #dc3545;
    font-weight: 600;
}

.status-absent {
    color: #6c757d;
    font-weight: 600;
}

.status-warning {
    color: #ffc107;
    font-weight: 600;
}

/* ===== MODALS ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 15px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-content.large {
    max-width: 800px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
}

.modal-header h3 {
    color: #2c3e50;
    font-size: 1.5rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6c757d;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: #f8f9fa;
    color: #495057;
}

/* ===== LOADING STATES ===== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    color: white;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-overlay p {
    font-size: 1.1rem;
}

/* ===== ADMIN-SPECIFIC COMPONENTS ===== */
.overview-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.current-event {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.current-event h4 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.current-event p {
    color: #6c757d;
    margin-bottom: 5px;
}

.recent-attendance {
    max-height: 300px;
    overflow-y: auto;
}

.recent-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e9ecef;
}

.recent-item:last-child {
    border-bottom: none;
}

.recent-info {
    flex: 1;
}

.recent-info strong {
    display: block;
    color: #2c3e50;
    margin-bottom: 3px;
    font-size: 0.9em;
}

.recent-info small {
    color: #6c757d;
    font-size: 0.8em;
}

.recent-time {
    text-align: right;
    flex-shrink: 0;
}

.recent-time .status {
    display: block;
    font-size: 0.85em;
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 2px;
}

.recent-time small {
    color: #6c757d;
    font-size: 0.75em;
}

.attendance-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #e9ecef;
}

.attendance-item:last-child {
    border-bottom: none;
}

.attendance-info h5 {
    color: #2c3e50;
    margin-bottom: 3px;
}

.attendance-info p {
    color: #6c757d;
    font-size: 0.9rem;
}

.attendance-time {
    text-align: right;
    color: #6c757d;
    font-size: 0.9rem;
}

.reports-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    margin-top: 0;
    padding-top: 0;
}

.report-results {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid #e9ecef;
}

/* Report specific styles */
.report-container {
    padding: 20px 0;
}

.report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.report-header h4 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.5rem;
    font-weight: 600;
}

.report-actions {
    display: flex;
    gap: 10px;
}

.report-filters {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    border-left: 4px solid #007bff;
}

.report-filters h5 {
    margin: 0 0 15px 0;
    color: #495057;
    font-size: 1.1rem;
    font-weight: 600;
}

.filter-items {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.filter-item {
    flex: 1;
    min-width: 200px;
    padding: 8px 0;
    border-bottom: 1px solid #dee2e6;
}

.filter-item strong {
    color: #495057;
}

.report-summary {
    margin-bottom: 30px;
}

.report-summary h5 {
    margin: 0 0 20px 0;
    color: #495057;
    font-size: 1.1rem;
    font-weight: 600;
    padding-bottom: 10px;
    border-bottom: 1px solid #dee2e6;
}

.report-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.report-stats-grid .stat-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.report-stats-grid .stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.report-department-stats,
.report-monthly-stats {
    margin-bottom: 30px;
}

.report-department-stats h5,
.report-monthly-stats h5 {
    margin: 0 0 20px 0;
    color: #495057;
    font-size: 1.1rem;
    font-weight: 600;
    padding-bottom: 10px;
    border-bottom: 1px solid #dee2e6;
}

.department-stats-grid,
.monthly-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.dept-stat-card,
.month-stat-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 15px;
    transition: background-color 0.2s ease;
}

.dept-stat-card:hover,
.month-stat-card:hover {
    background: #e9ecef;
}

.dept-name,
.month-name {
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.dept-details,
.month-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: #6c757d;
}

.dept-records,
.dept-hours,
.month-records,
.month-hours {
    background: #007bff;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.dept-hours,
.month-hours {
    background: #28a745;
}

.report-details {
    margin-bottom: 30px;
}

.report-details h5 {
    margin: 0 0 20px 0;
    color: #495057;
    font-size: 1.1rem;
    font-weight: 600;
    padding-bottom: 10px;
    border-bottom: 1px solid #dee2e6;
}

.no-data {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px dashed #dee2e6;
}

.no-data p {
    margin: 0;
    font-size: 1.1rem;
}

@media (max-width: 768px) {
    .report-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .report-actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    .filter-items {
        flex-direction: column;
        gap: 10px;
    }
    
    .filter-item {
        min-width: auto;
    }
    
    .report-stats-grid,
    .department-stats-grid,
    .monthly-stats-grid {
        grid-template-columns: 1fr;
    }
}

.student-photo-sm {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e9ecef;
}

.student-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.info-item label {
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
}

.info-item span {
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 5px;
    border: 1px solid #e9ecef;
    font-size: 0.95rem;
}

.info-item.full-width {
    grid-column: 1 / -1;
}

#viewStudentPhoto img {
    max-width: 150px;
    max-height: 150px;
    border-radius: 8px;
    border: 2px solid #e9ecef;
    object-fit: cover;
}

/* ===== STUDENT-SPECIFIC COMPONENTS ===== */
.profile-grid {
    display: grid;
    grid-template-columns: 300px 1fr 1fr;
    gap: 30px;
}

.profile-photo-container {
    margin-bottom: 20px;
}

.profile-photo {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid #667eea;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.profile-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #e9ecef;
}

.profile-field:last-child {
    border-bottom: none;
}

.profile-field label {
    font-weight: 500;
    color: #495057;
}

.profile-field span {
    color: #2c3e50;
    font-weight: 500;
}

.summary-stats {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e9ecef;
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-label {
    color: #6c757d;
}

.summary-value {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1.1rem;
}

/* Filters */
.filters-card {
    background: white;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.filters {
    display: flex;
    gap: 20px;
    align-items: end;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-group label {
    font-weight: 500;
    color: #495057;
    font-size: 0.9rem;
}

.filter-group input,
.filter-group select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 0.9rem;
    min-width: 150px;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

/* Photo Upload Modal */
.photo-upload-area {
    text-align: center;
}

.upload-preview {
    margin-bottom: 25px;
}

.upload-placeholder {
    padding: 40px;
    border: 2px dashed #ddd;
    border-radius: 10px;
    color: #6c757d;
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.upload-note {
    font-size: 0.8rem;
    color: #999;
    margin-top: 5px;
}

#uploadPreview {
    max-width: 200px;
    max-height: 200px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.upload-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* ===== LOGIN-SPECIFIC STYLES ===== */
body.login-page {
    background: linear-gradient(135deg, #021d4c 0%, #020202 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    visibility: visible; /* Login doesn't need token validation */
}

.logo-header {
    width: 100%;
    padding: 30px 0;
    text-align: center;
}

.system-logo-top {
    display: inline-flex;
    align-items: center;
    gap: 15px;
}

.system-logo-top .logo-image {
    height: 60px;
    width: auto;
}

.system-logo-top h1 {
    color: white;
    font-size: 2.5rem;
    font-weight: 300;
    margin: 0;
}

.container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Override container for admin and student pages to use full width */
body:not(.login-page):not(.kiosk-page) .container {
    width: 100%;
    max-width: none;
    display: block;
    align-items: initial;
    justify-content: initial;
}

.login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.login-form {
    background: rgba(255, 255, 255, 0.98);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 400px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.welcome-message {
    text-align: center;
    margin-bottom: 30px;
}

.welcome-message p {
    color: #333;
    font-size: 1.1rem;
    margin: 0;
}

.system-logo {
    text-align: center;
    margin-bottom: 30px;
}

.system-logo h1 {
    color: #333;
    font-size: 28px;
    margin-bottom: 8px;
    font-weight: 600;
}

.system-logo p {
    color: #666;
    font-size: 16px;
    margin-bottom: 0;
}

.login-help {
    background: rgba(102, 126, 234, 0.1);
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
}

.login-help p {
    color: #667eea;
    font-size: 0.9rem;
    margin: 0;
}

.system-info {
    text-align: center;
    margin-top: 20px;
}

.system-info p {
    color: #6c757d;
    font-size: 0.9rem;
}

/* ===== UTILITY CLASSES ===== */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: #6c757d;
}

.mb-0 { margin-bottom: 0; }
.mt-3 { margin-top: 1rem; }

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .main-content {
        padding: 20px 15px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .overview-content {
        grid-template-columns: 1fr;
    }
    
    .profile-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .table-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .search-input {
        width: 100%;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .nav-menu {
        overflow-x: auto;
        padding: 0 15px;
    }
    
    .header {
        padding: 15px 20px;
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .student-info {
        align-self: stretch;
    }
    
    .header-right {
        align-self: stretch;
        justify-content: space-between;
    }
    
    .filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group input,
    .filter-group select {
        min-width: auto;
    }
    
    .student-info-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        padding: 20px;
        margin: 20px;
    }
    
    .login-form {
        padding: 30px 20px;
        margin: 20px;
    }
}

/* ===== KIOSK-SPECIFIC STYLES ===== */
/* Kiosk uses a full-screen gradient background */
body.kiosk-page {
    background: linear-gradient(135deg, #021d4c 0%, #020202 100%);
    min-height: 100vh;
    cursor: default;
    overflow-x: hidden;
    overflow-y: auto;
    visibility: visible; /* Kiosk doesn't need token validation */
}

.kiosk-page .container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    max-width: none; /* Remove any width constraints */
    width: 100%;
}

/* Kiosk Header */
.kiosk-page .header {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: none;
    border-radius: 0 0 20px 20px; /* Rounded bottom corners */
    width: 100%; /* Full width header */
    padding: 20px; /* Consistent header padding */
}

.kiosk-page .system-logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.kiosk-page .logo-image {
    height: 50px;
    width: auto;
}

.kiosk-page .header h1 {
    color: white;
    font-size: 2.5rem;
    font-weight: 300;
    margin: 0;
}

.header-left {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

/* Time Chip Container */
.time-chip-container {
    display: flex;
    justify-content: center;
    padding: 20px; /* Consistent container padding */
    width: 100%;
}

.time-chip {
    color: white;
    font-size: 1.3rem;
    font-weight: 500;
    text-align: center;
    background: transparent; /* Remove background */
    padding: 20px; /* Standardized inner padding */
    border-radius: 25px;
    backdrop-filter: none; /* Remove backdrop filter */
    border: none; /* Remove border */
    box-shadow: none; /* Remove shadow */
    max-width: 600px; /* Consistent max width */
    width: 100%;
    box-sizing: border-box;
}

.clock {
    color: white;
    font-size: 1.2rem;
    font-weight: 500;
    text-align: right;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 15px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.event-display {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    font-weight: 400;
}

.event-display-center {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    font-weight: 400;
    text-align: center;
    margin-bottom: 20px; /* Consistent spacing */
    max-width: 600px; /* Match time chip width */
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px; /* Match container padding */
}

.event-display-center .event-info {
    background: rgba(255, 255, 255, 0.25);
    padding: 20px; /* Match time chip padding */
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-top: 0; /* Remove top margin for consistent spacing */
}

.event-display-center .event-info strong {
    color: white;
    font-weight: 600;
}

.event-display-center .no-event {
    background: rgba(255, 0, 0, 0.3);
    color: #ffcccc;
    padding: 20px; /* Match time chip padding */
    border-radius: 20px;
    border: 1px solid rgba(255, 0, 0, 0.3);
    margin-top: 0; /* Remove top margin for consistent spacing */
    font-weight: 500;
}

.event-info {
    background: rgba(255, 255, 255, 0.25);
    padding: 8px 15px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-top: 5px;
}

.event-info strong {
    color: white;
    font-weight: 600;
}

.no-event {
    background: rgba(255, 0, 0, 0.3);
    color: #ffcccc;
    padding: 8px 15px;
    border-radius: 15px;
    border: 1px solid rgba(255, 0, 0, 0.3);
    margin-top: 5px;
    font-weight: 500;
}

.admin-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 15px 30px;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
    min-height: 60px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.3);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.admin-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.admin-btn:active {
    transform: translateY(0);
    background: rgba(255, 255, 255, 0.4);
}

/* Kiosk Main Content */
.kiosk-page .main-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px; /* Match consistent container padding */
    background: transparent;
}

/* Scan Section */
.scan-section {
    text-align: center;
    color: white;
    width: 100%;
    max-width: 600px; /* Match consistent max width */
}

.scan-area {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 30px;
    padding: 40px 20px; /* Adjust padding for consistency */
    margin: 20px auto 0; /* Consistent spacing and centering */
    max-width: 600px; /* Match consistent max width */
    width: 100%;
    box-sizing: border-box;
}

.fingerprint-icon {
    margin-bottom: 40px;
    color: rgba(255, 255, 255, 0.8);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.8; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

.scan-area h2 {
    font-size: 2.5rem;
    margin-bottom: 40px;
    font-weight: 300;
}

.scan-btn {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 25px 60px;
    border-radius: 50px;
    font-size: 1.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 200px;
    min-height: 80px;
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.3);
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(76, 175, 80, 0.4);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.scan-btn:hover {
    background: #45a049;
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(76, 175, 80, 0.4);
}

.scan-btn:active {
    transform: translateY(0);
}

/* Student Card */
.student-card {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 30px;
    padding: 40px;
    display: flex;
    align-items: center;
    gap: 40px;
    max-width: 800px;
    margin: 0 auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.student-photo {
    flex-shrink: 0;
}

.student-photo img {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid #667eea;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.student-info {
    flex: 1;
    color: #333;
}

.student-info h2 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: #2c3e50;
}

.student-info p {
    font-size: 1.3rem;
    color: #7f8c8d;
    margin-bottom: 20px;
}

.attendance-info p {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: #495057;
}

/* Kiosk Modal Overrides */
.kiosk-page .modal {
    background: rgba(0, 0, 0, 0.85);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.kiosk-page .modal-content {
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    margin: auto;
    -webkit-overflow-scrolling: touch;
}

.kiosk-page .modal-content.large {
    max-width: 700px;
}

.kiosk-page .modal-header h3 {
    font-size: 1.8rem;
    color: #2c3e50;
}

.kiosk-page .form-group input {
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 1.1rem;
    font-size: max(16px, 1.1rem);
    position: relative;
    z-index: 1;
}

.kiosk-page .form-group input:focus {
    position: relative;
    z-index: 10;
}

.kiosk-page .btn {
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    min-width: 120px;
    min-height: 50px;
}

/* Admin Actions */
.admin-actions {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.admin-actions .btn {
    width: 100%;
    justify-content: center;
}

/* Enrollment Progress */
.enrollment-progress {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #eee;
}

.enrollment-progress h4 {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
    font-size: 1.5rem;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.step-number {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #ddd;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.2rem;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.progress-step.active .step-number {
    background: #667eea;
    color: white;
}

.progress-step.completed .step-number {
    background: #4CAF50;
    color: white;
}

.step-text {
    font-size: 0.9rem;
    text-align: center;
    color: #666;
}

#enrollmentMessage {
    text-align: center;
    font-size: 1.2rem;
    color: #667eea;
    font-weight: 500;
}

/* Registration Steps */
.registration-step {
    display: block;
}

.registration-step.hidden {
    display: none;
}

.field-note {
    font-size: 0.8em;
    color: #666;
    font-weight: normal;
}

.validation-message {
    font-size: 0.85em;
    color: #d32f2f;
    margin-top: 5px;
    min-height: 20px;
}

.step-description {
    text-align: center;
    margin: 20px 0;
    color: #666;
    font-size: 1.1em;
}

.form-group input.invalid {
    border-color: #d32f2f;
    background-color: #fff5f5;
}

.form-group input.valid {
    border-color: #2e7d32;
    background-color: #f1f8e9;
}

.btn.btn-success {
    background: linear-gradient(135deg, #2e7d32, #388e3c);
    border: none;
}

.btn.btn-success:hover {
    background: linear-gradient(135deg, #1b5e20, #2e7d32);
}

.btn.btn-warning {
    background: linear-gradient(135deg, #f57c00, #ff9800);
    border: none;
    color: white;
}

.btn.btn-warning:hover {
    background: linear-gradient(135deg, #e65100, #f57c00);
}

.enrollment-message {
    text-align: center;
    margin: 1rem 0;
    font-weight: 500;
    color: #2563eb;
    font-size: 1.1rem;
}

.confirmation-details {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1rem 0;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e2e8f0;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row label {
    font-weight: 500;
    color: #374151;
}

.detail-row span {
    color: #1f2937;
}

.success-text {
    color: #22c55e !important;
    font-weight: 500;
}

/* Kiosk Responsive Design */
@media (max-width: 768px) {
    .kiosk-page .container {
        min-height: auto;
        padding-bottom: 20px;
    }
    
    .kiosk-page .header {
        padding: 15px; /* Mobile header padding */
        flex-direction: column;
        gap: 15px;
    }
    
    .kiosk-page .system-logo {
        flex-direction: column;
        gap: 10px;
    }
    
    .kiosk-page .logo-image {
        height: 40px;
    }
    
    .header-left, .header-right {
        width: 100%;
        text-align: center;
    }
    
    .kiosk-page .header h1 {
        font-size: 2rem;
    }
    
    .time-chip-container {
        padding: 15px; /* Mobile container padding */
    }
    
    .time-chip {
        font-size: 1.1rem;
        padding: 15px; /* Mobile chip padding */
        border-radius: 20px;
        background: transparent; /* Maintain transparent background on mobile */
        backdrop-filter: none;
        border: none;
        box-shadow: none;
    }
    
    .kiosk-page .main-content {
        padding: 15px; /* Mobile main content padding */
    }
    
    .event-display-center {
        padding: 0 15px; /* Mobile event display padding */
        margin-bottom: 15px; /* Consistent mobile spacing */
    }
    
    .event-display-center .event-info,
    .event-display-center .no-event {
        padding: 15px; /* Mobile event card padding */
    }
    
    .scan-area {
        padding: 30px 15px; /* Mobile scan area padding */
        margin: 15px auto 0; /* Mobile scan area spacing */
    }
    
    .system-logo-top {
        flex-direction: column !important;
        gap: 10px !important;
    }
    
    .system-logo-top .logo-image {
        height: 50px !important;
    }
    
    .system-logo-top h1 {
        font-size: 2rem !important;
    }
    
    .logo-header {
        padding: 20px 0 !important;
    }
    
    .admin-btn {
        padding: 12px 25px;
        font-size: 1rem;
        min-width: 100px;
        min-height: 50px;
        min-height: 44px;
    }
    
    .kiosk-page .main-content {
        padding: 20px;
        flex: none;
    }
    
    .scan-area {
        padding: 40px 20px;
    }
    
    .scan-area h2 {
        font-size: 2rem;
    }
    
    .scan-btn {
        padding: 20px 40px;
        font-size: 1.5rem;
        min-height: 70px;
        min-height: 60px;
    }
    
    .student-card {
        flex-direction: column;
        text-align: center;
        padding: 30px;
        margin: 20px 0;
    }
    
    .student-photo img {
        width: 150px;
        height: 150px;
    }
    
    .student-info h2 {
        font-size: 2rem;
    }
    
    .kiosk-page .modal-content {
        padding: 30px 20px;
        width: 95%;
        max-height: 85vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-height: 600px) {
    .kiosk-page .container {
        min-height: auto;
    }
    
    .kiosk-page .main-content {
        flex: none;
        padding: 10px;
    }
    
    .scan-area {
        padding: 20px;
    }
    
    .scan-area h2 {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }
    
    .fingerprint-icon {
        margin-bottom: 20px;
    }
    
    .scan-btn {
        padding: 15px 30px;
        font-size: 1.3rem;
        min-height: 50px;
    }
}

/* Filters Row Styling */
.filters-row {
    border-bottom: 1px solid #e9ecef;
    background-color: #f8f9fa;
    padding: 15px 20px;
}

.filters-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 150px;
}

.filter-group label {
    font-size: 0.85em;
    font-weight: 500;
    color: #495057;
    margin-bottom: 3px;
}

.date-range-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.date-separator {
    font-size: 0.9em;
    color: #6c757d;
    white-space: nowrap;
}

.filter-actions {
    margin-left: auto;
    display: flex;
    align-items: end;
    padding-bottom: 2px;
}

@media (max-width: 768px) {
    .filters-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        min-width: unset;
    }
    
    .date-range-inputs {
        flex-direction: column;
        gap: 5px;
    }
    
    .date-separator {
        display: none;
    }
    
    .filter-actions {
        margin-left: unset;
        margin-top: 10px;
    }
}

/* ===== EVENT SELECTION STYLES ===== */
.event-selection {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 20px;
    padding: 20px; /* Match consistent padding */
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    max-width: 600px; /* Consistent max width */
    margin: 0 auto;
}

.selection-header {
    text-align: center;
    margin-bottom: 20px;
}

.selection-header h3 {
    color: white;
    margin: 0 0 8px 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.selection-header p {
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    font-size: 1rem;
}

.event-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 15px;
}

.event-option {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.event-option:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

.event-option.selected {
    background: rgba(72, 187, 120, 0.3);
    border-color: #48bb78;
    box-shadow: 0 4px 20px rgba(72, 187, 120, 0.3);
}

.event-option.ongoing {
    border-left: 4px solid #48bb78;
}

.event-option.upcoming {
    border-left: 4px solid #4299e1;
}

.event-title {
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.event-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.event-dept {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    font-weight: 500;
}

.event-time {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.event-status {
    font-size: 0.85rem;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    align-self: flex-start;
}

.event-option.ongoing .event-status {
    background: rgba(72, 187, 120, 0.3);
    color: #68d391;
}

.event-option.upcoming .event-status {
    background: rgba(66, 153, 225, 0.3);
    color: #90cdf4;
}

.selection-note {
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    margin: 0;
    padding: 12px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
}

/* Mobile responsiveness for event selection */
@media (max-width: 768px) {
    .event-selection {
        margin: 0 15px; /* Match mobile container padding */
        padding: 15px; /* Consistent mobile padding */
    }
    
    .selection-header h3 {
        font-size: 1.3rem;
    }
    
    .event-option {
        padding: 15px; /* Consistent mobile option padding */
    }
    
    .event-title {
        font-size: 1.1rem;
    }
    
    .event-details {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .event-time {
        font-size: 0.85rem;
    }
}

/* ===== PAGINATION STYLES ===== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    padding: 15px 0;
}

.pagination.hidden {
    display: none;
}

.pagination-info {
    font-size: 0.9rem;
    color: #6c757d;
    margin-right: 10px;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 5px;
}

.pagination-btn {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #495057;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
}

.pagination-btn:hover:not(:disabled) {
    background: #e9ecef;
    border-color: #adb5bd;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-btn.active {
    background: #667eea;
    border-color: #667eea;
    color: white;
}

.pagination-select {
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: white;
    color: #495057;
    font-size: 0.9rem;
    cursor: pointer;
}

.pagination-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.pagination-arrow {
    width: 16px;
    height: 16px;
    opacity: 0.7;
}

@media (max-width: 768px) {
    .pagination {
        flex-direction: column;
        gap: 10px;
    }
    
    .pagination-info {
        margin-right: 0;
        text-align: center;
    }
    
    .pagination-controls {
        justify-content: center;
    }
}