/* Secure Lesson Viewer Styles */
.secure-lesson-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.98) !important;
    z-index: 10000 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.secure-lesson-container {
    width: 95vw;
    height: 95vh;
    background: #ffffff;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lesson-header {
    background: linear-gradient(135deg, #8B5FC7, #9C6CD3);
    color: white;
    padding: 0;
    flex-shrink: 0;
}

.lesson-title-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.lesson-title-bar h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.lesson-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.security-indicator {
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.close-lesson-btn {
    background: #ff4757;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.close-lesson-btn:hover {
    background: #ff3838;
    transform: translateY(-1px);
}

.lesson-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
}

.viewer-info {
    display: flex;
    gap: 20px;
    font-size: 14px;
}

.lesson-actions .worksheet-btn {
    background: #2ed573;
    border: none;
    color: white;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.worksheet-btn:hover {
    background: #1dd362;
    transform: translateY(-1px);
}

.lesson-content-area {
    flex: 1;
    position: relative;
    background: #f8f9fa;
    overflow: hidden;
}

.content-watermark {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
    opacity: 0.7;
    pointer-events: none;
    user-select: none;
}

.watermark-text {
    background: rgba(139, 95, 199, 0.1);
    color: #8B5FC7;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid rgba(139, 95, 199, 0.3);
}

.pdf-viewer-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #666;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #8B5FC7;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.lesson-footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 10px 20px;
    flex-shrink: 0;
}

.security-notice {
    font-size: 12px;
    opacity: 0.8;
}

.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #e74c3c;
    text-align: center;
}

.error-state h3 {
    margin: 0 0 10px 0;
    font-size: 24px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .secure-lesson-container {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }

    .lesson-title-bar {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .lesson-toolbar {
        flex-direction: column;
        gap: 10px;
    }

    .lesson-title-bar h3 {
        font-size: 20px;
    }

    .viewer-info {
        justify-content: center;
    }
}

/* Topic Lessons Modal Styles */
.week-section {
    margin-bottom: 25px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.week-section h4 {
    background: linear-gradient(135deg, #8B5FC7, #9C6CD3);
    color: white;
    margin: 0;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 600;
}

.week-lessons {
    padding: 15px;
}

.lesson-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border: 1px solid #f0f0f0;
    border-radius: 6px;
    margin-bottom: 10px;
    background: #fafafa;
    transition: all 0.2s ease;
}

.lesson-card:hover {
    background: #f5f5f5;
    border-color: #e0e0e0;
}

.lesson-card:last-child {
    margin-bottom: 0;
}

.lesson-info {
    flex: 1;
}

.lesson-info h5 {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.lesson-description {
    margin: 0 0 10px 0;
    color: #666;
    font-size: 14px;
    line-height: 1.4;
}

.lesson-meta {
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: #888;
}

.lesson-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.lesson-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.lesson-actions .btn {
    font-size: 12px;
    padding: 6px 12px;
    white-space: nowrap;
}

.badge.unpublished {
    background: #ffc107;
    color: #000;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.topic-lessons-container {
    max-height: 500px;
    overflow-y: auto;
}

/* Content Card Click Fix - Enhanced for Maths/English/Extra Resources */
.content-card {
    cursor: pointer !important;
    pointer-events: auto !important;
    user-select: none !important;
    transition: all 0.2s ease !important;
}

.content-card:hover {
    cursor: pointer !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important;
}

/* Ensure content card children don't block clicks */
.content-card * {
    pointer-events: none !important;
}

.content-card {
    pointer-events: auto !important;
}

/* Button Click Fixes - Override anti-copy protection */
.btn, button, .button {
    cursor: pointer !important;
    pointer-events: auto !important;
    user-select: none !important;
}

.btn:hover, button:hover, .button:hover {
    cursor: pointer !important;
    opacity: 0.9;
}

/* Specific fixes for problematic buttons */
.manage-billing-btn,
.upgrade-plan-btn,
.add-homework-btn,
.billing-button,
.upgrade-button,
.homework-button,
button[onclick*="billing"],
button[onclick*="upgrade"],
button[onclick*="homework"],
button[onclick*="manageBilling"],
button[onclick*="upgradeSubscription"],
button[onclick*="addHomework"] {
    cursor: pointer !important;
    pointer-events: auto !important;
    user-select: none !important;
    z-index: 10 !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    border: none !important;
    padding: 12px 24px !important;
    border-radius: 8px !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
}

/* Hover effects for problematic buttons */
.manage-billing-btn:hover,
.upgrade-plan-btn:hover,
.add-homework-btn:hover,
.billing-button:hover,
.upgrade-button:hover,
.homework-button:hover,
button[onclick*="billing"]:hover,
button[onclick*="upgrade"]:hover,
button[onclick*="homework"]:hover,
button[onclick*="manageBilling"]:hover,
button[onclick*="upgradeSubscription"]:hover,
button[onclick*="addHomework"]:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3) !important;
    filter: brightness(110%) !important;
}

/* Modal and overlay fixes */
.modal, .modal * {
    pointer-events: auto !important;
}

/* Form elements fix */
input, select, textarea, button {
    pointer-events: auto !important;
    user-select: text !important;
}

button, .btn {
    user-select: none !important;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal:not(.hidden) {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 0;
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}

/* Dynamic modal sizing */
.modal-content.large {
    max-width: 900px;
    width: 95%;
}

.modal-content.small {
    max-width: 500px;
    width: 80%;
}

/* Dynamic Upload Modal - No scrollbars, auto-sizing */
#contentUploadModal .modal-content {
    max-height: 95vh;
    max-width: 600px;
    width: 90%;
    overflow: visible;
    display: flex;
    flex-direction: column;
}

#contentUploadModal .modal-body {
    flex: 1;
    overflow-y: auto;
    max-height: 70vh;
    padding: 24px;
}

/* Ensure form content flows naturally without scrollbars */
#contentUploadModal .modal-body form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

#contentUploadModal .form-row {
    display: flex;
    gap: 16px;
}

#contentUploadModal .form-row .form-group {
    flex: 1;
}

/* Style scrollbars for upload modal */
#contentUploadModal .modal-body::-webkit-scrollbar {
    width: 6px;
}

#contentUploadModal .modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

#contentUploadModal .modal-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

#contentUploadModal .modal-body::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Selected files display */
.selected-files-list {
    margin-top: 10px;
}

.selected-files {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 12px;
    margin-top: 8px;
}

.selected-files h5 {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #495057;
    font-weight: 600;
}

.selected-files ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.selected-files li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    border-bottom: 1px solid #e9ecef;
}

.selected-files li:last-child {
    border-bottom: none;
}

.file-name {
    font-weight: 500;
    color: #212529;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-size {
    font-size: 12px;
    color: #6c757d;
    margin-left: 8px;
}

/* Enhanced Lesson Modal Styles */
.lesson-info {
    background: #f8f9fa;
    padding: 16px;
    margin: 16px 0;
    border-radius: 8px;
    border-left: 4px solid var(--primary-purple);
}

.lesson-metadata {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 12px;
}

.metadata-item {
    font-size: 14px;
    color: #495057;
}

.metadata-item strong {
    color: #212529;
    font-weight: 600;
}

.lesson-description {
    margin-top: 12px;
}

.lesson-description p {
    margin: 8px 0 0 0;
    color: #6c757d;
    line-height: 1.5;
}

.file-selection-panel {
    margin: 16px 0;
    border-top: 1px solid #e9ecef;
    padding-top: 16px;
}

.file-selection-group {
    margin-bottom: 20px;
}

.file-selection-group h4 {
    margin: 0 0 12px 0;
    color: var(--primary-purple);
    font-size: 16px;
    font-weight: 600;
}

.btn-file-select {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 8px;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.btn-file-select:hover {
    background: #f8f9fa;
    border-color: var(--primary-purple);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(139, 95, 191, 0.1);
}

.file-icon {
    font-size: 20px;
    margin-right: 12px;
    min-width: 32px;
}

.file-name {
    flex: 1;
    font-weight: 500;
    color: #212529;
}

.file-action {
    color: var(--primary-purple);
    font-size: 12px;
    font-weight: 600;
    opacity: 0.8;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.file-item .btn-file-select {
    flex: 1;
    margin-bottom: 0;
}

.download-btn,
.print-btn {
    white-space: nowrap;
    min-width: 100px;
}

.no-content-selected {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 20px;
}

.selection-prompt {
    text-align: center;
    color: #6c757d;
}

.selection-prompt h4 {
    margin: 0 0 8px 0;
    color: #495057;
}

.no-files {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
    background: #f8f9fa;
    border-radius: 8px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .lesson-metadata {
        flex-direction: column;
        gap: 8px;
    }

    .file-item {
        flex-direction: column;
        align-items: stretch;
    }

    .file-item .btn-file-select {
        margin-bottom: 8px;
    }

    .download-btn,
    .print-btn {
        width: 100%;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 12px 12px 0 0;
}

.modal-header h3 {
    margin: 0;
    color: #2d3748;
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #718096;
    padding: 4px;
    line-height: 1;
}

.modal-close:hover {
    color: #2d3748;
}

.modal-body {
    padding: 24px;
}

.hidden {
    display: none !important;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header and Navigation */
.header {
    background: var(--white);
    border-radius: 20px;
    box-shadow: 0 8px 32px var(--shadow);
    margin-bottom: 30px;
    padding: 25px 35px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--soft-lavender), var(--sky-blue));
    opacity: 0.1;
    pointer-events: none;
}

.sidebar-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 30px;
}

.logo {
    font-size: 28px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-purple), var(--bright-orange));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
    text-align: center;
}

.tagline {
    color: rgba(255,255,255,0.8);
    font-size: 14px;
    font-weight: 500;
    text-align: center;
}

/* Mobile Sidebar (hidden by default) */
.sidebar-mobile {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    background: linear-gradient(135deg, var(--primary-purple), var(--coral-pink));
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(255,255,255,0.1);
    overflow-y: auto;
    display: none;
}

.sidebar-mobile.active {
    transform: translateX(0);
    display: block;
}

.menu-toggle {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-dark);
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-toggle:hover {
    background: rgba(139, 95, 191, 0.1);
}

/* Navigation */
.nav-links {
    list-style: none;
    padding: 0;
}

.nav-links li {
    margin-bottom: 8px;
}

.nav-links a {
    display: flex;
    align-items: center;
    padding: 15px 25px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    border-radius: 12px;
    margin: 0 15px;
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--white);
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    transform: translateX(5px);
}

.nav-links a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background: var(--white);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.nav-links a.active::before,
.nav-links a:hover::before {
    transform: scaleY(1);
}

.nav-icon {
    margin-right: 12px;
    font-size: 18px;
    width: 24px;
    text-align: center;
}

/* User Info */
.header .user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    flex: 0 0 auto; /* Keep this on the right side */
    justify-content: flex-end;
}

.subscription-badge {
    background: linear-gradient(135deg, var(--grass-green), var(--sky-blue));
    color: var(--white);
    padding: 10px 18px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(107, 207, 127, 0.3);
    position: relative;
}

.subscription-badge.active-sub {
    background: linear-gradient(135deg, var(--grass-green), var(--sky-blue));
    color: var(--white);
    padding: 10px 18px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(107, 207, 127, 0.3);
    position: relative;
}

.subscription-badge.inactive {
    background: linear-gradient(135deg, var(--coral-pink), #FF4D4F);
    box-shadow: 0 4px 12px rgba(255, 107, 157, 0.3);
    padding: 10px 18px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
}

/* Buttons */
.btn {
    background: linear-gradient(135deg, var(--primary-purple), var(--coral-pink));
    color: var(--white);
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(139, 95, 191, 0.3);
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    border: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 95, 191, 0.4);
}

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

.btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn-secondary {
    background: linear-gradient(135deg, var(--text-medium), var(--text-dark));
    box-shadow: 0 4px 15px rgba(74, 85, 104, 0.3);
}

.btn-secondary:hover {
    box-shadow: 0 6px 20px rgba(74, 85, 104, 0.4);
}

/* Action Buttons */
.btn-approve, .btn-reject, .btn-delete {
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    transition: all 0.3s ease;
    min-width: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.btn-approve {
    background: linear-gradient(135deg, var(--success-green), #22c55e);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.btn-approve:hover {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
}

.btn-reject {
    background: linear-gradient(135deg, var(--error-red), #dc2626);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-reject:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.btn-delete {
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

.btn-delete:hover {
    background: linear-gradient(135deg, #ea580c, #c2410c);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(249, 115, 22, 0.4);
}

.btn-approve:disabled, .btn-reject:disabled, .btn-delete:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Edit and Save/Cancel Buttons */
.btn-edit, .btn-save, .btn-cancel {
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    transition: all 0.3s ease;
    min-width: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.btn-edit {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-edit:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.btn-save {
    background: linear-gradient(135deg, var(--success-green), #22c55e);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.btn-save:hover {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
}

.btn-cancel {
    background: #e5e7eb;
    color: #374151;
    border: 1px solid #d1d5db;
    font-weight: 500;
}

.btn-cancel:hover {
    background: #f3f4f6;
    transform: translateY(-2px);
}

/* User Edit Form */
.user-edit-form {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin-top: 15px;
}

.edit-fields {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.field-group {
    display: flex;
    flex-direction: column;
}

.field-group label {
    font-size: 0.9em;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.field-group input,
.field-group select {
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.9em;
    transition: border-color 0.3s ease;
}

.field-group input:focus,
.field-group select:focus {
    outline: none;
    border-color: var(--primary-purple);
    box-shadow: 0 0 0 3px rgba(139, 95, 191, 0.1);
}

.edit-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.standard-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* User Cards */
.user-card {
    background: var(--white);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px var(--shadow);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.user-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px var(--shadow-hover);
}

.comprehensive-user-card {
    background: var(--white);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px var(--shadow);
    transition: all 0.3s ease;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 20px;
    align-items: start;
    position: relative;
    overflow: hidden;
}

.comprehensive-user-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px var(--shadow-hover);
}

.user-main-info {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.user-identity h3 {
    color: var(--text-dark);
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.user-display-name {
    color: var(--text-medium);
    font-size: 14px;
    margin-bottom: 8px;
}

.user-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.status-badge,
.role-badge,
.admin-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.azure {
    background: linear-gradient(135deg, var(--grass-green), var(--sky-blue));
    color: var(--white);
}

.status-badge.pending {
    background: linear-gradient(135deg, var(--sunny-yellow), var(--bright-orange));
    color: var(--text-dark);
}

.role-badge.tutor {
    background: linear-gradient(135deg, var(--primary-purple), var(--coral-pink));
    color: var(--white);
}

.role-badge.student_parent {
    background: linear-gradient(135deg, var(--sky-blue), var(--grass-green));
    color: var(--white);
}

.admin-badge {
    background: linear-gradient(135deg, var(--bright-orange), var(--sunny-yellow));
    color: var(--text-dark);
}

.user-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 16px;
}

.detail-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detail-group p {
    color: var(--text-medium);
    font-size: 14px;
    line-height: 1.4;
}

.detail-group strong {
    color: var(--text-dark);
    font-weight: 600;
}

/* User Actions */
.user-actions {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: flex-end;
    justify-content: center;
    min-width: 160px;
}

.action-buttons {
    display: flex;
    flex-direction: row;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.role-selection {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.role-select {
    padding: 8px 12px;
    border: 2px solid rgba(139, 95, 191, 0.2);
    border-radius: 8px;
    background: var(--white);
    color: var(--text-dark);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.role-select:focus {
    outline: none;
    border-color: var(--primary-purple);
    box-shadow: 0 0 0 3px rgba(139, 95, 191, 0.1);
}

/* Editable Fields */
.editable-field {
    background: rgba(var(--primary-rgb), 0.05);
    padding: 4px 8px;
    border-radius: 6px;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    display: inline-block;
    min-width: 100px;
    user-select: text !important;
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    cursor: text;
}

.editable-field:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.1);
}

.editable-field:hover {
    background: rgba(var(--primary-rgb), 0.08);
    cursor: text;
}

/* Statistics Cards */
.stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--white);
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 8px 32px var(--shadow);
    text-align: center;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.stat-number {
    display: block;
    font-size: 36px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-purple), var(--bright-orange));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.stat-label {
    color: var(--text-medium);
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Filter Buttons */
.user-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.filter-btn {
    background: var(--white);
    border: 2px solid rgba(139, 95, 191, 0.2);
    color: var(--text-medium);
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-btn:hover,
.filter-btn.active {
    background: linear-gradient(135deg, var(--primary-purple), var(--coral-pink));
    color: var(--white);
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 95, 191, 0.3);
}

/* No Users State */
.no-users {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-medium);
}

.no-users-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 16px;
    opacity: 0.6;
}

.no-users p {
    font-size: 18px;
    font-weight: 500;
}

/* Auth Container Styles */
.auth-container {
    background: var(--white);
    border-radius: 25px;
    padding: 50px;
    max-width: 450px;
    margin: 100px auto;
    box-shadow: 0 20px 60px var(--shadow);
    text-align: center;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.auth-container::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, var(--sunny-yellow) 0%, transparent 70%);
    opacity: 0.1;
    border-radius: 50%;
}

.auth-container h2 {
    color: var(--primary-purple);
    margin-bottom: 30px;
    font-size: 32px;
    font-weight: 800;
}

.auth-logo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: contain;
    margin-bottom: 20px;
    box-shadow: 0 8px 25px rgba(139, 95, 191, 0.2);
    animation: bounce 2s infinite;
}

.auth-status {
    background: var(--bg-light);
    border: 2px solid #e2e8f0;
    color: var(--text-dark);
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 25px;
    font-weight: 500;
}

.auth-status.success {
    background: #f0fdf4;
    border-color: #22c55e;
    color: #15803d;
}

.auth-status.error {
    background: #fef2f2;
    border-color: #ef4444;
    color: #dc2626;
}

.auth-status.info {
    background: #f0f9ff;
    border-color: var(--primary-purple);
    color: var(--primary-purple);
}

/* Animations */
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.bounce {
    animation: bounce 2s infinite;
}

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

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Responsive Design */
@media (max-width: 768px) {
    .comprehensive-user-card {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .user-details {
        grid-template-columns: 1fr;
    }
    
    .user-actions {
        align-items: stretch;
        min-width: auto;
    }
    
    .action-buttons {
        flex-direction: row;
        justify-content: center;
    }
    
    .stats-overview {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .user-filters {
        justify-content: center;
    }
}

/* Content Grid Layouts */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    margin-top: 32px;
}

.content-card {
    background: white;
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(139, 95, 191, 0.1);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    min-width: 250px; /* Prevent cards from getting too narrow */
    min-height: 120px; /* Ensure enough height for content */
}

.content-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    border-color: rgba(139, 95, 191, 0.2);
}

.content-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-purple), var(--bright-orange));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.content-card:hover::before {
    opacity: 1;
}

.content-card .card-icon {
    font-size: 2.5rem;
    margin-bottom: 16px;
    display: block;
}

.content-card .card-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    line-height: 1.3;
}

.content-card .card-description {
    color: var(--text-medium);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 20px;
}

.content-card .card-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.content-card .card-meta span {
    font-size: 0.85rem;
    padding: 6px 12px;
    background: rgba(139, 95, 191, 0.1);
    color: var(--primary-purple);
    border-radius: 20px;
    font-weight: 500;
}

/* Content card themes */
.content-card.maths .card-icon {
    color: var(--bright-orange);
}

.content-card.english .card-icon {
    color: var(--primary-purple);
}

.content-card.resources .card-icon {
    color: var(--success-green);
}

.content-card.planning .card-icon {
    color: var(--sky-blue);
}

.content-card.enhanced {
    background: linear-gradient(135deg, white 0%, rgba(139, 95, 191, 0.02) 100%);
}

/* Coming Soon Component */
.coming-soon {
    text-align: center;
    padding: 60px 40px;
    background: linear-gradient(135deg, rgba(139, 95, 191, 0.05) 0%, rgba(255, 165, 0, 0.05) 100%);
    border-radius: 20px;
    border: 2px dashed rgba(139, 95, 191, 0.2);
    margin: 32px 0;
}

.coming-soon-icon {
    font-size: 4rem;
    margin-bottom: 24px;
    opacity: 0.8;
}

.coming-soon h3 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--primary-purple), var(--bright-orange));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.coming-soon p {
    color: var(--text-medium);
    font-size: 1.1rem;
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
}

/* Additional mobile responsive styles for content */
@media (max-width: 768px) {
    .content-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .content-card {
        padding: 20px;
    }
    
    .content-card .card-icon {
        font-size: 2rem;
    }
    
    .content-card .card-title {
        font-size: 1.2rem;
    }
    
    .coming-soon {
        padding: 40px 20px;
    }
    
    .coming-soon-icon {
        font-size: 3rem;
    }
    
    .coming-soon h3 {
        font-size: 1.5rem;
    }
    
    .coming-soon p {
        font-size: 1rem;
    }
}

/* Club Selection Styles */
.club-selection {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
    gap: 40px;
    padding: 40px 20px;
}

.club-selection-title {
    font-size: 42px;
    color: var(--primary-purple);
    margin-bottom: 20px;
    font-weight: 800;
    text-shadow: 2px 2px 4px rgba(139, 95, 191, 0.2);
}

.club-selection-subtitle {
    font-size: 20px;
    color: var(--text-medium);
    margin-bottom: 40px;
    font-weight: 400;
}

.club-boxes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 40px;
    width: 100%;
    max-width: 900px;
}

.club-box {
    background: var(--white);
    padding: 40px 30px;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    border: 3px solid rgba(255, 155, 71, 0.3);
}

.club-box:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.2);
}

.club-box.year4 {
    background: linear-gradient(135deg, rgba(255, 155, 71, 0.1), rgba(255, 217, 61, 0.1));
    border-color: rgba(255, 155, 71, 0.3);
}

.club-box.year5 {
    background: linear-gradient(135deg, rgba(107, 207, 127, 0.1), rgba(78, 205, 196, 0.1));
    border-color: rgba(107, 207, 127, 0.3);
}

.club-icon {
    font-size: 64px;
    margin-bottom: 20px;
    filter: drop-shadow(2px 2px 6px rgba(0,0,0,0.1));
}

.club-box.year4 .club-icon {
    color: var(--bright-orange);
}

.club-box.year5 .club-icon {
    color: var(--success-green);
}

.club-title {
    font-size: 28px;
    color: var(--text-primary);
    margin-bottom: 12px;
    font-weight: 700;
}

.club-subtitle {
    font-size: 18px;
    color: var(--text-medium);
    font-weight: 600;
    margin-bottom: 16px;
}

.club-description {
    font-size: 16px;
    color: var(--text-light);
    line-height: 1.6;
}

/* Dashboard Layout */
.dashboard {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
    min-height: calc(100vh - 180px);
    margin-top: 20px;
}

.sidebar {
    background: var(--white);
    border-radius: 20px;
    padding: 30px 20px;
    color: var(--text-dark);
    height: fit-content;
    box-shadow: 0 8px 32px var(--shadow);
    position: relative;
    overflow: hidden;
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(135deg, var(--primary-purple), var(--coral-pink));
    opacity: 0.8;
    pointer-events: none;
}

.back-to-clubs {
    background: var(--bg-light);
    border: none;
    color: var(--text-dark);
    padding: 12px 16px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 20px;
    width: 100%;
    transition: all 0.3s ease;
}

.back-to-clubs:hover {
    background: rgba(139, 95, 191, 0.1);
    color: var(--primary-purple);
    transform: translateX(-2px);
}

.sidebar-header {
    text-align: center;
    padding: 20px 0;
    border-bottom: 2px solid var(--bg-light);
    margin-bottom: 20px;
}

.sidebar-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-purple);
    margin-bottom: 8px;
}

.sidebar-subtitle {
    font-size: 14px;
    opacity: 0.8;
    font-weight: 400;
}

.nav-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    color: var(--text-medium);
    margin-bottom: 4px;
}

.nav-item:hover {
    background: rgba(139, 95, 191, 0.1);
    color: var(--primary-purple);
    transform: translateX(3px);
}

.nav-item.active {
    background: linear-gradient(135deg, var(--primary-purple), var(--coral-pink));
    color: var(--white);
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(139, 95, 191, 0.3);
}

.nav-item-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

/* Student Dashboard Sidebar */
.student-dashboard-sidebar {
    background: linear-gradient(135deg, var(--primary-purple), var(--coral-pink));
    border-radius: 20px;
    padding: 30px 20px;
    color: var(--white);
    height: fit-content;
    box-shadow: 0 8px 32px var(--shadow);
    position: relative;
    overflow: hidden;
}

.student-dashboard-sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: rgba(255, 255, 255, 0.3);
    pointer-events: none;
}

.student-dashboard-sidebar .sidebar-header {
    text-align: center;
    padding: 20px 0;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 20px;
}

.student-dashboard-sidebar .sidebar-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 8px;
}

.student-dashboard-sidebar .sidebar-subtitle {
    font-size: 14px;
    opacity: 0.8;
    font-weight: 400;
    color: var(--white);
}

/* Enhanced Student Management Interface */
.student-management-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.overview-section {
    margin-bottom: 30px;
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 20px 0;
    border-bottom: 2px solid var(--bg-light);
    padding-bottom: 10px;
}

/* Override content-grid for student overview specifically */
.content-grid.student-overview-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) !important;
    gap: 20px !important;
    margin-bottom: 30px;
    margin-top: 20px !important;
    max-width: none;
}

/* Better responsive breakpoints for overview grid */
@media (max-width: 1200px) {
    .content-grid.student-overview-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important;
    }
}

@media (max-width: 900px) {
    .content-grid.student-overview-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)) !important;
    }
}

@media (max-width: 640px) {
    .content-grid.student-overview-grid {
        grid-template-columns: 1fr !important;
    }

    .content-card {
        min-width: auto; /* Allow smaller cards on mobile */
        padding: 20px; /* Reduce padding on mobile */
    }
}

.student-stats, .homework-stats, .messages-stats {
    display: flex;
    gap: 12px;
    margin-top: 15px;
    justify-content: space-between;
    width: 100%;
    min-width: 0; /* Allow shrinking */
    flex-wrap: wrap; /* Allow wrapping on very small cards */
}

.stat-item {
    text-align: center;
    flex: 1 1 0;
    min-width: 60px; /* Minimum width to prevent collapse */
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-number {
    font-size: clamp(24px, 5vw, 32px); /* Responsive font size */
    font-weight: 700;
    color: var(--primary-purple);
    line-height: 1;
    word-break: keep-all;
    white-space: nowrap;
}

.stat-label {
    font-size: clamp(10px, 2.5vw, 12px); /* Responsive font size */
    color: var(--text-medium);
    margin-top: 4px;
    font-weight: 500;
    text-align: center;
    word-break: keep-all; /* Prevent breaking words */
    white-space: nowrap; /* Prevent wrapping */
    overflow: hidden;
    text-overflow: ellipsis; /* Add ellipsis if text is too long */
}

/* Students Section */
.students-section {
    margin-top: 30px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--bg-light);
}

.section-header h2 {
    margin: 0;
    color: var(--text-dark);
}

.filter-controls {
    display: flex;
    gap: 12px;
    align-items: center;
}

.filter-controls select, .filter-controls input {
    padding: 8px 12px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    font-size: 14px;
}

.filter-controls input {
    width: 200px;
}

/* Students Grid */
.students-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.student-card {
    background: var(--white);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border-light);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.student-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    border-color: var(--primary-purple);
}

.student-card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.student-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-purple), var(--coral-pink));
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 20px;
}

.student-info {
    flex: 1;
}

.student-name {
    margin: 0 0 8px 0;
    color: var(--text-dark);
    font-size: 18px;
    font-weight: 600;
}

.student-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.badge {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge.year4 {
    background: rgba(52, 152, 219, 0.1);
    color: #3498db;
}

.badge.year5 {
    background: rgba(155, 89, 182, 0.1);
    color: #9b59b6;
}

.badge.status-active {
    background: rgba(46, 204, 113, 0.1);
    color: #2ecc71;
}

.badge.status-inactive {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
}

.student-card-content {
    margin-bottom: 15px;
}

.parent-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 8px 0;
}

.parent-info.missing {
    color: var(--text-medium);
}

.info-label {
    font-size: 12px;
    color: var(--text-medium);
    font-weight: 500;
}

.info-value {
    font-size: 14px;
    color: var(--text-dark);
    font-weight: 500;
}

.student-stats-mini {
    display: flex;
    gap: 15px;
}

.stat-mini {
    text-align: center;
    flex: 1;
}

.stat-mini-number {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-purple);
    line-height: 1;
}

.stat-mini-label {
    font-size: 10px;
    color: var(--text-medium);
    margin-top: 2px;
    font-weight: 500;
}

.student-card-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    border-top: 1px solid var(--bg-light);
    padding-top: 15px;
}

.btn-xs {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
    font-weight: 500;
}

/* No Students State */
.no-students {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-medium);
}

.no-students-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.6;
}

.no-students h3 {
    margin: 0 0 10px 0;
    color: var(--text-dark);
}

.no-students p {
    margin: 0 0 20px 0;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* Student Detail View */
.student-detail-view {
    margin-top: 20px;
}

.student-detail-view.hidden {
    display: none;
}

.student-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
    border-bottom: 2px solid var(--bg-light);
    margin-bottom: 30px;
}

.student-detail-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.student-detail-info h2 {
    margin: 0;
    color: var(--text-dark);
}

.student-badges {
    display: flex;
    gap: 8px;
}

.student-actions {
    display: flex;
    gap: 10px;
}

.student-detail-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.student-info-content, .homework-list, .progress-chart {
    padding: 10px 0;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--bg-light);
}

.info-row:last-child {
    border-bottom: none;
}

.homework-item {
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 12px;
    border-left: 4px solid var(--border-light);
}

.homework-item.status-assigned {
    background: rgba(52, 152, 219, 0.05);
    border-left-color: #3498db;
}

.homework-item.status-submitted {
    background: rgba(243, 156, 18, 0.05);
    border-left-color: #f39c12;
}

.homework-item.status-graded {
    background: rgba(46, 204, 113, 0.05);
    border-left-color: #2ecc71;
}

.homework-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.homework-title {
    margin: 0;
    color: var(--text-dark);
    font-size: 16px;
    font-weight: 600;
}

.homework-meta {
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: var(--text-medium);
    margin-bottom: 8px;
}

.homework-description {
    margin: 8px 0 0 0;
    color: var(--text-dark);
    font-size: 14px;
    line-height: 1.4;
}

.homework-submission {
    font-size: 12px;
    color: var(--text-medium);
    font-style: italic;
    margin-top: 8px;
}

.no-homework {
    text-align: center;
    padding: 30px;
    color: var(--text-medium);
    font-style: italic;
}

.communication-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.no-parent {
    text-align: center;
    padding: 20px;
    color: var(--text-medium);
}

.loading-students, .error-message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px;
    color: var(--text-medium);
    font-style: italic;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--bg-light);
    border-top: 2px solid var(--primary-purple);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .student-management-actions {
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }

    .student-management-actions .btn {
        width: 100%;
    }

    .section-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .filter-controls {
        width: 100%;
        flex-direction: column;
        gap: 8px;
    }

    .filter-controls input {
        width: 100%;
    }

    .students-grid {
        grid-template-columns: 1fr;
    }

    .student-detail-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .student-actions {
        width: 100%;
        justify-content: space-between;
    }

    .student-detail-grid {
        grid-template-columns: 1fr;
    }
}

/* Bulk Homework Assignment Modal */
.bulk-homework-modal {
    max-width: 900px;
    width: 90vw;
    max-height: 80vh;
}

.bulk-homework-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    min-height: 500px;
}

.student-selection-panel, .homework-assignment-panel {
    display: flex;
    flex-direction: column;
}

.student-selection-panel h4, .homework-assignment-panel h4 {
    margin: 0 0 15px 0;
    color: var(--text-dark);
    border-bottom: 2px solid var(--bg-light);
    padding-bottom: 8px;
}

.student-filter-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.student-filter-controls select {
    padding: 6px 10px;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    font-size: 14px;
}

.bulk-students-list {
    flex: 1;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 15px;
    overflow-y: auto;
    max-height: 400px;
    background: var(--bg-light);
}

.bulk-student-item {
    margin-bottom: 12px;
}

.bulk-student-checkbox {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--white);
    border: 1px solid transparent;
}

.bulk-student-checkbox:hover {
    background: rgba(139, 95, 191, 0.05);
    border-color: var(--primary-purple);
}

.bulk-student-checkbox input[type="checkbox"] {
    margin: 0;
    width: 18px;
    height: 18px;
}

.bulk-student-checkbox .student-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.student-avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-purple), var(--coral-pink));
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.student-details .student-name {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 14px;
}

.student-details .student-meta {
    font-size: 12px;
    color: var(--text-medium);
}

.homework-form {
    flex: 1;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 14px;
}

.form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-purple);
    box-shadow: 0 0 0 3px rgba(139, 95, 191, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.assignment-preview {
    margin-top: 20px;
    padding: 15px;
    background: var(--bg-light);
    border-radius: 8px;
    border: 1px solid var(--border-light);
}

.assignment-preview h5 {
    margin: 0 0 10px 0;
    color: var(--text-dark);
    font-size: 14px;
}

.selected-students-preview .no-selection {
    color: var(--text-medium);
    font-style: italic;
    margin: 0;
    font-size: 14px;
}

.preview-header {
    margin-bottom: 10px;
    color: var(--text-dark);
    font-size: 14px;
}

.preview-students {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.preview-student-tag {
    background: var(--primary-purple);
    color: var(--white);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

/* Responsive Design for Bulk Modal */
@media (max-width: 768px) {
    .bulk-homework-modal {
        width: 95vw;
        max-height: 90vh;
    }

    .bulk-homework-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .student-filter-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .student-filter-controls select {
        margin-bottom: 8px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .bulk-students-list {
        max-height: 250px;
    }
}

.content-area {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    min-height: 500px;
}

/* Year Ahead Layout Styles */
.year-ahead-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 20px;
}

.year-column {
    background: var(--bg-light);
    border-radius: 12px;
    padding: 20px;
    min-height: 600px;
}

.year-column h3 {
    margin: 0 0 20px 0;
    color: var(--text-dark);
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-light);
}

.week-card {
    background: var(--white);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 12px;
    border: 1px solid var(--border-light);
    transition: all 0.2s ease;
}

.week-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-purple);
}

.week-card.has-lesson {
    border-left: 4px solid var(--primary-purple);
    background: linear-gradient(135deg, var(--white) 0%, rgba(139, 95, 191, 0.02) 100%);
}

.week-card.empty {
    background: var(--bg-light);
    border-style: dashed;
    opacity: 0.7;
}

.week-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.week-number {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary-purple);
    background: rgba(139, 95, 191, 0.1);
    padding: 2px 8px;
    border-radius: 12px;
}

.lesson-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
    margin: 0;
}

.lesson-description {
    font-size: 12px;
    color: var(--text-medium);
    margin: 5px 0 0 0;
    line-height: 1.4;
}

.empty-week-text {
    font-size: 12px;
    color: var(--text-medium);
    font-style: italic;
    margin: 0;
}

.lesson-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--border-light);
}

.lesson-type {
    font-size: 10px;
    background: var(--bg-light);
    color: var(--text-medium);
    padding: 2px 6px;
    border-radius: 8px;
    text-transform: uppercase;
    font-weight: 500;
}

.lesson-date {
    font-size: 10px;
    color: var(--text-light);
}

/* Responsive Design for Year Ahead */
@media (max-width: 768px) {
    .year-ahead-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .year-column {
        padding: 15px;
        min-height: auto;
    }

    .week-card {
        padding: 12px;
    }
}

/* Header Logo styles */
.header .logo {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 0 0 auto; /* Don't allow this to grow and take space from user-info */
}

.logo-image {
    height: 120px;
    object-fit: contain;
}

.banner-image {
    height: 80px;
    object-fit: contain;
}

/* Loading Progress Bar */
.loading-progress {
    margin-top: 20px;
}

.loading-bar {
    width: 100%;
    height: 8px;
    background: rgba(139, 95, 191, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 12px;
}

.loading-fill {
    height: 100%;
    background: linear-gradient(135deg, var(--primary-purple), var(--coral-pink));
    border-radius: 10px;
    transition: width 0.8s ease;
    width: 0%;
    box-shadow: 0 2px 8px rgba(139, 95, 191, 0.3);
}

.loading-text {
    text-align: center;
    font-size: 14px;
    color: var(--text-medium);
    font-weight: 500;
}

.loading-dots::after {
    content: '';
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
    100% { content: ''; }
}

/* Icon Animation Styles */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

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

.nav-item-icon {
    animation: pulse 2s infinite;
    transition: all 0.3s ease;
}

.nav-item:hover .nav-item-icon {
    animation: bounce 1s;
}

.card-icon {
    animation: pulse 3s infinite;
    transition: all 0.3s ease;
}

.content-card:hover .card-icon {
    animation: bounce 0.8s;
}

.club-icon {
    animation: pulse 2.5s infinite;
    transition: all 0.3s ease;
}

.club-box:hover .club-icon {
    animation: rotate 0.6s ease;
}

/* Bulk Upload Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.show,
.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal.hidden {
    display: none !important;
}

.modal-content {
    background: var(--white);
    border-radius: 20px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal.show .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: 20px 30px;
    border-bottom: 2px solid var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    color: var(--primary-purple);
    font-weight: 700;
    font-size: 20px;
}

.modal-close {
    font-size: 28px;
    color: var(--text-light);
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: var(--bg-light);
    color: var(--text-dark);
}

.modal-body {
    padding: 30px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-dark);
}

.form-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--bg-light);
    border-radius: 12px;
    font-size: 14px;
    background: var(--white);
    color: var(--text-dark);
    transition: all 0.3s ease;
}

.form-select:focus {
    outline: none;
    border-color: var(--primary-purple);
    box-shadow: 0 0 0 3px rgba(139, 95, 191, 0.1);
}

.file-upload-area {
    border: 2px dashed var(--primary-purple);
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    background: rgba(139, 95, 191, 0.05);
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-upload-area:hover {
    background: rgba(139, 95, 191, 0.1);
    border-color: var(--coral-pink);
}

.file-upload-area.drag-over {
    background: rgba(139, 95, 191, 0.15);
    border-color: var(--coral-pink);
    transform: scale(1.02);
}

.file-upload-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.file-upload-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.file-upload-hint {
    font-size: 14px;
    color: var(--text-medium);
}

.file-list {
    margin-top: 15px;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-light);
    border-radius: 8px;
    margin-bottom: 8px;
}

.file-name {
    font-weight: 500;
    color: var(--text-dark);
    flex-grow: 1;
}

.file-size {
    color: var(--text-medium);
    font-size: 12px;
    margin-left: 10px;
}

.file-remove {
    background: var(--coral-pink);
    color: var(--white);
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
    transition: all 0.3s ease;
}

.file-remove:hover {
    background: #ff4757;
    transform: scale(1.1);
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid var(--bg-light);
}

.upload-progress {
    margin-top: 20px;
    padding: 20px;
    background: var(--bg-light);
    border-radius: 12px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(139, 95, 191, 0.2);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, var(--primary-purple), var(--coral-pink));
    border-radius: 10px;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-medium);
}

.upload-results {
    margin-top: 20px;
    padding: 20px;
    border-radius: 12px;
}

.upload-results.success {
    background: rgba(107, 207, 127, 0.1);
    border: 1px solid var(--grass-green);
}

.upload-results.error {
    background: rgba(255, 107, 157, 0.1);
    border: 1px solid var(--coral-pink);
}

.card-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

.bulk-upload-section {
    background: rgba(139, 95, 191, 0.05);
    border-left: 4px solid var(--primary-purple);
    padding: 20px;
    margin-top: 30px;
    border-radius: 8px;
}

.bulk-upload-section h4 {
    color: var(--primary-purple);
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.bulk-upload-section p {
    color: var(--text-medium);
    font-size: 14px;
    margin-bottom: 15px;
}

/* Subscription Details */
.subscription-details {
    margin-top: 40px;
    margin-bottom: 30px;
}

.subscription-status-card {
    background: var(--white);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border-left: 4px solid var(--grass-green);
}

.subscription-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.subscription-header h3 {
    color: var(--text-dark);
    font-size: 18px;
    font-weight: 600;
}

.subscription-badge-container .subscription-badge {
    margin: 0;
}

.subscription-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-light);
    border-radius: 8px;
}

.detail-label {
    font-weight: 600;
    color: var(--text-medium);
}

.detail-value {
    font-weight: 500;
    color: var(--text-dark);
}

.detail-value.status-active {
    color: var(--grass-green);
    font-weight: 600;
}

.no-subscription,
.subscription-error {
    text-align: center;
    padding: 20px;
    color: var(--text-medium);
}

.loading-subscription {
    text-align: center;
    color: var(--text-medium);
    font-style: italic;
}

/* Subscription Plans Grid */
.subscription-plans-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.plan-card {
    background: var(--white);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    text-align: center;
    transition: all 0.3s ease;
    color: var(--text-dark);
}

.plan-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.plan-header {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(248, 250, 252, 0.95));
}

.pricing-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 120px;
}

.pricing-card.monthly {
    background: linear-gradient(135deg, rgba(139, 95, 191, 0.05), rgba(255, 107, 157, 0.05));
}

.pricing-card.annual {
    background: linear-gradient(135deg, rgba(107, 207, 127, 0.05), rgba(88, 166, 255, 0.05));
    position: relative;
}

.price-display {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.price-amount {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.price-period {
    font-size: 14px;
    color: var(--text-medium);
    font-weight: 500;
}

.savings-badge {
    background: var(--grass-green);
    color: var(--white);
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 10px;
}

.manage-billing-card {
    grid-column: 1 / -1;
    margin-top: 20px;
}

/* Student Portal Styles */
.privacy-badge {
    background: linear-gradient(135deg, var(--grass-green), var(--sky-blue));
    color: var(--white);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.gdpr-consent-banner {
    background: #f8f9ff;
    border: 2px solid var(--primary-purple);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.consent-content {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.consent-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.consent-text {
    flex: 1;
    min-width: 300px;
}

.consent-text h4 {
    font-size: 18px;
    color: var(--text-dark);
    margin: 0 0 8px 0;
    font-weight: 700;
}

.consent-text p {
    font-size: 14px;
    color: var(--text-medium);
    margin: 0;
    line-height: 1.4;
}

.consent-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

/* Removed conflicting .student-stats rule - now uses the combined .student-stats, .homework-stats, .messages-stats rule above */

.stat-item {
    text-align: center;
    padding: 15px;
    background: rgba(139, 95, 191, 0.05);
    border-radius: 12px;
}

.stat-number {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary-purple);
    display: block;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-medium);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.assignment-list {
    max-height: 200px;
    overflow-y: auto;
}

.loading-assignments {
    text-align: center;
    color: var(--text-medium);
    font-style: italic;
    padding: 20px;
}

.assignment-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--bg-light);
}

.assignment-item:last-child {
    border-bottom: none;
}

.assignment-info {
    flex: 1;
}

.assignment-name {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 14px;
    margin-bottom: 4px;
}

.assignment-date {
    font-size: 12px;
    color: var(--text-medium);
}

.assignment-score {
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
}

.assignment-score.completed {
    background: rgba(107, 207, 127, 0.2);
    color: var(--grass-green);
}

.assignment-score.pending {
    background: rgba(255, 217, 61, 0.2);
    color: #D4AC0D;
}

.chart-container {
    padding: 20px;
    text-align: center;
}

.chart-placeholder {
    color: var(--text-medium);
    font-size: 16px;
    padding: 40px;
    background: var(--bg-light);
    border-radius: 12px;
    margin: 10px 0;
}

.parent-access-code {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.access-code {
    padding: 15px;
    background: var(--bg-light);
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    color: var(--text-medium);
    border: 2px dashed var(--primary-purple);
}

.access-code.generated {
    background: linear-gradient(135deg, rgba(139, 95, 191, 0.1), rgba(255, 107, 157, 0.1));
    color: var(--primary-purple);
    border: 2px solid var(--primary-purple);
}

.student-notice {
    background: rgba(88, 166, 255, 0.05);
    border-left: 4px solid var(--sky-blue);
    padding: 15px 20px;
    margin-top: 30px;
    border-radius: 8px;
}

.student-notice p {
    margin: 0;
    font-size: 14px;
    color: var(--text-medium);
    line-height: 1.5;
}

/* User Management Styles */
.stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, var(--primary-purple), var(--coral-pink));
    color: var(--white);
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(139, 95, 191, 0.3);
}

.stat-number {
    display: block;
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 14px;
    font-weight: 500;
    opacity: 0.9;
}

.user-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 20px;
    background: var(--bg-light);
    border: 2px solid transparent;
    border-radius: 25px;
    color: var(--text-medium);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: rgba(139, 95, 191, 0.1);
    border-color: var(--primary-purple);
    color: var(--primary-purple);
}

.filter-btn.active {
    background: var(--primary-purple);
    border-color: var(--primary-purple);
    color: var(--white);
}

.user-card {
    background: var(--white);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.user-card:hover {
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.user-card.pending {
    border-left: 4px solid var(--sunny-yellow);
}

.user-card.approved {
    border-left: 4px solid var(--grass-green);
}

.user-info {
    flex: 1;
}

.user-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 10px;
}

.user-name-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.user-name {
    color: var(--text-dark);
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    line-height: 1.2;
}

.user-email {
    color: var(--text-medium);
    font-size: 14px;
    font-weight: 500;
}

.user-status {
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.user-status.status-pending {
    background: rgba(255, 217, 61, 0.2);
    color: #D4AC0D;
}

.user-status.status-approved {
    background: rgba(107, 207, 127, 0.2);
    color: var(--grass-green);
}

.user-details {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    color: var(--text-medium);
    font-size: 14px;
}

.loading-dot {
    animation: blink 1.5s infinite;
    color: var(--primary-purple);
    font-size: 18px;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.3; }
}

.user-role,
.user-phone,
.user-subscription {
    padding: 2px 8px;
    background: var(--bg-light);
    border-radius: 12px;
    font-size: 12px;
}

.user-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: flex-end;
    min-width: 200px;
}

.role-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.role-selector label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-medium);
}

.role-select {
    padding: 6px 12px;
    border: 2px solid var(--bg-light);
    border-radius: 8px;
    font-size: 14px;
    background: var(--white);
}

.action-buttons {
    display: flex;
    gap: 10px;
}

.btn-approve,
.btn-reject,
.btn-delete {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.btn-approve {
    background: var(--grass-green);
    color: var(--white);
}

.btn-approve:hover {
    background: #0E9F6E;
    transform: translateY(-1px);
}

.btn-reject {
    background: var(--coral-pink);
    color: var(--white);
}

.btn-reject:hover {
    background: #FF4757;
    transform: translateY(-1px);
}

.btn-delete {
    background: var(--text-light);
    color: var(--white);
}

.btn-delete:hover {
    background: #6B7280;
    transform: translateY(-1px);
}

.loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

/* Mobile responsiveness for club selection and dashboard */
@media (max-width: 768px) {
    .club-boxes {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .club-selection-title {
        font-size: 32px;
    }

    .club-box {
        padding: 30px 20px;
    }

    .club-icon {
        font-size: 48px;
    }

    .club-title {
        font-size: 24px;
    }

    .dashboard {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .sidebar {
        position: static;
        order: 2;
    }

    .content-area {
        padding: 20px;
        order: 1;
    }

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

    .modal-body {
        padding: 20px;
    }

    .file-upload-area {
        padding: 30px 15px;
    }

    .file-upload-icon {
        font-size: 36px;
    }
}

/* Upload Result Items */
.upload-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 8px;
    border-radius: 8px;
    background: var(--bg-light);
    border: 1px solid #e2e8f0;
}

.upload-result-item.success {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--success-green);
}

.upload-result-item.error {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--error-red);
}

.upload-result-item .file-name {
    flex: 1;
    font-weight: 500;
    color: var(--text-dark);
    font-size: 14px;
}

.upload-result-item .status-icon {
    font-size: 16px;
}

.upload-result-item .status-message {
    font-size: 13px;
    color: var(--text-medium);
}

.upload-result-item .file-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}

.upload-result-item .file-link:hover {
    text-decoration: underline;
}

/* Success, Warning, Error Messages */
.success-message {
    color: var(--success-green);
    font-weight: 600;
    padding: 12px 16px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 8px;
    border: 1px solid var(--success-green);
}

.warning-message {
    color: #f59e0b;
    font-weight: 600;
    padding: 12px 16px;
    background: rgba(245, 158, 11, 0.1);
    border-radius: 8px;
    border: 1px solid #f59e0b;
}

.error-message {
    color: var(--error-red);
    font-weight: 600;
    padding: 12px 16px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 8px;
    border: 1px solid var(--error-red);
}

/* Approval Banner */
.approval-banner {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    margin: 20px 0;
    background: rgba(255, 155, 71, 0.1);
    border: 2px solid var(--bright-orange);
    border-radius: 12px;
    animation: fadeInDown 0.5s ease-out;
}

.approval-icon {
    font-size: 48px;
    flex-shrink: 0;
}

.approval-text h3 {
    color: var(--bright-orange);
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 8px 0;
}

.approval-text p {
    color: var(--text-medium);
    font-size: 16px;
    margin: 0;
    line-height: 1.5;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Subscription Button Styles */
.subscribe-btn {
    margin-top: 15px;
    width: 100%;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    background: linear-gradient(135deg, var(--primary-purple), var(--coral-pink));
    color: var(--white) !important;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(139, 95, 191, 0.3);
}

.subscribe-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 95, 191, 0.4);
    background: linear-gradient(135deg, var(--coral-pink), var(--primary-purple));
}

.subscribe-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 4px 12px rgba(139, 95, 191, 0.2);
}

.current-plan-badge {
    display: inline-block;
    margin-top: 15px;
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--grass-green), var(--sky-blue));
    color: var(--white);
    font-size: 14px;
    font-weight: 600;
    border-radius: 20px;
    text-align: center;
    width: 100%;
    box-shadow: 0 4px 12px rgba(107, 207, 127, 0.3);
}

.current-plan-badge::before {
    content: '✅ ';
}

/* Plan Card Enhancements */
.plan-card.pricing-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 140px;
}

/* Admin Interface Enhancements */
.user-subscription.has-sub {
    color: var(--grass-green);
    font-weight: 600;
}

.user-subscription.no-sub {
    color: var(--text-light);
}

.purchase-date {
    display: block;
    font-size: 12px;
    color: var(--primary-purple);
    font-weight: 600;
    margin-top: 4px;
}

.subscription-plan-type {
    display: block;
    font-size: 12px;
    color: var(--sky-blue);
    font-weight: 600;
    margin-top: 4px;
}

/* Club Access Control Styles */
.club-box.locked {
    opacity: 0.6;
    cursor: not-allowed;
    background: linear-gradient(135deg, #f5f5f5, #e0e0e0);
    border-color: #ccc;
}

.club-box.locked:hover {
    transform: none;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.locked-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, var(--coral-pink), #FF4D4F);
    color: var(--white);
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(255, 107, 157, 0.3);
}

.plan-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, var(--grass-green), var(--sky-blue));
    color: var(--white);
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(107, 207, 127, 0.3);
}

.plan-badge::before {
    content: '✅ ';
}

/* Topics Grid Styling for Admin Topics Tab */
.topics-grid-section {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.topic-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.topic-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-purple);
}

.topic-card-icon {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 12px;
}

.topic-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: var(--text-dark);
}

.topic-card-subject {
    font-size: 0.9rem;
    color: var(--text-medium);
    margin: 0 0 16px 0;
}

.topic-card-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.topic-card-actions .btn {
    flex: 1;
    padding: 8px 12px;
    font-size: 0.85rem;
}

.topic-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topic-card-meta small {
    color: var(--text-light);
    font-size: 0.75rem;
}

.subject-section h4 {
    color: var(--text-dark);
    margin: 0 0 20px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-purple);
    font-weight: 600;
}

.no-topics {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-medium);
}

.no-topics p {
    font-size: 1.1rem;
    margin: 0;
}

/* ============================================
   YEAR 4 HOMEWORK AREA STYLES
   ============================================ */

.homework-badge {
    background: linear-gradient(135deg, var(--primary-purple), var(--sunny-yellow));
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.homework-overview {
    margin-top: 2rem;
}

.homework-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.homework-item {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--primary-purple);
    transition: all 0.2s ease;
}

.homework-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.homework-item.current {
    border-left-color: var(--electric-blue);
    background: linear-gradient(135deg, #f8f9ff, #fff);
}

.homework-item.upcoming {
    border-left-color: var(--sunny-yellow);
    background: linear-gradient(135deg, #fffdf8, #fff);
}

.homework-item.completed {
    border-left-color: #28a745;
    background: linear-gradient(135deg, #f8fff8, #fff);
    opacity: 0.9;
}

.homework-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.homework-header h4 {
    margin: 0;
    color: var(--text-dark);
    font-size: 1.1rem;
    font-weight: 600;
}

.due-date, .completion-date {
    background: var(--electric-blue);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
}

.homework-item.upcoming .due-date {
    background: var(--sunny-yellow);
    color: var(--text-dark);
}

.homework-item.completed .completion-date {
    background: #28a745;
}

.homework-description {
    color: var(--text-medium);
    margin: 0.5rem 0;
    line-height: 1.5;
}

.homework-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
}

.homework-score {
    background: #28a745;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
    margin-top: 0.5rem;
}

.homework-notice {
    background: linear-gradient(135deg, #f8f9ff, #fff);
    border: 1px solid var(--electric-blue);
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 2rem;
}

.homework-notice p {
    margin: 0.5rem 0;
    color: var(--text-medium);
    line-height: 1.6;
}

.homework-notice p:first-child {
    margin-top: 0;
}

.homework-notice p:last-child {
    margin-bottom: 0;
}

/* Parent Access Code for Year 4 */
.parent-access-year4 .access-code {
    background: var(--sunny-yellow);
    color: var(--text-dark);
    padding: 8px 12px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    text-align: center;
    margin: 8px 0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.parent-access-year4 .access-code.generated {
    background: var(--primary-purple);
    color: white;
}

.parent-access-year4 .access-code:hover {
    transform: scale(1.02);
}

/* Responsive adjustments for homework area */
@media (max-width: 768px) {
    .homework-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .homework-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

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

/* ============================================
   PARENT INVITATION STYLES
   ============================================ */

.invitation-filters {
    display: flex;
    gap: 0.5rem;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.filter-btn {
    background: white;
    border: 2px solid var(--electric-blue);
    color: var(--electric-blue);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    background: var(--electric-blue);
    color: white;
    transform: translateY(-1px);
}

.filter-btn.active {
    background: var(--electric-blue);
    color: white;
}

.invitation-item {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--electric-blue);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.invitation-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.invitation-item.pending {
    border-left-color: var(--sunny-yellow);
}

.invitation-item.accepted {
    border-left-color: #28a745;
}

.invitation-item.expired {
    border-left-color: #dc3545;
    opacity: 0.8;
}

.invitation-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.invitation-info h4 {
    margin: 0 0 0.25rem 0;
    color: var(--text-dark);
    font-size: 1.1rem;
}

.invitation-info p {
    margin: 0;
    color: var(--text-medium);
    font-size: 0.95rem;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.pending {
    background: var(--sunny-yellow);
    color: var(--text-dark);
}

.status-badge.accepted {
    background: #28a745;
    color: white;
}

.status-badge.expired {
    background: #dc3545;
    color: white;
}

.invitation-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

.invitation-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.invitation-meta span {
    font-size: 0.85rem;
    color: var(--text-medium);
    background: var(--bg-light);
    padding: 4px 8px;
    border-radius: 6px;
}

.invitation-actions {
    display: flex;
    gap: 0.5rem;
}

.no-invitations {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 8px;
    border: 2px dashed var(--border-light);
}

.no-invitations-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.no-invitations h3 {
    color: var(--text-dark);
    margin: 0 0 0.5rem 0;
}

.no-invitations p {
    color: var(--text-medium);
    margin: 0;
}

/* Parent Invitation Modal Specific Styles */
#parentInvitationModal .modal-content {
    max-width: 500px;
}

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

#parentInvitationModal label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

#parentInvitationModal input,
#parentInvitationModal textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-light);
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

#parentInvitationModal input:focus,
#parentInvitationModal textarea:focus {
    outline: none;
    border-color: var(--electric-blue);
}

#parentInvitationModal .form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

/* Responsive adjustments for invitations */
@media (max-width: 768px) {
    .invitation-header,
    .invitation-details {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .invitation-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .invitation-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .filter-btn {
        font-size: 0.8rem;
        padding: 6px 12px;
    }
}

/* ============================================
   INVITATION CODE ACCESS STYLES
   ============================================ */

.auth-divider {
    display: flex;
    align-items: center;
    margin: 30px 0;
    position: relative;
}

.auth-divider::before {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-light), transparent);
}

.auth-divider span {
    padding: 0 20px;
    color: var(--text-medium);
    font-size: 0.9rem;
    background: white;
}

.invitation-access {
    background: linear-gradient(135deg, #f8f9ff, #fff);
    border: 2px solid var(--electric-blue);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    text-align: center;
}

.invitation-access h3 {
    color: var(--primary-purple);
    margin: 0 0 1rem 0;
    font-size: 1.3rem;
}

.invitation-access p {
    color: var(--text-medium);
    margin: 0 0 1.5rem 0;
}

.invitation-form {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    justify-content: center;
    align-items: center;
}

.invitation-form input {
    padding: 12px 16px;
    border: 2px solid var(--border-light);
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-align: center;
    font-family: monospace;
    width: 200px;
    transition: border-color 0.2s ease;
}

.invitation-form input:focus {
    outline: none;
    border-color: var(--electric-blue);
    box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.1);
}

.invitation-form input::placeholder {
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    letter-spacing: normal;
    font-weight: normal;
}

.invitation-help {
    color: var(--text-light);
    font-size: 0.9rem;
    margin: 0;
}

/* Parent Dashboard Styles */
.parent-welcome {
    text-align: center;
    margin-bottom: 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, var(--soft-lavender), rgba(78, 205, 196, 0.1));
    border-radius: 12px;
}

.parent-welcome h1 {
    color: var(--primary-purple);
    margin: 0 0 1rem 0;
}

.parent-welcome p {
    color: var(--text-dark);
    font-size: 1.1rem;
    margin: 0;
}

.parent-notice {
    background: var(--bg-light);
    border-left: 4px solid var(--electric-blue);
    padding: 1rem 1.5rem;
    border-radius: 0 8px 8px 0;
    margin-top: 2rem;
}

.parent-notice p {
    margin: 0.5rem 0;
    color: var(--text-medium);
    font-size: 0.95rem;
}

.parent-notice p:first-child {
    margin-top: 0;
    font-weight: 600;
    color: var(--text-dark);
}

.parent-notice p:last-child {
    margin-bottom: 0;
}

.subscription-badge.parent-access {
    background: linear-gradient(135deg, var(--grass-green), var(--sunny-yellow));
    color: var(--text-dark);
}

/* Responsive adjustments for invitation access */
@media (max-width: 768px) {
    .invitation-form {
        flex-direction: column;
        gap: 1rem;
    }

    .invitation-form input {
        width: 100%;
        max-width: 250px;
    }

    .invitation-access {
        padding: 1.5rem;
    }

    .auth-divider {
        margin: 20px 0;
    }
}

/* ============================================
   STUDENT MANAGEMENT STYLES
   ============================================ */

.student-filters {
    display: flex;
    gap: 0.5rem;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.student-item {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--electric-blue);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.student-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.student-item.year4 {
    border-left-color: var(--sunny-yellow);
}

.student-item.year5 {
    border-left-color: var(--primary-purple);
}

.student-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.student-info h4 {
    margin: 0 0 0.25rem 0;
    color: var(--text-dark);
    font-size: 1.1rem;
}

.student-info p {
    margin: 0;
    color: var(--text-medium);
    font-size: 0.9rem;
}

.student-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

.student-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.student-meta span {
    font-size: 0.85rem;
    color: var(--text-medium);
    background: var(--bg-light);
    padding: 4px 8px;
    border-radius: 6px;
}

.student-actions {
    display: flex;
    gap: 0.5rem;
}

.no-students {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 8px;
    border: 2px dashed var(--border-light);
}

.no-students-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.no-students h3 {
    color: var(--text-dark);
    margin: 0 0 0.5rem 0;
}

.no-students p {
    color: var(--text-medium);
    margin: 0;
}

/* Tutor Student Cards */
.students-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.student-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    border-top: 4px solid var(--electric-blue);
}

.student-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.15);
}

.student-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.student-card-header h4 {
    margin: 0;
    color: var(--text-dark);
    font-size: 1.2rem;
}

.year-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.year-badge.year4 {
    background: var(--sunny-yellow);
    color: var(--text-dark);
}

.year-badge.year5 {
    background: var(--primary-purple);
    color: white;
}

.student-card-body {
    color: var(--text-medium);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.student-card-body p {
    margin: 0.5rem 0;
}

.student-card-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Student Selection for Homework */
.student-selection {
    max-height: 300px;
    overflow-y: auto;
    border: 2px solid var(--border-light);
    border-radius: 8px;
    padding: 1rem;
    background: var(--bg-light);
}

.select-all-container {
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
}

.student-checkbox {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    margin: 0.25rem 0;
    background: white;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.student-checkbox:hover {
    background: var(--electric-blue);
    color: white;
}

.student-checkbox input[type="checkbox"] {
    margin-right: 0.75rem;
}

.student-checkbox label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    cursor: pointer;
    margin: 0;
}

.student-name {
    font-weight: 500;
}

.student-year {
    font-size: 0.8rem;
    opacity: 0.8;
}

.no-students-message {
    text-align: center;
    color: var(--text-medium);
    font-style: italic;
    padding: 2rem;
}

/* Tutor Stats */
.tutor-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.tutor-stats .stat-card {
    flex: 1;
}

/* Student Tabs */
.student-tabs {
    display: flex;
    gap: 0.5rem;
    margin: 2rem 0 1rem 0;
    border-bottom: 2px solid var(--border-light);
}

.tab-button {
    background: transparent;
    border: none;
    padding: 1rem 1.5rem;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-medium);
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
}

.tab-button:hover {
    color: var(--text-dark);
    background: var(--bg-light);
}

.tab-button.active {
    color: var(--primary-purple);
    border-bottom-color: var(--primary-purple);
    font-weight: 600;
}

/* Form Row for Homework Assignment */
.form-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1rem;
}

/* Modal Large Size */
.modal-content.large {
    max-width: 700px;
    width: 90vw;
}

/* Responsive adjustments for student management */
@media (max-width: 768px) {
    .student-header,
    .student-details {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

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

    .student-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .students-grid {
        grid-template-columns: 1fr;
    }

    .student-card-actions {
        justify-content: center;
    }

    .tutor-stats {
        flex-direction: column;
    }

    .student-tabs {
        flex-wrap: wrap;
    }

    .tab-button {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

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

    .modal-content.large {
        width: 95vw;
        max-width: none;
    }
}

/* ===== STUDENT HOMEWORK SUBMISSION STYLES ===== */

.homework-item {
    background: var(--white);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border-left: 4px solid var(--primary-purple);
    transition: all 0.2s ease;
}

.homework-item:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.homework-item.overdue {
    border-left-color: #ff4757;
    background: #fff5f5;
}

.homework-item.completed {
    border-left-color: #2ed573;
    background: #f8fff9;
}

.homework-item.upcoming {
    border-left-color: #ffa502;
    background: #fffcf5;
}

.homework-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.homework-title {
    margin: 0;
    color: var(--primary-purple);
    font-size: 1.2rem;
    font-weight: 600;
}

.homework-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
}

.homework-subject {
    background: var(--primary-purple);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.homework-due {
    color: var(--text-medium);
    font-size: 0.9rem;
    font-weight: 500;
}

.overdue-badge {
    background: #ff4757;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.homework-description {
    color: var(--text-dark);
    line-height: 1.6;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--surface-light);
    border-radius: 8px;
}

.homework-submission {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed var(--primary-purple);
}

.homework-submission textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border-light);
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    line-height: 1.5;
    resize: vertical;
    margin-bottom: 1rem;
    transition: border-color 0.2s ease;
}

.homework-submission textarea:focus {
    outline: none;
    border-color: var(--primary-purple);
    box-shadow: 0 0 0 3px rgba(139, 95, 191, 0.1);
}

.homework-submission-view {
    margin-top: 1rem;
    padding: 1rem;
    background: #f0f8ff;
    border-radius: 8px;
    border: 2px solid #2ed573;
}

.submission-content {
    background: white;
    padding: 1rem;
    border-radius: 6px;
    border-left: 4px solid var(--primary-purple);
    margin: 1rem 0;
    font-style: italic;
    color: var(--text-dark);
}

.homework-feedback {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    padding: 1rem;
    margin-top: 1rem;
    color: #856404;
}

.feedback-pending {
    color: var(--text-medium);
    font-style: italic;
    text-align: center;
    padding: 0.5rem;
}

.no-homework {
    text-align: center;
    color: var(--text-medium);
    font-style: italic;
    padding: 2rem;
    background: var(--surface-light);
    border-radius: 8px;
    border: 2px dashed var(--border-light);
}

/* Homework list container */
.homework-list {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.homework-list::-webkit-scrollbar {
    width: 6px;
}

.homework-list::-webkit-scrollbar-track {
    background: var(--surface-light);
    border-radius: 3px;
}

.homework-list::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 3px;
}

.homework-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-medium);
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .homework-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .homework-meta {
        align-items: flex-start;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .homework-item {
        padding: 1rem;
    }

    .homework-submission textarea {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

/* ==================== MESSAGING SYSTEM STYLES ==================== */

.messaging-container {
    display: flex;
    height: 600px;
    background: var(--white);
    border-radius: 15px;
    box-shadow: 0 8px 32px var(--shadow);
    overflow: hidden;
}

.conversations-panel {
    width: 300px;
    border-right: 1px solid var(--border-light);
    background: var(--surface-light);
    display: flex;
    flex-direction: column;
}

.conversations-panel h3 {
    padding: 20px;
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
    border-bottom: 1px solid var(--border-light);
    background: var(--white);
}

.conversations-list {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.conversations-list::-webkit-scrollbar {
    width: 6px;
}

.conversations-list::-webkit-scrollbar-track {
    background: var(--surface-light);
}

.conversations-list::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 3px;
}

.conversation-item {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--white);
}

.conversation-item:hover {
    background: var(--surface-light);
}

.conversation-item.active {
    background: var(--primary-purple);
    color: var(--white);
}

.conversation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.participant-name {
    font-weight: 600;
    font-size: 14px;
}

.unread-badge {
    background: var(--accent-coral);
    color: var(--white);
    border-radius: 10px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 600;
    min-width: 18px;
    text-align: center;
}

.conversation-item.active .unread-badge {
    background: var(--white);
    color: var(--primary-purple);
}

.student-name {
    font-size: 12px;
    color: var(--text-medium);
    margin-bottom: 6px;
}

.conversation-item.active .student-name {
    color: rgba(255, 255, 255, 0.8);
}

.last-message {
    font-size: 12px;
    color: var(--text-medium);
    line-height: 1.3;
    margin-bottom: 4px;
}

.conversation-item.active .last-message {
    color: rgba(255, 255, 255, 0.9);
}

.timestamp {
    font-size: 11px;
    color: var(--text-light);
}

.conversation-item.active .timestamp {
    color: rgba(255, 255, 255, 0.7);
}

.empty-conversations {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: var(--text-medium);
}

.empty-conversations .empty-icon {
    font-size: 48px;
    margin-bottom: 10px;
    opacity: 0.5;
}

.messages-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--white);
}

.no-conversation-selected {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-state {
    text-align: center;
    color: var(--text-medium);
}

.empty-state .empty-icon {
    font-size: 64px;
    margin-bottom: 15px;
    opacity: 0.3;
}

.empty-state h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: var(--text-dark);
}

.empty-state p {
    margin: 0;
    font-size: 14px;
}

.messages-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-light);
    background: var(--surface-light);
}

.conversation-info h4 {
    margin: 0 0 5px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
}

.conversation-info p {
    margin: 0;
    font-size: 12px;
    color: var(--text-medium);
}

.messages-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.messages-content::-webkit-scrollbar {
    width: 6px;
}

.messages-content::-webkit-scrollbar-track {
    background: var(--surface-light);
}

.messages-content::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 3px;
}

.message {
    display: flex;
    max-width: 80%;
}

.message.sent {
    align-self: flex-end;
    justify-content: flex-end;
}

.message.received {
    align-self: flex-start;
    justify-content: flex-start;
}

.message-content {
    background: var(--surface-light);
    border-radius: 15px;
    padding: 12px 16px;
    position: relative;
}

.message.sent .message-content {
    background: var(--primary-purple);
    color: var(--white);
}

.message-text {
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 8px;
    word-wrap: break-word;
}

.message-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    opacity: 0.7;
}

.message-type {
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 10px;
    text-transform: capitalize;
}

.message.sent .message-type {
    background: rgba(255, 255, 255, 0.2);
}

.message-time {
    white-space: nowrap;
}

.message-compose {
    border-top: 1px solid var(--border-light);
    padding: 20px;
    background: var(--surface-light);
}

.compose-area {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.compose-area textarea {
    flex: 1;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.4;
    resize: none;
    background: var(--white);
    transition: border-color 0.2s ease;
}

.compose-area textarea:focus {
    outline: none;
    border-color: var(--primary-purple);
    box-shadow: 0 0 0 3px rgba(139, 95, 191, 0.1);
}

.compose-area .btn {
    padding: 12px 20px;
    border-radius: 12px;
    white-space: nowrap;
}

/* New Message Modal Styles */
.parent-access-link .btn {
    text-decoration: none;
    color: var(--primary-purple);
    font-weight: 500;
    padding: 8px 0;
    border: none;
    background: none;
    transition: color 0.2s ease;
}

.parent-access-link .btn:hover {
    color: var(--accent-coral);
    text-decoration: none;
}

.help-text {
    font-size: 12px;
    color: var(--text-medium);
    margin: 5px 0 0 0;
    text-align: center;
}

.parent-access-description {
    color: var(--text-medium);
    margin-bottom: 30px;
    text-align: center;
    font-size: 16px;
    line-height: 1.5;
}

.parent-invitation-form {
    max-width: 400px;
    margin: 0 auto;
}

.parent-invitation-form .form-group {
    margin-bottom: 20px;
}

.parent-invitation-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-dark);
}

.parent-invitation-form .form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.parent-invitation-form .form-input:focus {
    outline: none;
    border-color: var(--primary-purple);
    box-shadow: 0 0 0 3px rgba(139, 95, 191, 0.1);
}

.parent-invitation-form .btn-primary {
    width: 100%;
    padding: 14px;
    margin: 20px 0;
    font-size: 16px;
    font-weight: 600;
}

.parent-help {
    background: var(--surface-light);
    border-radius: 12px;
    padding: 20px;
    margin-top: 30px;
}

.parent-help h4 {
    margin: 0 0 15px 0;
    color: var(--text-dark);
    font-size: 16px;
}

.parent-help p {
    margin: 8px 0;
    font-size: 14px;
    color: var(--text-medium);
    line-height: 1.4;
}

.back-to-login {
    text-align: left;
    margin-bottom: 20px;
}

.back-to-login .btn {
    color: var(--text-medium);
    background: none;
    border: none;
    padding: 8px 0;
    font-size: 14px;
    text-decoration: none;
    transition: color 0.2s ease;
}

.back-to-login .btn:hover {
    color: var(--primary-purple);
}

/* Mobile responsive messaging */
@media (max-width: 768px) {
    .messaging-container {
        flex-direction: column;
        height: auto;
        min-height: 500px;
    }

    .conversations-panel {
        width: 100%;
        max-height: 200px;
    }

    .messages-panel {
        min-height: 300px;
    }

    .message {
        max-width: 90%;
    }

    .compose-area {
        flex-direction: column;
        gap: 10px;
    }

    .compose-area .btn {
        width: 100%;
    }
}

/* ==================== SUBSCRIPTION RECOMMENDED STYLING ==================== */

.plan-card.recommended {
    position: relative;
    transform: scale(1.05);
    box-shadow: 0 12px 40px rgba(139, 95, 191, 0.2);
    border: 2px solid var(--primary-purple) !important;
    z-index: 10;
}

.recommended-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--primary-purple), var(--coral-pink));
    color: var(--white) !important;
    font-size: 12px;
    font-weight: bold;
    padding: 6px 16px;
    border-radius: 20px;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(139, 95, 191, 0.3);
    z-index: 10;
}

.subscribe-btn.recommended-btn,
.btn.subscribe-btn.recommended-btn,
.plan-card .subscribe-btn.recommended-btn {
    background: linear-gradient(135deg, var(--primary-purple), var(--coral-pink)) !important;
    border: none !important;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 6px 20px rgba(139, 95, 191, 0.3);
    transition: all 0.3s ease;
    color: var(--white) !important;
}

.subscribe-btn.recommended-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 95, 191, 0.4);
}

.plan-card.recommended .price-amount {
    color: var(--primary-purple);
    font-weight: 700;
}

.plan-card.recommended .savings-badge {
    background: var(--primary-purple);
    color: white;
}

/* Mobile responsive adjustments for recommended styling */
@media (max-width: 768px) {
    .plan-card.recommended {
        transform: none;
        margin: 10px 0;
    }
}