:root {
    color-scheme: light dark;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: #f5f7fb;
    color: #1d1d1f;
}

body {
    margin: 0;
    background-color: #f5f7fb;
}

.container {
    width: min(1100px, 92vw);
    margin: 0 auto;
    padding: 1.5rem 0 3rem;
}

.site-header {
    background: linear-gradient(135deg, #002d72, #00509d);
    color: #fff;
    padding: 1rem 0;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-header h1 {
    font-size: 1.5rem;
    margin: 0;
}

.site-header nav {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.site-header nav a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s ease;
}

.site-header nav a:hover {
    opacity: 0.8;
}

.panel {
    background: #fff;
    border-radius: 16px;
    padding: 1.5rem;
    margin-top: 1.5rem;
    box-shadow: 0 8px 24px rgba(15, 35, 95, 0.08);
}

.panel h2 {
    margin-top: 0;
}

.muted {
    color: #5b5d63;
    font-size: 0.95rem;
}

.upload-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin-top: 1rem;
}

.upload-form input[type="file"] {
    flex: 1 1 250px;
}

.upload-form button {
    background: #00509d;
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 0.6rem 1.4rem;
    cursor: pointer;
    font-weight: 600;
}

.upload-form button:hover {
    background: #003f7f;
}

.upload-status {
    min-width: 200px;
    font-size: 0.9rem;
}

.table-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.table-controls label {
    font-weight: 600;
}

.table-controls input[type="text"],
.table-controls select,
.table-controls button {
    padding: 0.45rem 0.75rem;
    border-radius: 8px;
    border: 1px solid #d0d5dd;
    font-size: 0.95rem;
}

.table-controls input[type="text"] {
    min-width: 250px;
    font-family: inherit;
}

.table-controls input[type="text"]:focus {
    outline: none;
    border-color: #002d72;
    box-shadow: 0 0 0 3px rgba(0, 45, 114, 0.1);
}

.table-controls button {
    background: #002d72;
    color: #fff;
    border: none;
    cursor: pointer;
}

.table-controls button:hover {
    background: #001a44;
}

.table-controls button:disabled {
    background: #999;
    cursor: not-allowed;
    opacity: 0.6;
}

#clear-search {
    background: #dc3545;
    padding: 0.45rem 1rem;
}

#clear-search:hover {
    background: #c82333;
}

.table-container {
    overflow-x: auto;
}

#students-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

#students-table thead {
    background: #eaf1fb;
}

#students-table th,
#students-table td {
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid #e0e6f0;
    vertical-align: top;
}

#students-table tr:hover {
    background: #f2f6fc;
}

.photo-cell {
    width: 110px;
    text-align: center;
}

.photo-wrapper {
    position: relative;
    width: 72px;
    height: 72px;
    display: inline-block;
    overflow: hidden;
    border-radius: 12px;
}

.photo-placeholder {
    width: 72px;
    height: 72px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #dce3f5;
    color: #002d72;
    font-weight: 600;
    font-size: 1.1rem;
    box-shadow: 0 4px 15px rgba(0, 45, 114, 0.15);
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

.photo-placeholder.loading {
    background: linear-gradient(
        90deg,
        #dce3f5 0%,
        #c5d3f0 50%,
        #dce3f5 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

.photo-placeholder.error {
    background: #ffe9e9;
    color: #8b0000;
    font-size: 1.5rem;
    cursor: help;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.student-photo {
    width: 72px;
    height: 72px;
    border-radius: 12px;
    object-fit: cover;
    display: block;
    box-shadow: 0 4px 15px rgba(0, 45, 114, 0.15);
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.notes-field textarea {
    width: 100%;
    min-height: 60px;
    border-radius: 8px;
    border: 1px solid #d0d5dd;
    padding: 0.5rem;
    font-family: inherit;
    font-size: 0.95rem;
    color: #1d1d1f;
}

.edit-field input {
    width: 100%;
    border-radius: 8px;
    border: 1px solid #d0d5dd;
    padding: 0.5rem;
    font-family: inherit;
    font-size: 0.95rem;
    min-height: auto;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.edit-field input:focus,
.notes-field textarea:focus {
    outline: none;
    border-color: #00509d;
    box-shadow: 0 0 0 3px rgba(0, 80, 157, 0.1);
}

.notes-field button,
.edit-field button {
    margin-top: 0.35rem;
    padding: 0.45rem 0.75rem;
    border-radius: 6px;
    border: none;
    background: #00509d;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s ease;
}

.notes-field button:hover,
.edit-field button:hover {
    background: #003f7f;
}

.notes-field button:disabled,
.edit-field button:disabled {
    background: #999;
    cursor: not-allowed;
    opacity: 0.6;
}

.alert {
    background: #ffe9e9;
    color: #8b0000;
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.auth-body {
    background: linear-gradient(135deg, #002d72, #00509d);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
}

.auth-card {
    background: #fff;
    border-radius: 16px;
    padding: 2.5rem 2.75rem;
    box-shadow: 0 30px 50px rgba(0, 45, 114, 0.25);
    width: min(420px, 90vw);
    text-align: center;
}

.auth-card h1 {
    margin: 0 0 0.5rem 0;
}

.auth-subtitle {
    color: #5b5d63;
    margin-bottom: 1.5rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    text-align: left;
}

.auth-form input {
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    border: 1px solid #d0d5dd;
    font-size: 1rem;
}

.auth-form button {
    margin-top: 1rem;
    background: #002d72;
    color: #fff;
    border: none;
    padding: 0.7rem 1rem;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

.auth-form button:hover {
    background: #001a44;
}

/* Progress Bar Styles */
.progress-container {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #f8f9fc;
    border-radius: 12px;
    border: 1px solid #e0e6f0;
}

.progress-bar-wrapper {
    width: 100%;
    height: 28px;
    background: #e8ecf4;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 45, 114, 0.1);
    margin-bottom: 0.75rem;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #00509d 0%, #0066cc 100%);
    border-radius: 14px;
    transition: width 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 80, 157, 0.3);
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 100%
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.progress-text {
    text-align: center;
    color: #002d72;
    font-weight: 600;
    font-size: 0.95rem;
}

/* Pagination Styles */
.pagination-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e0e6f0;
}

.pagination-info {
    color: #5b5d63;
    font-size: 0.95rem;
    font-weight: 500;
}

.pagination-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.pagination-btn {
    min-width: 40px;
    height: 40px;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d0d5dd;
    background: #fff;
    color: #002d72;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
    background: #f2f6fc;
    border-color: #00509d;
    color: #00509d;
}

.pagination-btn.active {
    background: #002d72;
    color: #fff;
    border-color: #002d72;
    font-weight: 600;
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-ellipsis {
    padding: 0.5rem;
    color: #5b5d63;
    font-weight: 500;
}

.table-controls-spacer {
    flex: 1;
}

/* View Toggle Styles */
.view-toggle {
    display: flex;
    gap: 0.25rem;
    background: #f0f4f8;
    padding: 0.25rem;
    border-radius: 8px;
}

.view-toggle-btn {
    padding: 0.5rem 0.75rem;
    border: none;
    background: transparent;
    color: #5b5d63;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.view-toggle-btn:hover {
    background: #e0e6f0;
    color: #002d72;
}

.view-toggle-btn.active {
    background: #002d72;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 45, 114, 0.2);
}

/* Card View Styles */
.card-view-container {
    margin-top: 1rem;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    padding: 0.5rem;
}

.student-card {
    background: #fff;
    border: 1px solid #e0e6f0;
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.student-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 45, 114, 0.15);
    border-color: #00509d;
}

.student-card .card-photo-wrapper {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    overflow: hidden;
}

.student-card .card-photo-placeholder {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #dce3f5;
    color: #002d72;
    font-weight: 600;
    font-size: 2.5rem;
    box-shadow: 0 4px 15px rgba(0, 45, 114, 0.15);
}

.student-card .card-photo-placeholder.loading {
    background: linear-gradient(
        90deg,
        #dce3f5 0%,
        #c5d3f0 50%,
        #dce3f5 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

.student-card .card-student-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    box-shadow: 0 4px 15px rgba(0, 45, 114, 0.15);
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.student-card-name {
    font-weight: 600;
    font-size: 1.05rem;
    color: #1d1d1f;
    margin-bottom: 0.35rem;
    line-height: 1.3;
}

.student-card-grade {
    color: #5b5d63;
    font-size: 0.9rem;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}

.modal-content {
    position: relative;
    background: #fff;
    border-radius: 16px;
    width: min(600px, 95vw);
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    display: flex;
    flex-direction: column;
    padding: 2rem;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid #e0e6f0;
    background: #f8f9fc;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.4rem;
    color: #002d72;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    color: #5b5d63;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    line-height: 1;
}

.modal-close-btn:hover {
    background: #e0e6f0;
    color: #002d72;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.modal-photo-container {
    text-align: center;
    margin-bottom: 1.5rem;
}

.modal-photo-container .photo-wrapper,
.modal-photo-container .photo-placeholder {
    width: 150px;
    height: 150px;
    margin: 0 auto;
    border-radius: 50%;
}

.modal-photo-container .student-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
}

.modal-photo-container .photo-placeholder {
    font-size: 3rem;
}

.modal-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.modal-detail-label {
    font-weight: 600;
    color: #002d72;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-detail-value {
    color: #1d1d1f;
    font-size: 1rem;
    padding: 0.5rem;
    background: #f8f9fc;
    border-radius: 6px;
}

.modal-detail-value:empty::before {
    content: '—';
    color: #999;
}

/* Read-only field in table view */
.field-readonly {
    display: block;
    color: #1d1d1f;
    font-size: 0.95rem;
    padding: 0.5rem;
}

/* Editable field in modal */
.modal-field-editor {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.modal-field-editor input {
    width: 100%;
    border-radius: 8px;
    border: 1px solid #d0d5dd;
    padding: 0.6rem;
    font-family: inherit;
    font-size: 0.95rem;
    background: #fff;
    color: #1d1d1f;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.modal-field-editor input:focus {
    outline: none;
    border-color: #00509d;
    box-shadow: 0 0 0 3px rgba(0, 80, 157, 0.1);
}

.modal-field-editor button {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: none;
    background: #00509d;
    color: #fff;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s ease;
    align-self: flex-start;
}

.modal-field-editor button:hover {
    background: #003f7f;
}

.modal-field-editor button:disabled {
    background: #999;
    cursor: not-allowed;
    opacity: 0.6;
}

.modal-notes {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e6f0;
}

.modal-notes textarea {
    width: 100%;
    min-height: 100px;
    border-radius: 8px;
    border: 1px solid #d0d5dd;
    padding: 0.75rem;
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
}

.modal-notes button {
    margin-top: 0.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    border: none;
    background: #00509d;
    color: #fff;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s ease;
}

.modal-notes button:hover {
    background: #003f7f;
}

.modal-notes button:disabled {
    background: #999;
    cursor: not-allowed;
}

.modal-add-field button {
    width: 100%;
    padding: 0.75rem 1.2rem;
    border-radius: 8px;
    border: 2px dashed #00509d;
    background: #f8f9fc;
    color: #00509d;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.modal-add-field button:hover {
    background: #eaf1fb;
    border-color: #003f7f;
    color: #003f7f;
}

.modal-add-field button:disabled {
    background: #f0f0f0;
    border-color: #ccc;
    color: #999;
    cursor: not-allowed;
}

@media (max-width: 720px) {
    .table-controls {
        flex-direction: column;
        align-items: flex-start;
    }

    .upload-form {
        flex-direction: column;
        align-items: flex-start;
    }

    .upload-form button {
        width: 100%;
    }

    .pagination-buttons {
        gap: 0.35rem;
    }

    .pagination-btn {
        min-width: 36px;
        height: 36px;
        padding: 0.4rem 0.6rem;
        font-size: 0.9rem;
    }

    .table-controls-spacer {
        display: none;
    }

    .card-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 1rem;
    }

    .student-card .card-photo-wrapper {
        width: 100px;
        height: 100px;
    }

    .student-card .card-photo-placeholder,
    .student-card .card-student-photo {
        width: 100px;
        height: 100px;
        font-size: 2rem;
    }

    .modal-content {
        width: 100%;
        max-height: 95vh;
    }
}

/* ============================================================================
   Learning Mode Styles
   ============================================================================ */

/* Navigation spacing */
.site-header nav {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.site-header nav a {
    transition: opacity 0.2s ease;
}

.site-header nav a:hover {
    opacity: 0.8;
}

/* Profile Section */
.learn-profile-section {
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #1d1d1f;
}

.form-group select,
.form-group input[type="text"] {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e6f0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s ease;
}

.form-group select:focus,
.form-group input[type="text"]:focus {
    outline: none;
    border-color: #00509d;
    box-shadow: 0 0 0 3px rgba(0, 80, 157, 0.1);
}

.form-group select[multiple] {
    min-height: 120px;
}

.hint {
    display: block;
    font-size: 0.85rem;
    color: #5b5d63;
    margin-top: 0.35rem;
}

.btn-primary, .btn-secondary {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 999px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn-primary {
    background: #00509d;
    color: #fff;
}

.btn-primary:hover {
    background: #003f7f;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 80, 157, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: #e0e6f0;
    color: #1d1d1f;
}

.btn-secondary:hover {
    background: #d0d8e8;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* Mode Selector */
.mode-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
}

.mode-option {
    cursor: pointer;
}

.mode-option input[type="radio"] {
    display: none;
}

.mode-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    border: 2px solid #e0e6f0;
    border-radius: 12px;
    background: #fff;
    transition: all 0.2s ease;
    text-align: center;
}

.mode-option input:checked + .mode-card {
    border-color: #00509d;
    background: #f0f7ff;
    box-shadow: 0 2px 8px rgba(0, 80, 157, 0.15);
}

.mode-card:hover {
    border-color: #00509d;
}

.mode-card strong {
    font-size: 1.05rem;
    color: #1d1d1f;
}

.mode-card small {
    color: #5b5d63;
    font-size: 0.85rem;
}

/* Filters */
.filters-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Stats Dashboard */
.stats-dashboard {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e0e6f0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: linear-gradient(135deg, #f8f9fc 0%, #fff 100%);
    padding: 1.5rem;
    border-radius: 12px;
    border: 2px solid #e0e6f0;
    text-align: center;
    transition: all 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.stat-clickable {
    cursor: pointer;
}

.stat-clickable:hover {
    border-color: #00509d;
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0, 80, 157, 0.15);
}

.stat-clickable:active {
    transform: translateY(-2px);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: #00509d;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    color: #5b5d63;
    font-weight: 500;
}

.stat-mastered .stat-value {
    color: #4CAF50;
}

.stat-in-progress .stat-value {
    color: #2196F3;
}

.stat-struggling .stat-value {
    color: #FF5722;
}

.stat-new .stat-value {
    color: #FFC107;
}

/* Flashcard Session */
.flashcard-session {
    padding: 2rem 0;
}

.session-progress {
    margin-bottom: 1.5rem;
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: #e0e6f0;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #00509d 0%, #4CAF50 100%);
    transition: width 0.4s ease;
    border-radius: 999px;
}

.progress-text {
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    color: #5b5d63;
}

/* Session Stats */
.session-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.session-stat {
    font-size: 1.1rem;
    font-weight: 600;
}

.session-stat-correct {
    color: #4CAF50;
}

.session-stat-incorrect {
    color: #FF5722;
}

/* Flashcard */
.flashcard-container {
    max-width: 600px;
    margin: 0 auto;
}

.flashcard {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

.flashcard:hover {
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.2);
}

.flashcard-photo-wrapper {
    position: relative;
    width: 100%;
    padding-top: 100%; /* 1:1 aspect ratio */
    background: #f8f9fc;
}

.flashcard-photo-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e0e6f0 0%, #f8f9fc 100%);
    font-size: 4rem;
    color: #5b5d63;
}

.flashcard-photo-placeholder.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 0.3; }
}

.flashcard-photo-placeholder.error {
    background: #ffe5e5;
    color: #FF5722;
}

.flashcard-photo {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.flashcard-grade {
    padding: 1rem;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: #00509d;
    background: #f8f9fc;
    border-top: 1px solid #e0e6f0;
}

/* Answer Section */
.answer-section {
    text-align: center;
}

#answer-form {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

#answer-input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 2px solid #e0e6f0;
    border-radius: 999px;
    font-size: 1.1rem;
    font-family: inherit;
    transition: all 0.2s ease;
}

#answer-input:focus {
    outline: none;
    border-color: #00509d;
    box-shadow: 0 0 0 3px rgba(0, 80, 157, 0.1);
}

#answer-input:disabled {
    background: #f8f9fc;
    cursor: not-allowed;
}

.keyboard-hint {
    font-size: 0.85rem;
    color: #5b5d63;
    margin-top: 0.5rem;
}

/* Feedback Section */
.feedback-section {
    text-align: center;
    animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.feedback-message {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding: 1.5rem;
    border-radius: 16px;
    animation: scaleIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes scaleIn {
    from {
        transform: scale(0.5);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.feedback-correct {
    background: #e8f5e9;
    color: #4CAF50;
}

.feedback-incorrect {
    background: #ffe5e5;
    color: #FF5722;
}

.correct-answer {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 1.5rem;
}

.incorrect-reveal {
    color: #5b5d63;
}

/* Retry Section */
.retry-section {
    text-align: center;
    animation: fadeInUp 0.3s ease;
}

.retry-message {
    margin-bottom: 2rem;
}

.retry-instruction {
    font-size: 1.2rem;
    font-weight: 600;
    color: #FF5722;
    margin-bottom: 1rem;
}

.retry-correct-name {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1d1d1f;
    padding: 1.5rem;
    background: #f5f5f7;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    border: 2px solid #FFB74D;
}

/* Session Actions */
.session-actions {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e0e6f0;
}

/* Modal Enhancements for Learn Mode */
.modal {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

#new-profile-modal .modal-content,
#results-modal .modal-content {
    padding: 2rem;
}

#new-profile-modal h3,
#results-modal h2 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: #002d72;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.modal-large {
    width: min(700px, 95vw);
}

/* Results Modal */
.results-summary {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    margin: 2rem 0;
}

.results-score {
    display: flex;
    justify-content: center;
}

.score-circle {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00509d 0%, #4CAF50 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(0, 80, 157, 0.3);
    animation: scaleIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.score-value {
    font-size: 3rem;
    font-weight: 700;
    color: #fff;
    line-height: 1;
}

.score-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 0.5rem;
}

.results-stats {
    display: flex;
    gap: 2rem;
    justify-content: center;
}

.result-stat {
    text-align: center;
    font-size: 1.1rem;
    color: #5b5d63;
}

.result-stat strong {
    display: block;
    font-size: 2rem;
    color: #00509d;
    margin-bottom: 0.25rem;
}

/* Confetti Animation */
@keyframes confettiFall {
    to {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    top: -10px;
    z-index: 9999;
    animation: confettiFall 3s linear forwards;
}

/* Responsive Design for Learn Mode */
@media (max-width: 720px) {
    .mode-selector {
        grid-template-columns: 1fr;
    }

    .filters-row {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .flashcard-container {
        padding: 0 0.5rem;
    }

    .flashcard-photo-placeholder {
        font-size: 3rem;
    }

    .feedback-message {
        font-size: 1.5rem;
        padding: 1rem;
    }

    .correct-answer {
        font-size: 1.2rem;
    }

    .score-circle {
        width: 140px;
        height: 140px;
    }

    .score-value {
        font-size: 2.5rem;
    }

    .results-stats {
        flex-direction: column;
        gap: 1rem;
    }

    #answer-form {
        flex-direction: column;
    }

    #answer-form button {
        width: 100%;
    }

    .modal-actions {
        flex-direction: column;
    }

    .modal-actions button {
        width: 100%;
    }
}

/* ============================================================================
   Student List Modal
   ============================================================================ */

.student-list-content {
    max-height: 60vh;
    overflow-y: auto;
    padding: 1rem 0;
}

.student-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.student-list-item {
    background: #f8f9fc;
    border-radius: 8px;
    padding: 1rem;
    border-left: 4px solid #e0e6f0;
    transition: all 0.2s ease;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.student-list-item:hover {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.student-list-photo {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    background: #e0e6f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.student-list-photo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.student-list-photo-placeholder {
    font-size: 0.7rem;
    color: #5b5d63;
    text-align: center;
    padding: 0.5rem;
}

.student-list-info {
    flex: 1;
    min-width: 0;
}

.student-status-mastered {
    border-left-color: #4CAF50;
}

.student-status-in_progress {
    border-left-color: #2196F3;
}

.student-status-struggling {
    border-left-color: #FF5722;
}

.student-status-new {
    border-left-color: #FFC107;
}

.student-name-grade {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.student-name-grade strong {
    font-size: 1.05rem;
    color: #1d1d1f;
}

.student-grade {
    font-size: 0.85rem;
    color: #5b5d63;
    background: #e0e6f0;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.student-details {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: #5b5d63;
}

.student-details span {
    display: inline-block;
}

.stat-correct {
    color: #4CAF50;
    font-weight: 600;
}

.stat-incorrect {
    color: #FF5722;
    font-weight: 600;
}

.student-list-summary {
    text-align: center;
    padding: 1rem 0 0.5rem;
    color: #5b5d63;
    font-size: 0.9rem;
    border-top: 1px solid #e0e6f0;
    margin-top: 1rem;
}

/* Pagination Controls */
.student-list-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    margin-top: 1rem;
    border-top: 1px solid #e0e6f0;
}

.pagination-btn {
    background: #00509d;
    color: #fff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
    background: #003f7f;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 80, 157, 0.2);
}

.pagination-btn:active:not(:disabled) {
    transform: translateY(0);
}

.pagination-btn:disabled {
    background: #e0e6f0;
    color: #5b5d63;
    cursor: not-allowed;
    opacity: 0.6;
}

.pagination-info {
    font-size: 0.9rem;
    color: #1d1d1f;
    font-weight: 500;
    min-width: 100px;
    text-align: center;
}

.loading-spinner {
    text-align: center;
    padding: 2rem;
    color: #5b5d63;
    font-size: 1rem;
}

.empty-message,
.error-message {
    text-align: center;
    padding: 2rem;
    color: #5b5d63;
    font-size: 1rem;
}

.error-message {
    color: #FF5722;
}

/* Mobile responsive */
@media (max-width: 720px) {
    .student-list-photo {
        width: 50px;
        height: 50px;
    }

    .student-name-grade {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .student-details {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .student-list-pagination {
        flex-direction: column;
        gap: 0.5rem;
    }

    .pagination-btn {
        width: 100%;
        padding: 0.75rem 1rem;
    }

    .pagination-info {
        order: -1;
        margin-bottom: 0.5rem;
    }
}

