/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4f46e5;
    --primary-dark: #4338ca;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --hover-bg: #f1f5f9;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

html {
    font-size: 90%; /* Scale down to make UI more compact at 100% zoom */
}

html, body {
    height: 100%;
    overflow-x: hidden; /* Prevent horizontal scroll */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Navigation Bar */
.navbar {
    background-color: var(--card-bg);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h2 {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.logo-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: block;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
}

.nav-link:hover {
    color: var(--primary-color);
    background-color: var(--hover-bg);
}

/* Profile Dropdown Styles */
.profile-container {
    position: relative;
}

.profile-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, #5a67d8 100%);
    color: white;
    border: none;
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.2);
}

.profile-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(99, 102, 241, 0.3);
    background: linear-gradient(135deg, #5a67d8 0%, #4c51bf 100%);
}

.profile-btn.authenticated {
    background: white;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.profile-btn.authenticated:hover {
    background: var(--hover-bg);
    border-color: var(--primary-color);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
    min-width: 280px;
    z-index: 1001;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    pointer-events: none;
}

.profile-dropdown.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.profile-dropdown-header {
    padding: 1rem;
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.profile-avatar {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #5a67d8 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

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

.profile-email {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-status {
    font-size: 0.75rem;
    color: #10b981;
    font-weight: 500;
}

.profile-dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0;
}

.profile-dropdown-item {
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.9375rem;
    font-weight: 500;
    border-radius: 0 0 0.75rem 0.75rem;
}

.profile-dropdown-item:hover {
    background: #fef2f2;
    color: #dc2626;
}

.profile-dropdown-item svg {
    color: currentColor;
    flex-shrink: 0;
}

/* Main Content */
.main-content {
    max-width: 1200px;
    margin: 1.25rem auto;
    padding: 0 1.25rem;
}

/* Prevent body scroll when flashcard page is active */
body.flashcard-active {
    overflow: hidden;
}

/* Ensure body can scroll when help page is active */
body.help-page-active {
    overflow-y: auto !important;
    height: auto !important;
}

/* Flashcards Page Container */
.flashcards-page-container {
    position: fixed;
    top: 0;
    left: 260px; /* Account for sidebar width */
    right: 0;
    bottom: 0;
    height: 100vh;
    width: calc(100vw - 260px);
    overflow: hidden; /* Prevent page scroll */
    display: flex;
    flex-direction: column;
    background-color: var(--bg-color);
    transition: left 0.3s ease, width 0.3s ease;
    z-index: 999; /* Below sidebar but above other content */
}

/* Adjust flashcard container when sidebar is collapsed */
.sidebar.collapsed ~ .app-content .flashcards-page-container,
.flashcards-page-container.sidebar-collapsed {
    left: 70px;
    width: calc(100vw - 70px);
}

.flashcards-page-container .back-to-home-btn {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 1001;
}

/* Quiz Generator Section */
.quiz-generator-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 1rem;
    padding: 2.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-lg);
}

.generator-container {
    max-width: 900px;
    margin: 0 auto;
}

.generator-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.generator-header h2 {
    color: white;
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.generator-header p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
}

.generator-input-wrapper {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.quiz-prompt-input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 0.75rem;
    font-size: 1rem;
    background-color: white;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.quiz-prompt-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

.generate-quiz-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background-color: white;
    color: #667eea;
    border: none;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
    white-space: nowrap;
}

.generate-quiz-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

.generate-quiz-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.generation-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 0.75rem;
    color: white;
    font-weight: 500;
}

.status-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Content Tabs Section */
.content-tabs-section {
    margin: 2rem 0 1.5rem 0;
}

.content-tabs-wrapper {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
}

.content-tab-btn {
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border: 2px solid var(--border-color);
    background-color: var(--card-bg);
    color: var(--text-secondary);
    border-radius: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.content-tab-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.content-tab-btn.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

/* Topic Quiz Section */
.topic-quiz-section {
    background-color: var(--card-bg);
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
    border: 2px solid var(--border-color);
}

.topics-header {
    text-align: center;
    margin-bottom: 2rem;
}

.topics-header h2 {
    font-size: 1.75rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.topics-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

/* Year Filter */
.year-filter-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: var(--bg-primary);
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
}

.year-filter-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
}

.year-filter-label svg {
    color: var(--primary-color);
}

.year-filter-dropdown {
    position: relative;
    min-width: 180px;
}

.year-filter-button {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    background-color: var(--card-bg);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.year-filter-button:hover {
    border-color: var(--primary-color);
}

.year-filter-button svg {
    stroke: var(--text-secondary);
    transition: transform 0.2s ease;
}

.year-filter-button.open svg {
    transform: rotate(180deg);
}

.year-filter-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background-color: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    overflow: hidden;
}

.year-filter-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 0.875rem;
    user-select: none;
}

.year-filter-option:hover {
    background-color: rgba(79, 70, 229, 0.05);
}

.year-filter-option input[type="checkbox"] {
    display: none;
}

.year-checkbox-custom {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.year-filter-option input[type="checkbox"]:checked + .year-checkbox-custom {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.year-filter-option input[type="checkbox"]:checked + .year-checkbox-custom::after {
    content: '';
    width: 10px;
    height: 10px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.topics-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 3rem;
    color: var(--text-secondary);
}

.topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.25rem;
}

.topic-card {
    background-color: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.topic-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.topic-card-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.topic-card-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.topic-card-questions {
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.topic-card-questions svg {
    width: 16px;
    height: 16px;
}

.topic-card-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background-color: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Topic Checkbox */
.topic-checkbox-container {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 10;
}

.topic-checkbox {
    appearance: none;
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-color);
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: white;
    position: relative;
}

.topic-checkbox:hover {
    border-color: var(--primary-color);
}

.topic-checkbox:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-checkmark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.topic-checkbox:checked ~ .checkbox-checkmark {
    opacity: 1;
}

.topic-card.selected {
    border-color: var(--primary-color);
    background-color: rgba(79, 70, 229, 0.05);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Select All Container */
.select-all-container {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 1.5rem;
    padding: 0 0.5rem;
}

.select-all-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background-color: white;
    border: 2px solid var(--border-color);
    border-radius: 0.75rem;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.select-all-btn:hover {
    border-color: var(--primary-color);
    background-color: rgba(79, 70, 229, 0.05);
}

.select-all-btn svg {
    width: 18px;
    height: 18px;
    stroke: var(--primary-color);
}

/* Start Button Container */
.start-button-container {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, white 0%, white 80%, transparent 100%);
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    z-index: 100;
    margin-top: 2rem;
}

.selected-topics-info {
    text-align: center;
}

.selected-count {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.start-quiz-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 3rem;
    background: linear-gradient(135deg, var(--primary-color), #6366f1);
    border: none;
    border-radius: 0.75rem;
    color: white;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.start-quiz-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.4);
}

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

.start-quiz-btn svg {
    width: 20px;
    height: 20px;
}

/* Back to Home Button */
.back-to-home-btn {
    display: none; /* Hide back buttons */
}

/* Watch Out Section - Memory Aid */
.watch-out-section {
    background-color: var(--card-bg);
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
    border: 2px solid #fee2e2;
}

.watch-out-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.watch-out-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.watch-out-title h3 {
    color: #dc2626;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.watch-out-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 0.5rem 0 0 0;
    flex-basis: 100%;
}

.clear-watchout-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.clear-watchout-btn:hover {
    background-color: #fecaca;
    transform: translateY(-1px);
}

/* Flashcards Container */
.flashcards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

/* Flashcard */
.flashcard {
    perspective: 1000px;
    height: 250px;
    cursor: pointer;
}

.flashcard-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flashcard.flipped .flashcard-inner {
    transform: rotateY(180deg);
}

.flashcard-front,
.flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.flashcard-front {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 2px solid #fbbf24;
}

.flashcard-back {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border: 2px solid #3b82f6;
    transform: rotateY(180deg);
}

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

.flashcard-number {
    background-color: rgba(0, 0, 0, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
}

.flashcard-remove {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    color: #dc2626;
    transition: var(--transition);
}

.flashcard-remove:hover {
    transform: scale(1.2);
}

.flashcard-content {
    flex: 1;
    overflow-y: auto;
}

.flashcard-question {
    font-size: 1rem;
    font-weight: 600;
    color: #78350f;
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.flashcard-options {
    font-size: 0.875rem;
    color: #92400e;
    margin-top: 0.75rem;
}

.flashcard-option {
    margin: 0.25rem 0;
    padding: 0.25rem;
}

.flashcard-option.wrong {
    background-color: rgba(239, 68, 68, 0.2);
    border-radius: 0.25rem;
    padding: 0.25rem 0.5rem;
}

.flashcard-option.correct {
    background-color: rgba(16, 185, 129, 0.2);
    border-radius: 0.25rem;
    padding: 0.25rem 0.5rem;
}

.flashcard-explanation {
    font-size: 0.95rem;
    color: #1e40af;
    line-height: 1.6;
}

.flashcard-hint {
    font-size: 0.875rem;
    color: #1e3a8a;
    margin-top: 1rem;
    padding: 0.75rem;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 0.5rem;
    border-left: 3px solid #3b82f6;
}

.flashcard-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.flashcard-flip-hint {
    font-size: 0.75rem;
    color: rgba(0, 0, 0, 0.5);
    font-weight: 500;
}

/* ===== New Flashcard Viewer Styles ===== */
.flashcard-viewer {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 1rem 1rem 1rem; /* Top padding to account for back button */
    width: 100%;
    height: 100%;
    overflow: hidden;
    min-height: 0; /* Allow flex shrinking */
}

/* Ensure content is centered properly within flashcard viewer */
.flashcard-viewer > * {
    margin-left: auto;
    margin-right: auto;
}

.flashcard-empty-state {
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 3rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.flashcard-auth-required {
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 3rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.flashcard-single {
    perspective: 1000px;
    width: 100%;
    max-width: 900px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.flashcard-card {
    position: relative;
    width: 100%;
    height: 500px; /* Increased height */
    max-width: 800px;
    margin: 0 auto;
}

/* Flip Button Inside Card */
.flashcard-flip-btn-inside {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, #5a67d8 100%);
    color: white;
    border: none;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.3);
}

.flashcard-flip-btn-inside:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
}

.flashcard-flip-btn-inside:active {
    transform: translateY(-1px) scale(1.02);
}

.flashcard-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flashcard-card-inner.flipped {
    transform: rotateY(180deg);
}

.flashcard-card-front,
.flashcard-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    background: var(--card-bg);
    border-radius: 1rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.flashcard-card-front {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 3px solid #f59e0b;
}

.flashcard-card-back {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border: 3px solid #3b82f6;
    transform: rotateY(180deg);
}

.flashcard-card-content {
    flex: 1;
    padding: 4rem 2rem 1rem 2rem; /* Extra padding top for flip button */
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    max-height: calc(100% - 80px); /* Ensure scrollable area */
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
    /* Force hardware acceleration for smooth scrolling */
    -webkit-overflow-scrolling: touch;
    transform: translateZ(0);
}

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

.flashcard-card-content::-webkit-scrollbar-track {
    background: transparent;
}

.flashcard-card-content::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.flashcard-card-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* Ensure all content inside is scrollable */
.flashcard-card-content > * {
    flex-shrink: 0;
}

.flashcard-badge {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 0.375rem;
    font-weight: 700;
    font-size: 0.8125rem;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.flashcard-q-text {
    font-size: 1.125rem;
    font-weight: 600;
    color: #92400e;
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.flashcard-prompt {
    font-size: 0.875rem;
    color: #b45309;
    margin: 0.75rem 0;
    padding: 0.625rem;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 0.375rem;
}

.flashcard-options-list {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.flashcard-option-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 0.5rem;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    cursor: pointer;
}

.flashcard-option-item:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.flashcard-option-item.selected {
    background: #e0e7ff;
    border-color: var(--primary-color);
}

.flashcard-option-item.user-wrong {
    background: #fee2e2;
    border-color: #ef4444;
    cursor: default;
}

.flashcard-option-item.user-wrong:hover {
    transform: none;
}

.flashcard-option-item.correct-ans {
    background: #d1fae5;
    border-color: #10b981;
    cursor: default;
}

.flashcard-option-item.correct-ans:hover {
    transform: none;
}

.option-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.875rem;
    flex-shrink: 0;
    margin-right: 1rem;
}

.option-text {
    flex: 1;
    font-size: 0.9375rem;
    color: var(--text-primary);
    line-height: 1.5;
}

.option-icon {
    font-size: 1.125rem;
    flex-shrink: 0;
}

.flashcard-answer-section {
    color: #1e40af;
}

.flashcard-answer-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1e40af;
    margin-bottom: 1rem;
}

.flashcard-explanation-text {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: #1e3a8a;
    margin-bottom: 1rem;
    padding: 0.875rem;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 0.5rem;
}

.flashcard-hint-text {
    font-size: 0.875rem;
    line-height: 1.5;
    color: #0369a1;
    padding: 0.875rem;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 0.5rem;
    border-left: 4px solid #0ea5e9;
}

/* Flashcard Actions */
.flashcard-actions {
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.flashcard-check-btn {
    padding: 0.75rem 2rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, #5a67d8 100%);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.flashcard-check-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.flashcard-success-msg {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    color: #10b981;
    font-size: 1.125rem;
    font-weight: 600;
}

.flashcard-remove-btn {
    padding: 0.625rem 1.5rem;
    background: #10b981;
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.flashcard-remove-btn:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
}

.flashcard-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 2rem;
    color: var(--primary-color);
}

/* Navigation Inside Card */
.flashcard-navigation-inside {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem 2rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    margin-top: auto; /* Push to bottom */
}

.flashcard-nav-btn-inside {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: rgba(255, 255, 255, 0.95);
    color: #92400e;
    border: 2px solid #fbbf24;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 120px;
    justify-content: center;
}

.flashcard-nav-btn-inside:hover:not(:disabled) {
    background: #fbbf24;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3);
}

.flashcard-nav-btn-inside:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.flashcard-nav-btn-inside svg {
    flex-shrink: 0;
}

.flashcard-card-back .flashcard-navigation-inside .flashcard-nav-btn-inside {
    background: rgba(255, 255, 255, 0.95);
    color: #1e40af;
    border-color: #3b82f6;
}

.flashcard-card-back .flashcard-navigation-inside .flashcard-nav-btn-inside:hover:not(:disabled) {
    background: #3b82f6;
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.question-container {
    background-color: var(--card-bg);
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
    overflow: hidden;
    max-width: 900px;
    margin: 0 auto;
}

/* Question Header */
.question-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 1.5rem 2rem;
}

.exam-info {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
}

.exam-badge,
.subject-badge {
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 600;
    background-color: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.organizing-info {
    font-size: 0.875rem;
    opacity: 0.9;
}

/* Section Header */
.section-header {
    background-color: var(--hover-bg);
    padding: 1.25rem 2rem;
    border-bottom: 2px solid var(--border-color);
}

.section-header h3 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.section-info {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Question Card */
.question-card {
    padding: 2rem;
}

/* Tab Navigation */
.tab-navigation {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    margin-bottom: -2px;
}

.tab-btn:hover {
    color: var(--primary-color);
    background-color: rgba(79, 70, 229, 0.05);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* Tab Content */
.tab-content {
    animation: fadeIn 0.3s ease;
}

/* Concept Tab Specific Styles */
.concept-loading {
    background-color: var(--hover-bg);
    border: 2px dashed var(--border-color);
    border-radius: 0.75rem;
    padding: 3rem 2rem;
    text-align: center;
    margin-bottom: 2rem;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem;
}

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

.concept-loading p {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.loading-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem !important;
    font-weight: 400 !important;
}

/* Concept Explanation Styles */
.concept-explanation {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 2rem;
    margin-bottom: 2rem;
    animation: fadeIn 0.5s ease;
}

.concept-explanation h3 {
    color: var(--primary-color);
    font-size: 1.3rem;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.concept-explanation h3:first-child {
    margin-top: 0;
}

.concept-explanation p {
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.8;
    margin-bottom: 1rem;
}

.concept-explanation ul {
    list-style: none;
    padding-left: 0;
    margin: 1rem 0;
}

.concept-explanation li {
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 0.75rem;
    padding-left: 2rem;
    position: relative;
}

.concept-explanation li::before {
    content: "→";
    color: var(--primary-color);
    font-weight: 700;
    position: absolute;
    left: 0.5rem;
}

.concept-explanation strong {
    color: var(--primary-color);
    font-weight: 600;
}

.concept-explanation em {
    color: var(--text-secondary);
    font-style: italic;
}

/* Concept Images Grid */
.concept-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.concept-image-card {
    background-color: var(--hover-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1rem;
    transition: var(--transition);
}

.concept-image-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.concept-image {
    width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
    display: block;
}

.image-caption {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    margin: 0;
}

@media (max-width: 768px) {
    .concept-images-grid {
        grid-template-columns: 1fr;
    }
}

.question-number {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.question-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.q-label {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.marks-badge {
    background-color: var(--success-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Reset Button */
.reset-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 2px solid var(--border-color);
    background-color: var(--card-bg);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
    padding: 0;
}

.reset-btn:hover {
    border-color: var(--primary-color);
    background-color: rgba(79, 70, 229, 0.05);
    color: var(--primary-color);
    transform: rotate(-45deg);
}

.reset-btn:active {
    transform: rotate(-45deg) scale(0.95);
}

.reset-btn:focus {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* Question Content */
.question-content {
    margin-bottom: 2rem;
}

.question-text {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.question-prompt {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-top: 1rem;
}

.arrow-symbol {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.25rem;
}

.word-series {
    font-weight: 600;
    color: var(--primary-color);
    background-color: rgba(79, 70, 229, 0.1);
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
}

.blank {
    display: inline-block;
    border-bottom: 2px solid var(--primary-color);
    min-width: 80px;
    text-align: center;
}

/* Options Container */
.options-container {
    display: grid;
    gap: 1rem;
    margin-bottom: 2rem;
}

.option {
    background-color: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.25rem 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.option:hover {
    border-color: var(--primary-color);
    background-color: rgba(79, 70, 229, 0.02);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.option input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.option label {
    display: flex;
    align-items: center;
    cursor: pointer;
    width: 100%;
}

/* Removed duplicate .option-label styling - using the blue circle style from line 1213 */

.option-text {
    font-size: 1.05rem;
    color: var(--text-primary);
}

.option input[type="radio"]:checked + label {
    color: var(--primary-color);
}

.option input[type="radio"]:checked + label .option-label,
.option input[type="radio"]:checked + label .option-text {
    color: var(--primary-color);
}

.option:has(input[type="radio"]:checked) {
    border-color: var(--primary-color);
    background-color: rgba(79, 70, 229, 0.05);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Correct Answer Highlighting */
.option.correct-answer {
    border-color: var(--success-color) !important;
    background-color: rgba(16, 185, 129, 0.08) !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15) !important;
}

.option.correct-answer .option-label,
.option.correct-answer .option-text {
    color: var(--success-color) !important;
    font-weight: 600;
}

.option.correct-answer:hover {
    transform: none;
}

/* Action Buttons */
.question-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    flex: 1;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-secondary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--text-secondary);
    background-color: var(--hover-bg);
}

.btn-ai {
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    color: white;
    flex: 1;
}

.btn-ai:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.ai-icon {
    width: 18px;
    height: 18px;
}

/* Question Navigation */
.question-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background-color: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
}

.nav-btn:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background-color: rgba(79, 70, 229, 0.05);
}

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

.question-counter {
    font-weight: 600;
    color: var(--text-secondary);
}

/* Feedback Container */
.feedback-container {
    margin: 1.5rem 0 2rem 0;
    padding: 1.25rem 1.5rem;
    border-radius: 0.75rem;
    animation: slideDown 0.3s ease;
}

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

.feedback-container.correct {
    background-color: rgba(16, 185, 129, 0.1);
    border: 2px solid var(--success-color);
}

.feedback-container.incorrect {
    background-color: rgba(239, 68, 68, 0.1);
    border: 2px solid var(--error-color);
}

.feedback-content {
    display: flex;
    align-items: start;
    gap: 1rem;
}

.feedback-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    flex-shrink: 0;
}

.feedback-container.correct .feedback-icon {
    background-color: var(--success-color);
}

.feedback-container.incorrect .feedback-icon {
    background-color: var(--error-color);
}

.feedback-icon::after {
    content: '✓';
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
}

.feedback-container.incorrect .feedback-icon::after {
    content: '✗';
}

.feedback-title {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.feedback-container.correct .feedback-title {
    color: var(--success-color);
}

.feedback-container.incorrect .feedback-title {
    color: var(--error-color);
}

.feedback-message {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .nav-links {
        gap: 1rem;
        width: 100%;
        justify-content: space-around;
    }

    .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }

    .main-content {
        margin: 1rem auto;
        padding: 0 1rem;
    }

    .question-header {
        padding: 1rem 1.25rem;
    }

    .section-header {
        padding: 1rem 1.25rem;
    }

    .question-card {
        padding: 1.5rem 1.25rem;
    }

    .question-text {
        font-size: 1rem;
    }

    .option {
        padding: 1rem 1.25rem;
    }

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

    .btn {
        width: 100%;
    }

    .question-navigation {
        gap: 1rem;
    }

    .nav-btn {
        flex: 1;
        justify-content: center;
    }

    .feedback-container {
        margin: 1.5rem 0 2rem 0;
    }
}

@media (max-width: 480px) {
    .logo h2 {
        font-size: 1.25rem;
    }

    .logo-subtitle {
        font-size: 0.75rem;
    }

    .exam-info {
        flex-direction: column;
        gap: 0.5rem;
    }

    .question-text {
        font-size: 0.95rem;
    }

    .option-text {
        font-size: 0.95rem;
    }
}

/* Smooth Transitions */
.question-card,
.option,
.btn,
.nav-btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Focus States for Accessibility */
.option:focus-within {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

.btn:focus,
.nav-btn:focus {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* AI Chat Section */
.ai-chat-section {
    margin-top: 2rem;
}

/* Chat History Box */
.chat-history-box {
    background-color: var(--hover-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 1rem;
    max-height: 400px;
    overflow-y: auto;
    animation: slideDown 0.3s ease;
}

.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Chat Message Styles */
.chat-message {
    display: flex;
    gap: 0.75rem;
    animation: fadeIn 0.3s ease;
}

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

.chat-message.user {
    flex-direction: row-reverse;
}

.chat-message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-message.user .chat-message-avatar {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
}

.chat-message.ai .chat-message-avatar {
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
}

.chat-message-avatar svg {
    width: 24px;
    height: 24px;
}

.chat-message-content {
    flex: 1;
    background-color: var(--card-bg);
    padding: 0.875rem 1rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-sm);
    max-width: 80%;
}

.chat-message.user .chat-message-content {
    background-color: var(--primary-color);
    color: white;
}

.chat-message.ai .chat-message-content {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
}

.chat-message-text {
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
}

.chat-message-time {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 0.25rem;
}

/* AI typing indicator */
.typing-indicator {
    display: flex;
    gap: 0.25rem;
    padding: 0.5rem;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--text-secondary);
    animation: typing 1.4s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Chat Input Container */
.chat-input-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    background-color: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    transition: var(--transition);
}

.chat-input-container:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.ai-avatar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-avatar svg {
    filter: drop-shadow(0 2px 4px rgba(139, 92, 246, 0.2));
}

.chat-input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chat-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 0.95rem;
    color: var(--text-primary);
    outline: none;
    padding: 0.5rem 0;
}

.chat-input::placeholder {
    color: var(--text-secondary);
}

.send-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 0.5rem;
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    color: white;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

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

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.send-btn svg {
    width: 20px;
    height: 20px;
}

/* Scrollbar Styling for Chat */
.chat-history-box::-webkit-scrollbar {
    width: 8px;
}

.chat-history-box::-webkit-scrollbar-track {
    background-color: var(--hover-bg);
    border-radius: 4px;
}

.chat-history-box::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 4px;
}

.chat-history-box::-webkit-scrollbar-thumb:hover {
    background-color: var(--text-secondary);
}

/* Responsive for Chat */
@media (max-width: 768px) {
    .chat-history-box {
        max-height: 300px;
    }

    .chat-message-content {
        max-width: 85%;
    }

    .ai-avatar svg {
        width: 32px;
        height: 32px;
    }

    .chat-input {
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .chat-input-container {
        padding: 0.5rem 0.75rem;
        gap: 0.75rem;
    }

    .ai-avatar svg {
        width: 28px;
        height: 28px;
    }

    .send-btn {
        width: 36px;
        height: 36px;
    }

    .chat-message-content {
        max-width: 90%;
        padding: 0.75rem 0.875rem;
    }

    .chat-message-avatar {
        width: 32px;
        height: 32px;
    }
}

/* ===== Authentication Modal Styles ===== */
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-modal {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid #e5e7eb;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h2 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
}

.auth-header p {
    margin: 0;
    color: #6b7280;
    font-size: 0.875rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 500;
    color: #374151;
    font-size: 0.875rem;
}

.form-group input {
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.2s;
    background: #f9fafb;
}

.form-group input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background: white;
}

.auth-button {
    width: 100%;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    border-radius: 0.75rem;
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 1rem;
}

.auth-button:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.auth-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.auth-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    display: none;
}

.magic-link-sent {
    text-align: center;
    padding: 1.5rem 0;
}

.magic-link-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.magic-link-sent h3 {
    margin: 0 0 1rem 0;
    color: #1f2937;
    font-size: 1.25rem;
}

.magic-link-sent p {
    margin: 0.5rem 0;
    color: #6b7280;
    font-size: 0.875rem;
    line-height: 1.5;
}

.magic-link-sent strong {
    color: #1f2937;
}

/* Auth divider */
.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e5e7eb;
}

.auth-divider span {
    padding: 0 1rem;
    color: #9ca3af;
    font-size: 0.875rem;
}

/* Google Auth Button */
.google-auth-btn {
    width: 100%;
    padding: 0.75rem 1rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.google-auth-btn:hover {
    border-color: #d1d5db;
    background: #f9fafb;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.google-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Responsive adjustments for auth modal */
@media (max-width: 768px) {
    .auth-modal {
        margin: 0.5rem;
        padding: 1.5rem;
        max-width: calc(100vw - 1rem);
    }

    .auth-header h2 {
        font-size: 1.25rem;
    }
}

/* ===== Progress Page Styles ===== */
.progress-page-container {
    position: fixed;
    top: 0;
    left: 260px;
    width: calc(100vw - 260px);
    height: 100vh;
    overflow-y: auto;
    background: var(--bg-color);
    z-index: 999;
    padding: 2rem 1.5rem;
    transition: left 0.3s ease, width 0.3s ease;
}

.progress-page-container > * {
    max-width: 1400px;
    margin: 0 auto;
}

.progress-header {
    margin-bottom: 2rem;
}

.back-btn {
    display: none; /* Hide back buttons */
}

.progress-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
}

.progress-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Overview Cards */
.progress-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.progress-card {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: all 0.3s;
}

.progress-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.progress-card-icon {
    width: 56px;
    height: 56px;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.progress-card-content {
    flex: 1;
}

.progress-card-value {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 0.25rem;
}

.progress-card-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Progress Sections */
.progress-section {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 1.5rem 0;
}

/* Subject Performance Grid */
.subject-performance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.subject-card {
    background: var(--hover-bg);
    border-radius: 0.75rem;
    padding: 1.25rem;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.subject-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

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

.subject-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.subject-accuracy {
    font-size: 1.25rem;
    font-weight: 700;
}

.subject-accuracy.excellent {
    color: #10b981;
}

.subject-accuracy.good {
    color: #f59e0b;
}

.subject-accuracy.needs-practice {
    color: #ef4444;
}

.subject-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 1s ease;
}

.progress-bar.excellent {
    background: linear-gradient(90deg, #10b981, #059669);
}

.progress-bar.good {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

.progress-bar.needs-practice {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

/* Charts Container */
.charts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
}

.chart-card {
    background: var(--hover-bg);
    border-radius: 0.75rem;
    padding: 1.25rem;
    border: 1px solid var(--border-color);
}

.chart-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 1rem 0;
}

.chart-content {
    min-height: 250px;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.chart-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chart-bar-label {
    min-width: 120px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.chart-bar-visual {
    flex: 1;
    height: 32px;
    background: #e5e7eb;
    border-radius: 0.5rem;
    position: relative;
    overflow: hidden;
}

.chart-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #5a67d8);
    border-radius: 0.5rem;
    transition: width 1s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 0.5rem;
}

.chart-bar-value {
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
}

/* Pie Chart */
.pie-chart {
    width: 200px;
    height: 200px;
    margin: 0 auto;
}

.chart-legend {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    flex-shrink: 0;
}

.legend-label {
    font-size: 0.9375rem;
    color: var(--text-secondary);
}

/* Weak Areas */
.weak-areas-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.weak-area-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: #fef2f2;
    border-radius: 0.5rem;
    border-left: 4px solid #ef4444;
}

.weak-area-info {
    flex: 1;
}

.weak-area-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.weak-area-stats {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.weak-area-accuracy {
    font-size: 1.125rem;
    font-weight: 700;
    color: #ef4444;
}

/* Recent Activity */
.recent-activity-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: var(--hover-bg);
    border-radius: 0.5rem;
    border-left: 4px solid transparent;
    transition: all 0.2s;
}

.activity-item:hover {
    background: white;
    box-shadow: var(--shadow-sm);
}

.activity-item.correct {
    border-left-color: #10b981;
}

.activity-item.incorrect {
    border-left-color: #ef4444;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.25rem;
}

.activity-icon.correct {
    background: #d1fae5;
    color: #10b981;
}

.activity-icon.incorrect {
    background: #fee2e2;
    color: #ef4444;
}

.activity-content {
    flex: 1;
}

.activity-question {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.activity-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.activity-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-left: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-state-subtext {
    font-size: 0.9375rem;
    color: var(--text-secondary);
}

/* Responsive Design for Progress Page */
@media (max-width: 768px) {
    .progress-page-container {
        padding: 1.5rem 1rem;
    }

    .progress-title {
        font-size: 1.5rem;
    }

    .progress-overview {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .progress-card {
        padding: 1.25rem;
    }

    .progress-card-value {
        font-size: 1.5rem;
    }

    .subject-performance-grid {
        grid-template-columns: 1fr;
    }

    .charts-container {
        grid-template-columns: 1fr;
    }

    .chart-bar-label {
        min-width: 80px;
        font-size: 0.8125rem;
    }

    .section-title {
        font-size: 1.25rem;
    }
}

/* ===== For You / Reels Style Page ===== */
.for-you-container {
    position: fixed;
    top: 0;
    left: 260px;
    width: calc(100vw - 260px);
    height: 100vh;
    background: #000;
    z-index: 1000;
    overflow: hidden;
    transition: left 0.3s ease, width 0.3s ease;
}

.reels-wrapper {
    width: 100%;
    height: 100%;
    overflow-y: scroll;
    overflow-x: hidden;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* Hide scrollbar but keep functionality */
.reels-wrapper::-webkit-scrollbar {
    display: none;
}

.reels-wrapper {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Reel Card */
.reel-card {
    width: 100%;
    height: 100vh;
    scroll-snap-align: start;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.reel-content {
    max-width: 700px;
    width: 90%;
    max-height: 85vh;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 1.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

/* Scrollbar styling for reel content */
.reel-content::-webkit-scrollbar {
    width: 8px;
}

.reel-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.reel-content::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.3);
    border-radius: 10px;
}

.reel-content::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.5);
}

.reel-question-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
    flex-shrink: 0;
    width: 100%;
    flex-wrap: wrap;
}

.reel-question-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.reel-recommended-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.75rem;
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary-color);
    border-radius: 1.5rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.reel-question-text {
    font-size: 1.125rem;
    line-height: 1.7;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-weight: 500;
    flex-shrink: 0;
}

.reel-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex-shrink: 0;
}

.reel-option {
    padding: 1rem 1.25rem;
    border: 2px solid var(--border-color);
    border-radius: 0.75rem;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.reel-option:hover {
    border-color: var(--primary-color);
    background: rgba(79, 70, 229, 0.05);
    transform: translateX(4px);
}

.reel-option-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.reel-option-text {
    flex: 1;
    font-size: 0.9375rem;
    color: var(--text-primary);
}

/* Navigation Arrows */
.reel-nav-btn {
    position: fixed;
    right: 2rem;
    z-index: 1001;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.reel-nav-btn:hover {
    background: white;
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.reel-nav-btn:active {
    transform: scale(0.95);
}

.reel-nav-up {
    top: calc(50% - 60px);
}

.reel-nav-down {
    top: calc(50% + 10px);
}

.reel-nav-up:hover,
.reel-nav-down:hover {
    transform: scale(1.1);
}

.reel-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.reel-nav-btn:disabled:hover {
    transform: none;
}

/* Close Button */
.for-you-close-btn {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 1002;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.for-you-close-btn:hover {
    background: white;
    transform: rotate(90deg);
}

/* Loading State */
.reel-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    color: white;
    font-size: 1.125rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    /* Hide navigation arrows on mobile */
    .reel-nav-btn {
        display: none;
    }

    .reel-content {
        max-width: none;
        width: 85%;
        padding: 1.5rem;
    }

    .reel-question-text {
        font-size: 1rem;
    }

    .reel-option {
        padding: 0.875rem 1rem;
    }

    .for-you-close-btn {
        top: 1rem;
        right: 1rem;
        width: 36px;
        height: 36px;
    }
}

/* Touch-friendly mobile enhancements */
@media (max-width: 640px) {
    .reel-content {
        width: 90%;
        padding: 1.25rem;
    }

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

    .reel-option {
        padding: 0.75rem 1rem;
    }

    .reel-option-label {
        width: 28px;
        height: 28px;
        font-size: 0.8125rem;
    }

    .reel-option-text {
        font-size: 0.875rem;
    }
}

/* Additional Reel Styles */
.reel-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    flex: 1;
}

.reel-badge {
    padding: 0.375rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.reel-question-number {
    font-size: 0.8125rem;
    color: #6b7280;
    font-weight: 500;
    white-space: nowrap;
}

/* Option states */
.reel-option.selected {
    border-color: var(--primary-color);
    background: rgba(79, 70, 229, 0.1);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.reel-option.correct-answer {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.reel-option.correct-answer .reel-option-label {
    background: #10b981;
}

.reel-option.wrong-answer {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.reel-option.wrong-answer .reel-option-label {
    background: #ef4444;
}

/* Feedback */
.reel-feedback {
    margin-top: 1.5rem;
    padding: 1.25rem;
    border-radius: 0.75rem;
    animation: slideDown 0.3s ease;
}

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

.reel-feedback.correct {
    background: rgba(16, 185, 129, 0.1);
    border: 2px solid #10b981;
}

.reel-feedback.incorrect {
    background: rgba(239, 68, 68, 0.1);
    border: 2px solid #ef4444;
}

.reel-feedback.hint {
    background: rgba(251, 191, 36, 0.1);
    border: 2px solid #fbbf24;
}

.reel-feedback-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.reel-feedback-icon {
    font-size: 1.5rem;
    font-weight: 700;
}

.reel-feedback.correct .reel-feedback-icon {
    color: #10b981;
}

.reel-feedback.incorrect .reel-feedback-icon {
    color: #ef4444;
}

.reel-feedback.hint .reel-feedback-icon {
    color: #fbbf24;
}

.reel-feedback-text {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
}

.reel-feedback-explanation {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.reel-feedback-explanation strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Actions */
.reel-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    flex-shrink: 0;
}

.reel-submit-btn {
    width: 100%;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.reel-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

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

.reel-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Mobile adjustments for new elements */
@media (max-width: 768px) {
    .reel-badges {
        gap: 0.375rem;
    }

    .reel-badge {
        font-size: 0.6875rem;
        padding: 0.3rem 0.625rem;
    }

    .reel-question-number {
        font-size: 0.75rem;
    }

    .reel-feedback {
        padding: 1rem;
    }

    .reel-feedback-text {
        font-size: 1rem;
    }

    .reel-feedback-explanation {
        font-size: 0.875rem;
    }

    .reel-submit-btn {
        padding: 0.875rem 1rem;
        font-size: 0.9375rem;
    }
}
/* ===== Home Page Styles ===== */
.home-page-container {
    max-width: 900px;
    margin: 0 auto;
}

/* Greeting Banner */
.greeting-banner {
    background: linear-gradient(135deg, #FFA559 0%, #FFE6C7 100%);
    border-radius: 1rem;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.greeting-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    border-radius: 50%;
}

.greeting-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 0.875rem 0;
    position: relative;
    z-index: 1;
}

#user-name {
    color: #ea580c;
}

/* AI Generator Box */
.ai-generator-box {
    display: flex;
    gap: 0.5rem;
    background: white;
    border-radius: 0.625rem;
    padding: 0.375rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
}

.ai-input {
    flex: 1;
    border: none;
    padding: 0.5rem 0.875rem;
    font-size: 0.9rem;
    color: var(--text-primary);
    background: transparent;
    outline: none;
}

.ai-input::placeholder {
    color: #94a3b8;
}

.ai-generate-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
}

.ai-generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

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

/* Features Section */
.features-section {
    margin-top: 2rem;
}

.section-heading {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.375rem 0;
    text-align: center;
}

.section-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-align: center;
    margin: 0 0 1.25rem 0;
}

/* Feature Cards Grid */
.feature-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 1.25rem;
}

/* Feature Card */
.feature-card {
    background: white;
    border-radius: 0.875rem;
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-sm);
    border: 2px solid var(--border-color);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
}

.feature-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.feature-card-icon {
    width: 52px;
    height: 52px;
    border-radius: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.feature-card-content {
    flex: 1;
}

.feature-card-title {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.25rem 0;
}

.feature-card-description {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}

.feature-card-arrow {
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.feature-card:hover .feature-card-arrow {
    color: var(--primary-color);
    transform: translateX(4px);
}

/* Topic Quiz Page & Flashcards Page Containers */
.topic-quiz-page-container,
.flashcards-page-container {
    animation: fadeIn 0.3s ease;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .greeting-banner {
        padding: 1.5rem;
    }

    .greeting-title {
        font-size: 1.5rem;
    }

    .ai-generator-box {
        flex-direction: column;
    }

    .feature-cards-grid {
        grid-template-columns: 1fr;
    }

    .section-heading {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .greeting-title {
        font-size: 1.25rem;
    }

    .feature-card {
        flex-direction: column;
        text-align: center;
    }

    .feature-card-arrow {
        transform: rotate(90deg);
    }

    .feature-card:hover .feature-card-arrow {
        transform: rotate(90deg) translateX(4px);
    }
}
/* ===== Sidebar Layout ===== */
.app-container {
    display: flex;
    min-height: 100vh;
    background-color: var(--bg-color);
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: white;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 9999;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);
    transition: width 0.3s ease;
}

.sidebar.collapsed {
    width: 70px;
}

.sidebar.collapsed .sidebar-logo,
.sidebar.collapsed .sidebar-logo-text,
.sidebar.collapsed .sidebar-link span,
.sidebar.collapsed .sidebar-user-info,
.sidebar.collapsed .sidebar-logout-btn,
.sidebar.collapsed .profile-email-container,
.sidebar.collapsed .profile-text-simple {
    display: none !important;
}

.sidebar.collapsed .sidebar-link {
    justify-content: center;
    padding: 0.75rem 0;
}

.sidebar-header {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--text-primary);
}

.sidebar-logo svg {
    flex-shrink: 0;
}

.sidebar-toggle-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.375rem;
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.sidebar-toggle-btn:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.9375rem;
    border-left: 3px solid transparent;
}

.sidebar-link:hover {
    background-color: var(--hover-bg);
    color: var(--text-primary);
}

.sidebar-link.active {
    background-color: rgba(79, 70, 229, 0.08);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.sidebar-link svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    padding: 0.5rem;
    border-radius: 0.5rem;
    margin: -0.5rem -0.5rem 0.25rem -0.5rem;
}

.sidebar-user-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #5a67d8 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-info .profile-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, #5a67d8 100%);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.sidebar-user-info .profile-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(99, 102, 241, 0.3);
}

.profile-text-simple {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.5rem 0;
    cursor: pointer;
}

.profile-text-simple .profile-text {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary);
}

.profile-email-container {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.profile-email-container .profile-email {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    word-break: break-all;
    overflow-wrap: break-word;
    line-height: 1.4;
}

.sidebar-user:hover {
    background-color: var(--hover-bg);
}

.sidebar-logout-btn,
#logout-btn-inline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.625rem 1rem;
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sidebar-logout-btn:hover,
#logout-btn-inline:hover {
    background: #fee2e2;
    border-color: #fca5a5;
}

/* Profile Dropdown for Both Sidebar States */
.profile-dropdown-collapsed {
    position: fixed;
    bottom: 20px;
    left: 255px; /* Will be adjusted by JavaScript based on sidebar state */
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
    min-width: 220px;
    z-index: 10000; /* Higher z-index to appear above modals */
    padding: 0.5rem;
    transition: left 0.3s ease;
}

.profile-dropdown-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.profile-dropdown-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, #5a67d8 100%);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.profile-dropdown-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(99, 102, 241, 0.3);
}

.profile-dropdown-email {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    padding: 0.5rem 0.75rem;
    word-break: break-all;
    overflow-wrap: break-word;
    line-height: 1.4;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 0.25rem;
}

.profile-dropdown-logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.625rem 1rem;
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.profile-dropdown-logout-btn:hover {
    background: #fee2e2;
    border-color: #fca5a5;
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 2rem;
    min-height: 100vh;
    width: calc(100% - 260px);
    transition: margin-left 0.3s ease, width 0.3s ease;
}

.sidebar.collapsed ~ .main-content {
    margin-left: 70px;
    width: calc(100% - 70px);
}

/* Adjust progress page when sidebar is collapsed */
body:has(.sidebar.collapsed) .progress-page-container {
    left: 70px;
    width: calc(100vw - 70px);
}

/* Adjust for-you container when sidebar is collapsed */
body:has(.sidebar.collapsed) .for-you-container {
    left: 70px;
    width: calc(100vw - 70px);
}

/* Adjust topic-quiz page when sidebar is collapsed */
.sidebar.collapsed ~ .main-content .topic-quiz-page-container {
    margin-left: -2rem;
    margin-right: -2rem;
    padding-left: 2rem;
    padding-right: 2rem;
    width: calc(100vw - 70px - 2rem);
}

/* Adjust question page when sidebar is collapsed */
.sidebar.collapsed ~ .main-content .question-page-container {
    margin-left: -2rem;
    margin-right: -2rem;
    padding-left: 2rem;
    padding-right: 2rem;
    width: calc(100vw - 70px - 2rem);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 80px;
    }

    .sidebar-logo span,
    .sidebar-link span {
        display: none;
    }

    .sidebar-user-info {
        display: none;
    }

    .sidebar-logout-btn span {
        display: none;
    }

    .main-content {
        margin-left: 80px;
        width: calc(100% - 80px);
        padding: 1rem;
    }

    .sidebar-link {
        justify-content: center;
        padding: 0.75rem;
    }

    .sidebar-header {
        padding: 1.25rem 0;
        display: flex;
        justify-content: center;
    }

    .sidebar-footer {
        padding: 1rem 0;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .sidebar-user {
        margin-bottom: 0.5rem;
    }

    .sidebar-logout-btn {
        width: 48px;
        height: 48px;
        padding: 0;
        justify-content: center;
    }

    .profile-dropdown-collapsed {
        left: 85px;
        bottom: 15px;
        min-width: 180px;
    }
}

/* ==================== Feedback Tabs ==================== */
.feedback-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.feedback-tab {
    padding: 0.75rem 1.5rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

.feedback-tab:hover {
    color: var(--primary-color);
    background: rgba(79, 70, 229, 0.05);
}

.feedback-tab.active {
    color: var(--primary-color);
}

.feedback-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
}

.feedback-tab-content {
    margin-top: 1rem;
}

.feedback-tab-pane {
    display: none;
}

.feedback-tab-pane.active {
    display: block;
}

/* ==================== Video Recommendations List ==================== */
.video-recommendations-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.video-recommendation-item {
    display: flex;
    gap: 1rem;
    padding: 0.75rem;
    border-radius: 8px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.video-recommendation-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.video-thumbnail {
    position: relative;
    flex-shrink: 0;
    width: 160px;
    height: 90px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--bg-secondary);
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-duration {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.video-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-recommendation-item:hover .video-play-overlay {
    opacity: 1;
}

.video-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.video-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .video-thumbnail {
        width: 120px;
        height: 68px;
    }

    .video-title {
        font-size: 0.875rem;
    }

    .feedback-tab {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
}

/* ================================
   REVIEW QUIZ STYLES
   (Topic-wise Quiz style UI for flashcards/review)
   ================================ */

.review-quiz-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.review-badge {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 1.5rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.review-subject-badge {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary-color);
    border-radius: 1.5rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.review-question-text {
    font-size: 1.125rem;
    line-height: 1.7;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.review-question-image {
    margin-bottom: 1.5rem;
    text-align: center;
}

.review-question-image img {
    max-width: 100%;
    height: auto;
    border-radius: 0.75rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.review-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.review-option {
    padding: 1rem 1.25rem;
    border: 2px solid var(--border-color);
    border-radius: 0.75rem;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-align: left;
}

.review-option:hover {
    border-color: var(--primary-color);
    background: rgba(79, 70, 229, 0.05);
    transform: translateX(4px);
}

.review-option.selected {
    border-color: var(--primary-color);
    background: rgba(79, 70, 229, 0.1);
}

.review-option.correct {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.review-option.incorrect {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.review-option-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.review-option.correct .review-option-label {
    background: #10b981;
}

.review-option.incorrect .review-option-label {
    background: #ef4444;
}

.review-option-text {
    flex: 1;
    font-size: 0.9375rem;
    color: var(--text-primary);
}

.review-actions {
    margin-top: 1rem;
}

.review-submit-btn {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.review-submit-btn:hover {
    background: #5046e5;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.3);
}

.review-submit-btn:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
    transform: none;
}

.review-feedback {
    margin-top: 1.5rem;
    padding: 1.25rem;
    border-radius: 0.75rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
}

.review-feedback-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.review-feedback-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    font-weight: bold;
    flex-shrink: 0;
}

.review-feedback-header:has(.review-feedback-text:contains("Correct")) .review-feedback-icon {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.review-feedback-header:has(.review-feedback-text:contains("Incorrect")) .review-feedback-icon {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.review-feedback-text {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .review-quiz-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .review-question-text {
        font-size: 1rem;
    }

    .review-option {
        padding: 0.875rem 1rem;
    }

    .review-option-label {
        width: 28px;
        height: 28px;
        font-size: 0.8125rem;
    }

    .review-option-text {
        font-size: 0.875rem;
    }

    .review-submit-btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.9375rem;
    }
}

/* ================================
   REVIEW QUIZ CARD CONTAINER
   (Modern white card UI for Review Quiz page)
   ================================ */

.review-quiz-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1rem;
    height: calc(100vh - 100px);
    display: flex;
    flex-direction: column;
}

.review-quiz-card {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 2rem;
    margin-bottom: 2rem;
    flex: 1;
    overflow-y: auto;
    max-height: calc(100vh - 200px);
}

.review-quiz-counter {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.5rem 1.25rem;
    border-radius: 2rem;
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

.review-quiz-content {
    /* Content styling is handled by individual elements inside */
}

/* Increase font sizes for Review Quiz to match Topic-wise Quiz */
.review-quiz-content .review-question-text {
    font-size: 1.25rem !important;
    line-height: 1.8;
    margin-bottom: 2rem;
}

.review-quiz-content .review-option-text {
    font-size: 1.0625rem !important;
}

.review-quiz-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1rem;
}

.review-quiz-nav-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: 0.75rem;
    background: white;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.review-quiz-nav-btn:hover:not(:disabled) {
    border-color: var(--primary-color);
    background: rgba(79, 70, 229, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.review-quiz-nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.review-quiz-nav-btn-primary {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.review-quiz-nav-btn-primary:hover:not(:disabled) {
    background: #5046e5;
    border-color: #5046e5;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .review-quiz-container {
        padding: 1rem 0.5rem;
    }

    .review-quiz-card {
        padding: 1.5rem 1rem;
    }

    .review-quiz-navigation {
        padding: 0 0.5rem;
    }

    .review-quiz-nav-btn {
        padding: 0.75rem 1rem;
        font-size: 0.9375rem;
    }
}

/* ==========================================
   Help Page Styles
   ========================================== */

.help-page-container {
    width: 100%;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

/* Center content when sidebar is collapsed */
.sidebar.collapsed ~ .main-content .help-page-container {
    padding-left: 3rem;
}

/* Help Header */
.help-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
}

.help-title-section {
    background: white;
    border-radius: 1.5rem;
    padding: 3rem 2rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    max-width: 600px;
    margin: 0 auto;
}

.help-icon {
    margin: 0 auto 1.5rem;
    display: block;
    filter: drop-shadow(0 4px 12px rgba(102, 126, 234, 0.3));
}

.help-title {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.help-subtitle {
    font-size: 1rem;
    color: #64748b;
    margin: 0;
}

/* Help Content */
.help-content {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Intro Card */
.help-intro-card {
    background: white;
    border-radius: 1.5rem;
    padding: 2.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.help-intro-card h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1rem;
}

.help-intro-card p {
    font-size: 1rem;
    color: #64748b;
    line-height: 1.8;
    margin: 0;
}

/* Contact Grid */
.help-contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.help-contact-card {
    background: white;
    border-radius: 1.5rem;
    padding: 2.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.help-contact-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.help-contact-card:hover::before {
    transform: scaleX(1);
}

.help-contact-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.help-contact-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    transition: transform 0.3s ease;
}

.help-contact-card:hover .help-contact-icon {
    transform: scale(1.1);
}

.email-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.phone-icon {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.help-contact-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.help-contact-description {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 1.5rem;
}

.help-contact-link {
    font-size: 1rem;
    font-weight: 600;
    color: #667eea;
    text-decoration: none;
    display: block;
    margin-bottom: 1.5rem;
    word-break: break-all;
    transition: color 0.3s ease;
}

.help-contact-link:hover {
    color: #764ba2;
}

.help-contact-btn {
    width: 100%;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.help-contact-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

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

/* FAQ Section */
.help-faq-section {
    background: white;
    border-radius: 1.5rem;
    padding: 2.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.help-faq-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 2rem;
    text-align: center;
}

.help-faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.help-faq-item {
    padding: 1.5rem;
    border-radius: 1rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    transition: all 0.3s ease;
}

.help-faq-item:hover {
    background: linear-gradient(135deg, #e0e7ff 0%, #ddd6fe 100%);
    transform: translateY(-4px);
}

.help-faq-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.help-faq-item h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.75rem;
}

.help-faq-item p {
    font-size: 0.9rem;
    color: #64748b;
    line-height: 1.6;
    margin: 0;
}

/* Quick Links Section */
.help-quick-links {
    background: white;
    border-radius: 1.5rem;
    padding: 2.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.help-quick-links h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 2rem;
    text-align: center;
}

.help-quick-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.help-quick-link {
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 1rem;
    text-decoration: none;
    color: #1e293b;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.help-quick-link:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.help-quick-link svg {
    flex-shrink: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .help-page-container {
        padding: 1rem;
    }

    .help-title-section {
        padding: 2rem 1.5rem;
    }

    .help-title {
        font-size: 2rem;
    }

    .help-subtitle {
        font-size: 1rem;
    }

    .help-intro-card {
        padding: 1.5rem;
    }

    .help-intro-card h2 {
        font-size: 1.5rem;
    }

    .help-intro-card p {
        font-size: 1rem;
    }

    .help-contact-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .help-contact-card {
        padding: 2rem 1.5rem;
    }

    .help-contact-icon {
        width: 64px;
        height: 64px;
    }

    .help-faq-section {
        padding: 1.5rem;
    }

    .help-faq-section h2 {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .help-faq-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .help-faq-item {
        padding: 1.25rem;
    }

    .help-quick-links {
        padding: 1.5rem;
    }

    .help-quick-links h2 {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .help-quick-links-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .help-quick-link {
        padding: 1.25rem;
    }
}

@media (max-width: 480px) {
    .help-title {
        font-size: 1.75rem;
    }

    .help-subtitle {
        font-size: 0.9375rem;
    }

    .help-contact-link {
        font-size: 0.9375rem;
    }
}

/* ==========================================
   Credits Display Styles
   ========================================== */

.sidebar-credits {
    padding: 1rem;
    margin: 0.5rem 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.sidebar-credits:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.credits-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.credits-icon {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.credits-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.credits-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.credits-count {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
}

.credits-message {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

/* Credits badge for collapsed sidebar */
.credits-badge {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    align-items: center;
    justify-content: center;
}

.credits-badge-count {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

/* When sidebar is collapsed */
.sidebar.collapsed .sidebar-credits {
    margin: 0.5rem;
    padding: 0.75rem;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar.collapsed .credits-container,
.sidebar.collapsed .credits-message {
    display: none;
}

.sidebar.collapsed .credits-badge {
    display: flex;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .sidebar-credits {
        margin: 0.5rem;
    }
}

/* Pulse animation for For You auth prompt */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

/* For You auth prompt button hover effects */
.reel-card button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3) !important;
}
