/* ==========================================
   NEURON - Flashcard Application Styles
   Apple-like smooth and fluid design
   ========================================== */

/* Root Variables */
:root {
    --primary-color: #5B9BD5;
    --primary-dark: #4A7FB0;
    --secondary-color: #70AD47;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-bg: #F8F9FA;
    --card-bg: #FFFFFF;
    --text-primary: #2C3E50;
    --text-secondary: #6C757D;
    --border-color: #E0E0E0;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--light-bg);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--light-bg);
}

::-webkit-scrollbar-thumb {
    background: #CBD5E0;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #A0AEC0;
}

/* ==========================================
   NAVIGATION
   ========================================== */
.navbar {
    backdrop-filter: blur(10px);
    transition: var(--transition-smooth);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary) !important;
    transition: var(--transition-smooth);
}

.navbar-brand:hover {
    transform: scale(1.05);
}

.navbar-brand i {
    font-size: 1.8rem;
}

.nav-link {
    font-weight: 500;
    color: var(--text-secondary) !important;
    padding: 0.5rem 1rem !important;
    transition: var(--transition-smooth);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition-smooth);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 80%;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color) !important;
}

.avatar-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.9rem;
}

/* ==========================================
   BUTTONS
   ========================================== */
.btn {
    font-weight: 600;
    border-radius: 12px;
    padding: 0.6rem 1.5rem;
    transition: var(--transition-smooth);
    border: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    box-shadow: 0 4px 12px rgba(91, 155, 213, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(91, 155, 213, 0.4);
}

.btn-create-deck {
    border-radius: 16px;
    padding: 0.8rem 2rem;
    font-weight: 600;
    box-shadow: var(--shadow-md);
}

/* ==========================================
   CARDS
   ========================================== */
.card {
    border-radius: 16px;
    border: none;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-smooth);
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

/* Dashboard Cards */
.review-card {
    background: white;
    border-radius: 12px; /* UPDATED: Slightly smaller radius */
    padding: 0.75rem 1rem; /* UPDATED: Significantly less padding */
    margin-bottom: 0.75rem; /* UPDATED: Less space between cards */
    box-shadow: var(--shadow-sm);
    transition: var(--transition-smooth);
    cursor: pointer;
}

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

.review-card h5 {
    font-size: 1.05rem;
}


.review-badge {
    width: 32px;   /* UPDATED: Smaller badge */
    height: 32px;  /* UPDATED: Smaller badge */
    border-radius: 8px; /* UPDATED: Smaller radius */
    background: linear-gradient(135deg, #FFD700, #FFA500);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;   /* UPDATED: Smaller icon */
    animation: pulse 2s infinite;
}



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

.deck-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-smooth);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.deck-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transform: scaleX(0);
    transition: var(--transition-smooth);
}

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

.deck-card:hover {
    transform: translateY(-8px) !important;
    box-shadow: var(--shadow-lg);
}

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

.deck-stats {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.stat-divider {
    margin: 0 0.5rem;
    opacity: 0.5;
}

.deck-badge-flash {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    animation: flash 1.5s infinite;
}

@keyframes flash {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Progress Section */
.stat-box {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: 12px;
    background: var(--light-bg);
    transition: var(--transition-smooth);
}

.stat-box:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-sm);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-content h3 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0;
}

.streak-message {
    background: linear-gradient(135deg, #FFF7E6, #FFE8CC);
    animation: glow 2s infinite;
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(255, 193, 7, 0.2);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 193, 7, 0.4);
    }
}

/* ==========================================
   FLASHCARD STYLES
   ========================================== */
.study-session-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #E8F4F8 0%, #F0F4F8 100%);
}

.study-header {
    max-width: 900px;
    margin: 0 auto;
}

.card-counter {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-secondary);
}


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

.flashcard.card-exit { 
        animation: swipeOutLeft 0.5s ease-in forwards !important; 
    }
.flashcard.card-exit-back { 
        animation: swipeOutLeftBack 0.5s ease-in forwards !important; 
    }

.flashcard.card-enter {
    animation: cardEnter 0.3s ease-in-out;
}

@keyframes cardExit {
    0% {
        transform: rotateY(0deg) scale(1);
        opacity: 1;
    }
    100% {
        transform: rotateY(90deg) scale(0.8);
        opacity: 0;
    }
}

@keyframes cardEnter {
    0% {
        transform: rotateY(-90deg) scale(0.8);
        opacity: 0;
    }
    100% {
        transform: rotateY(0deg) scale(1);
        opacity: 1;
    }
}

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

.flashcard-front,
.flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 24px;
    background: white;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem;
}

.flashcard-back {
    transform: rotateY(180deg);
    background: linear-gradient(135deg, #F8F9FA 0%, #FFFFFF 100%);
}

.card-type-badge {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background: var(--primary-color);
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
}

.card-content {
    text-align: center;
}

.card-question {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
}

.card-answer {
    font-size: 1.4rem;
    color: var(--text-primary);
    line-height: 1.6;
}

.flip-hint {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-secondary);
    font-size: 0.9rem;
    opacity: 0.7;
    animation: bounce 2s infinite;
}

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

/* Rating Buttons */
.rating-container {
    max-width: 700px;
    margin: 0 auto;
    animation: fadeInUp 0.4s ease-out;
}

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

.rating-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem 1rem;
    border-radius: 16px;
    border: 2px solid transparent;
    background: white;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-smooth);
    cursor: pointer;
}

.rating-btn i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.rating-label {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.rating-time {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.rating-again {
    border-color: transparent;
}

.rating-again:hover {
    border-color: var(--danger-color);
    background: #FFF5F5;
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.rating-again i {
    color: var(--danger-color);
}

.rating-hard:hover {
    border-color: var(--warning-color);
    background: #FFFBF0;
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.rating-hard i {
    color: var(--warning-color);
}

.rating-good:hover {
    border-color: var(--info-color);
    background: #F0F9FF;
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.rating-good i {
    color: var(--info-color);
}

.rating-easy:hover {
    border-color: var(--success-color);
    background: #F0FFF4;
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.rating-easy i {
    color: var(--success-color);
}

/* Session Complete */
.session-complete {
    animation: fadeIn 0.5s ease-out;
}

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

.completion-animation i {
    font-size: 5rem;
    color: var(--success-color);
    animation: scaleIn 0.5s ease-out;
}

@keyframes scaleIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.session-stats .stat-card {
    padding: 1.5rem;
    border-radius: 12px;
    background: var(--light-bg);
    text-align: center;
    transition: var(--transition-smooth);
}

.session-stats .stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-sm);
}

.session-stats .stat-card h4 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.session-stats .stat-card p {
    color: var(--text-secondary);
    margin-bottom: 0;
    font-weight: 500;
}

/* Keyboard Shortcuts */
.keyboard-shortcuts {
    margin-top: 2rem;
}

.shortcut-hint {
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

kbd {
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    background: white;
    border: 1px solid #DDD;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
}

/* ==========================================
   CREATE DECK PAGE
   ========================================== */
.creation-methods .method-card {
    padding: 2rem 1.5rem;
    border-radius: 16px;
    border: 2px solid var(--border-color);
    background: white;
    text-align: center;
    transition: var(--transition-smooth);
    cursor: pointer;
}

.creation-methods .method-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-8px);
    box-shadow: var(--shadow-md);
}

.creation-methods .method-card.active {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #EBF5FB, #FFFFFF);
    box-shadow: var(--shadow-md);
}

.method-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--primary-color);
}
.method-card[data-method="youtube"] .method-icon {
    color: #FF0000; /* YouTube Red */
}
.method-card[data-method="pdf"] .method-icon {
    color: #dc3545; /* Bootstrap Danger Red */
}
.method-card[data-method="text"] .method-icon {
    color: #6c757d; /* Bootstrap Secondary Grey */
}
.method-card[data-method="manual"] .method-icon {
    color: #198754; /* Bootstrap Success Green */
}

.method-card.active .method-icon {
    animation: iconPop 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes iconPop {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* Upload Area */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 16px;
    padding: 3rem;
    text-align: center;
    transition: var(--transition-smooth);
    background: var(--light-bg);
}

.upload-area.drag-over {
    border-color: var(--primary-color);
    background: #EBF5FB;
}

.upload-placeholder i {
    transition: var(--transition-smooth);
}

.upload-area:hover .upload-placeholder i {
    transform: translateY(-10px);
}

/* Card Preview */
.card-preview {
    padding: 1.5rem;
    border-radius: 12px;
    background: var(--light-bg);
    border-left: 4px solid var(--primary-color);
    transition: var(--transition-smooth);
}

.card-preview:hover {
    background: white;
    box-shadow: var(--shadow-sm);
}

/* ==========================================
   EDIT DECK PAGE
   ========================================== */
.color-picker {
    display: flex;
    gap: 0.75rem;
}

.color-option {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: 3px solid transparent;
}

.color-option:hover {
    transform: scale(1.1);
}

.color-option.active {
    border-color: var(--text-primary);
    box-shadow: 0 0 0 3px rgba(91, 155, 213, 0.2);
}

.edit-card-item {
    transition: var(--transition-smooth);
}

.edit-card-item:hover {
    transform: translateX(8px);
}

/* ==========================================
   AUTH PAGES
   ========================================== */
.auth-page {
    background: linear-gradient(135deg, #E8F4F8 0%, #F0F4F8 100%);
    min-height: 100vh;
}

.auth-container {
    background: white;
    border-radius: 24px;
}

.auth-illustration {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    padding: 3rem;
}

.auth-icon-container {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

.password-strength-bar {
    height: 6px;
    background: #E0E0E0;
    border-radius: 3px;
    overflow: hidden;
}

.password-strength-fill {
    height: 100%;
    width: 0;
    transition: width 0.3s ease, background-color 0.3s ease;
}

/* ==========================================
   LANDING PAGE
   ========================================== */
.landing-page {
    background: white;
}

.hero-section {
    background: linear-gradient(135deg, #FFFFFF 0%, #F0F4F8 100%);
    min-height: 80vh;
    display: flex;
    align-items: center;
}

.hero-title {
    animation: fadeInDown 0.8s ease-out;
}

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

.hero-illustration {
    position: relative;
    height: 500px;
}

.floating-card {
    position: absolute;
    width: 150px;
    padding: 1.5rem;
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    text-align: center;
    animation: float 3s ease-in-out infinite;
}

.floating-card.card-1 {
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.floating-card.card-2 {
    top: 50%;
    right: 10%;
    animation-delay: 0.5s;
}

.floating-card.card-3 {
    bottom: 10%;
    left: 20%;
    animation-delay: 1s;
}

.center-brain {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: pulse 2s infinite;
}

.feature-card {
    padding: 2rem;
    border-radius: 16px;
    background: white;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-smooth);
}

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

.feature-icon {
    width: 70px;
    height: 70px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    margin-bottom: 1.5rem;
}

.cta-section {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
}

/* ==========================================
   UTILITIES
   ========================================== */
.empty-state {
    padding: 4rem 2rem;
}

.empty-state i {
    opacity: 0.5;
}

/* Progress Bars */
.progress {
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    transition: width 0.6s ease;
}

/* Min Height Utilities */
.min-vh-75 {
    min-height: 75vh;
}

/* Responsive */
@media (max-width: 768px) {
    .flashcard {
        height: 400px;
    }

    .card-question {
        font-size: 1.4rem;
    }

    .card-answer {
        font-size: 1.1rem;
    }

    .hero-illustration {
        height: 300px;
    }

    .floating-card {
        width: 100px;
        padding: 1rem;
        font-size: 0.8rem;
    }

    .method-icon {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }
}

/* Dark Mode Support */
[data-theme="dark"] {
    --light-bg: #1A1A1A;
    --card-bg: #2D2D2D;
    --text-primary: #E0E0E0;
    --text-secondary: #A0A0A0;
    --border-color: #404040;

    /* --- ADDED RULES FOR DASHBOARD DARK MODE --- */

    /* General overrides for dark text on dark background */
    body,
    h1, h2, h3, h4, h5, h6,
    .fw-bold, .fw-semibold {
        color: var(--text-primary); /* Use light primary text */
    }

    /* Specific overrides for hardcoded colors in dashboard.html */
    h2[style*="#2C3E50"],
    h4[style*="#2C3E50"],
    h5[style*="#2C3E50"],
    h6[style*="#2C3E50"],
    .deck-title[style*="#2C3E50"] {
        color: var(--text-primary) !important; /* Force override */
    }


    p, span, small,
    .text-muted, .small,
    .deck-stats, .stat-item {
        color: var(--text-secondary); /* Use lighter secondary text */
    }

    /* Fix card backgrounds */
    .card { /* Target the main progress card */
        background-color: var(--card-bg);
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2); /* Slightly adjust shadow */
    }

    .review-card,
    .deck-card {
        background-color: var(--card-bg);
         box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    }

    /* Fix Stat Boxes background */
    .progress-stat-box {
        background: #3a3a3a; /* Slightly lighter than card-bg for contrast */
    }

    /* Fix Streak Message background */
    .streak-message-box {
        background: linear-gradient(135deg, #4a4a4a, #3a3a3a);
        border-left-color: var(--warning-color); /* Keep the warning color border */
    }

    /* Fix Empty States background and text */
    .empty-state {
         background-color: var(--card-bg) !important; /* Override inline style */
    }
    .empty-state i {
        color: var(--text-secondary) !important; /* Override inline style */
        opacity: 0.6;
    }


    /* Fix Button styles */
    .btn-outline-secondary {
        color: var(--text-secondary);
        border-color: var(--border-color);
    }
    .btn-outline-secondary:hover {
        color: var(--text-primary);
        background-color: var(--border-color);
        border-color: var(--border-color);
    }

    /* Fix Active Chart Control Button */
    .chart-controls .btn.active {
        background-color: var(--primary-dark) !important; /* Darker blue */
        border-color: var(--primary-dark) !important;
        color: white !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    } 
    .dashboard-container {
        /* Override the light gradient with the dark background variable */
        background: var(--light-bg);
    }
    /* 2. Fix Stat Box Text Colors */
     
    .stat-box .stat-number {
        /* Ensure the large number uses the primary light text color */
        color: var(--text-primary);
    }
    
    .stat-box .small {
        /* Ensure the label ("Day Streak", "Cards Today") uses the secondary light text color */
        color: var(--text-secondary) !important;
    }
    /* 3. Fix Streak Message Text Color */
    
    .streak-message-box p {
        /* Ensure the message text uses the primary light text color */
        color: var(--text-primary) !important;
    }
    .section-header p.text-muted {
        color: var(--text-secondary) !important;
    }
    .mb-4 p.text-muted { /* Making this slightly more specific to the "All Decks" header */
        color: var(--text-secondary) !important;
    }
    .review-card p.small {
        color: var(--text-secondary) !important;
    }
    .deck-card-item .card-text.text-muted {
        color: var(--text-secondary) !important; /* Use lighter secondary text */
    }
    .list-group-item {
        background-color: var(--card-bg); /* Use dark card background */
        border-color: var(--border-color); /* Use dark border color */
        color: var(--text-primary); /* Default text color inside item */
    }
    .list-group-item-action:hover,.list-group-item-action:focus {
        background-color: #3a3a3a; /* Slightly lighter dark background on hover */
        color: var(--text-primary);
    }
    /* Ensure secondary text uses the correct color */
    .list-group-item .text-muted,.list-group-item small {
        color: var(--text-secondary) !important; /* Use lighter secondary text */
    }
    /* Ensure bold text (like stats) uses the primary light color */
    .list-group-item .fw-bold {
        color: var(--text-primary);
    }
    /* Style the chevron icon */
    .list-group-item .fa-chevron-right {
        color: var(--text-secondary);
    }
    /* Fix empty state card background (if needed, though likely already fixed by general .card rule) */
    .card.text-center { /* Targeting the empty state card specifically */
        background-color: var(--card-bg);
    }
    /* Targets the <p> with class 'lead' and 'text-muted' in the header div */
    .mb-5 > p.lead.text-muted {
        color: var(--text-secondary) !important; /* Use lighter secondary text */
    }
    /* Style Form Inputs in Left Sidebar Card */
    .col-lg-4 .card .form-control,.col-lg-4 .card .form-control-lg {
        background-color: var(--card-bg); /* Use dark card background */
        color: var(--text-primary);       /* Use light text color */
        border-color: var(--border-color);  /* Use dark border color */
    }
    /* Optional: Style focus state for inputs */
    .col-lg-4 .card .form-control:focus,.col-lg-4 .card .form-control-lg:focus {
        background-color: var(--card-bg); /* Keep background dark on focus */
        color: var(--text-primary);
        border-color: var(--primary-color); /* Highlight with primary color */
        box-shadow: 0 0 0 0.2rem rgba(91, 155, 213, 0.25); /* Adjust shadow if needed */
    }
    /* Fix Flashcard Hover Effect */
    .edit-card-item:hover .card-content {
        background-color: #3a3a3a; /* Use a slightly lighter dark grey for hover */
    }
    /* 3. Ensure Card Backgrounds are Dark */
    .edit-card-item .card-body { /* Target the inner card body */
        background-color: var(--card-bg);
    }
    .col-lg-4 .card .card-body { /* Target the sidebar card body */
        background-color: var(--card-bg);
    }
    /* Fix Text Colors inside Flashcards */
    .edit-card-item .card-text.fw-bold {
        color: var(--text-primary);
    }
    .edit-card-item .card-text.text-muted {
        color: var(--text-secondary) !important;
    }
    /* Fix Horizontal Rule Color */
    .edit-card-item hr {
        border-top-color: var(--border-color); /* Use dark border color */
        opacity: 0.5; /* Make it slightly less prominent */
    }
    /* Fix Hover Action Buttons Background */
    .card-actions {
        background: #3a3a3a; /* Dark background for the button group */
        box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    }
    .card-actions .btn-light {
        background-color: var(--card-bg); /* Dark background for buttons */
        color: var(--text-secondary); /* Light icon color */
        border-color: var(--border-color);
    }
    .card-actions .btn-light:hover {
        background-color: #4a4a4a; /* Slightly lighter on hover */
        color: var(--text-primary);
    }
    /* Fix Empty State Card */
    #emptyState {
        background-color: var(--card-bg); /* Ensure dark background */
    }
    #emptyState h5 {
        color: var(--text-primary);
    }
    #emptyState p.text-muted {
        color: var(--text-secondary) !important;
    }
    #emptyState i.text-muted {
        color: var(--text-secondary) !important;
        opacity: 0.6;
    }
    /* Style Method Cards */
    .method-card {
        background-color: var(--card-bg);
        border-color: var(--border-color);
    }
    .method-card h4 {
        color: var(--text-primary);
    }
    .method-card p.text-muted {
        color: var(--text-secondary) !important;
    }
    
    
    /* Style hover/active states */
    .method-card:hover {
        background-color: #3a3a3a; /* Slightly lighter dark */
        border-color: var(--text-secondary);
    }
    .method-card.active {
        background-color: #3a3a3a;
        border-color: var(--primary-color); /* Keep primary color border for active */
        box-shadow: 0 0 0 4px rgba(91, 155, 213, 0.25); /* Adjust shadow if needed */
    }
    /*  Style Main Form Card */
    #creationFormCard {
        background-color: var(--card-bg);
    }
    /* Style Form Inputs/Textareas */
    #creationFormCard .form-control,#creationFormCard .form-control-lg {
        background-color: var(--light-bg); /* Use main dark background */
        color: var(--text-primary);
        border-color: var(--border-color);
    }
    /* Style focus state */
    #creationFormCard .form-control:focus,#creationFormCard .form-control-lg:focus {
        background-color: var(--light-bg);
        color: var(--text-primary);
        border-color: var(--primary-color);
        box-shadow: 0 0 0 0.2rem rgba(91, 155, 213, 0.25);
    }
    /* Style readonly input */
    #creationFormCard .form-control[readonly] {
        background-color: #3a3a3a; /* Slightly different background for readonly */
        opacity: 0.7;
    }
    /* Style file input button text (often tricky) */
    #creationFormCard input[type="file"]::file-selector-button {
        background-color: var(--card-bg);
        color: var(--text-primary);
        border-color: var(--border-color);
    }
    /* 4. Style Labels and Helper Text */
    #creationFormCard .form-label {
        color: var(--text-primary);
    }
    #creationFormCard .form-text.text-muted {
        color: var(--text-secondary);
    }
    /* 5. Style Manual Card Preview Area */
    #manualSection .card.bg-light { /* Target the inner card for manual inputs */
        background-color: var(--light-bg) !important; /* Override bg-light */
        border-color: var(--border-color);
    }
    .manual-card-preview {
        background-color: var(--light-bg); /* Use main dark background */
        border-color: var(--border-color);
        color: var(--text-primary);
    }
    .manual-card-preview .btn-close {
        filter: invert(1) grayscale(100%) brightness(200%); /* Make close button white */
    }
    
    #manualSection hr {
        border-top-color: var(--border-color);
        opacity: 0.5;
    }
    .method-card.active {
    /* Use 'background' to fully override the light theme gradient */
        background: #3a3a3a;
        border-color: var(--primary-color); /* Keep primary color border */
        box-shadow: 0 0 0 4px rgba(91, 155, 213, 0.25); /* Adjust shadow if needed */
    }
    #generateBtn.btn-primary,#generateBtn.btn-primary .btn-text,#generateBtn.btn-primary .btn-loader{
        color: #FFFFFF !important; /* Force pure white text */
    }
    #generateBtn.btn-primary {
        background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
        /* No color property needed here if targeting spans directly */
    }
    #generateBtn.btn-primary .spinner-border {
        color: #FFFFFF !important; /* Make spinner white */
    }
    .btn-outline-secondary {
        color: var(--text-secondary);
        border-color: var(--border-color);
    }
    .btn-outline-secondary:hover {
        color: var(--text-primary);
        background-color: var(--border-color);
    }
    #creationFormCard .form-control::placeholder,#creationFormCard .form-control-lg::placeholder {
        color: var(--text-secondary); /* Use the secondary light text color */
        opacity: 0.6; /* Make it slightly faded compared to actual input text */
    }
    /* Chart.js Specific Styles */
    /* Example: Add a subtle border around the canvas element in dark mode */
    #weeklyActivityChart {
        border: 3px solid var(--border-color); /* Use the dark theme border color */
        border-radius: 8px; /* Maybe round the corners slightly */
    }

    /* Example: Add some padding around the chart container in dark mode */
    .chartjs-render-monitor {
        padding: 1rem; /* Add some space inside the container */
        background-color: rgba(255, 255, 255, 0.05); /* Very subtle background tint */
        border-radius: 12px; /* Round the container corners */
    }

    /* Attempt to style chart text elements */
    .chartjs-tooltip {
        background-color: rgba(60, 60, 60, 0.9) !important; /* Darker tooltip */
        color: var(--text-primary) !important;
    }
    .navbar-brand {
        /* Changes the "NEURON." logo text to white */
        color: var(--text-primary) !important;
    }
    .study-session-container {
        /* Sets the main page background to the darkest color */
        background: var(--light-bg);
    }
    .session-header {
    /* Styles the header box (with progress bar) */
        background: var(--card-bg);
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    }
    .session-header h3 {
        color: var(--text-primary);
    }
    .session-header p,.session-header small {
        color: var(--text-secondary);
    }
    .flashcard-front,.flashcard-back {
        /* Styles the main flashcard itself to be a medium dark gray */
        background: #3a3a3a;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    }
    .card-question,.card-answer {
        /* Makes question and answer text white */
        color: var(--text-primary);
    }
    .flip-hint {
        /* Makes the "Click to flip" text a muted light gray */
        color: var(--text-secondary) !important;
    }
    .flashcard-back .rating-btn {
        /* Makes the rating buttons dark */
        background: var(--card-bg);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
        border: 3px solid var(--border-color);
    }
    .flashcard-back .rating-label {
        color: var(--text-primary);
    }
    .flashcard-back .rating-time {
        color: var(--text-secondary); /* Sets "<1 min" etc. to light gray */
    }
    /* Dark mode hover effects for rating buttons */
    .flashcard-back .rating-again:hover { background: #4d3131; }
    .flashcard-back .rating-hard:hover { background: #52442c; }
    .flashcard-back .rating-good:hover { background: #2c4a52; }
    .flashcard-back .rating-easy:hover { background: #2c5237; }

    .keyboard-shortcuts {
    /* Keep the bottom bar light, but make its text dark for contrast */
        background: var(--card-bg);
        box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.2);
    }
    .keyboard-shortcuts small {
        color: var(--text-secondary);
    }
    kbd {
        /* Ensure the kbd tags have dark text on their light background */
        color: var(--text-primary);
        background: #3a3a3a;
        border-color: var(--border-color);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    }
    .session-header p.text-muted, .session-header small.text-muted {
        /* Fixes the "/", "cards", clock icon, and progress text */
        color: var(--text-secondary) !important;
    }
    .session-complete p.text-muted {
        /* Fixes the "You've completed..." subtitle */
        color: var(--text-secondary) !important;
    }
    .stat-card {
        /* Changes the stat card background to dark */
        background: var(--card-bg);
        /* Adds the light gray border */
        border: 2px solid var(--border-color);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    }
    .dropdown-menu {
        /* Sets the menu background to dark */
        background-color: var(--card-bg);
        /* Adds a subtle border */
        border: 1px solid var(--border-color);
        /* Makes the shadow a bit darker */
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    }
    .dropdown-item {
        /* Sets "Profile", "Settings" text to white */
        color: var(--text-primary);
    }
    .dropdown-item i.fas {
        /* Makes icons light gray (optional, remove if you want them white) */
        color: var(--text-secondary);
        margin-right: 0.5rem; /* Ensures spacing */
    }
    .dropdown-item.text-danger:hover,.dropdown-item.text-danger:focus {
        background-color: #4d3131; /* A dark red background */
        color: var(--danger-color) !important;
    }
    

    /* --- END OF ADDED RULES --- */
}

[data-theme="dark"] body {
    background-color: var(--light-bg);
    color: var(--text-primary);
}

[data-theme="dark"] .card,
[data-theme="dark"] .review-card,
[data-theme="dark"] .deck-card,
[data-theme="dark"] .flashcard-front,
[data-theme="dark"] .flashcard-back {
    background-color: var(--card-bg);
    color: var(--text-primary);
}

[data-theme="dark"] .navbar {
    background-color: var(--card-bg) !important;
}

/* Animations */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* Loading Spinner */
.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(91, 155, 213, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Tooltips */
.tooltip-custom {
    position: relative;
    display: inline-block;
}

.tooltip-custom::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 1rem;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    border-radius: 8px;
    font-size: 0.85rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.tooltip-custom:hover::after {
    opacity: 1;
}

/* Success Animation */
.success-checkmark {
    width: 80px;
    height: 80px;
    margin: 0 auto;
}

.success-checkmark .check-icon {
    width: 80px;
    height: 80px;
    position: relative;
    border-radius: 50%;
    box-sizing: content-box;
    border: 4px solid var(--success-color);
}

.success-checkmark .check-icon::before {
    top: 3px;
    left: -2px;
    width: 30px;
    transform-origin: 100% 50%;
    border-radius: 100px 0 0 100px;
}

.success-checkmark .check-icon::after {
    top: 0;
    left: 30px;
    width: 60px;
    transform-origin: 0 50%;
    border-radius: 0 100px 100px 0;
    animation: rotate-circle 4.25s ease-in;
}

.success-checkmark .check-icon::before,
.success-checkmark .check-icon::after {
    content: '';
    height: 100px;
    position: absolute;
    background: white;
    transform: rotate(-45deg);
}

.success-checkmark .icon-line {
    height: 5px;
    background-color: var(--success-color);
    display: block;
    border-radius: 2px;
    position: absolute;
    z-index: 10;
}

.success-checkmark .icon-line.line-tip {
    top: 46px;
    left: 14px;
    width: 25px;
    transform: rotate(45deg);
    animation: icon-line-tip 0.75s;
}

.success-checkmark .icon-line.line-long {
    top: 38px;
    right: 8px;
    width: 47px;
    transform: rotate(-45deg);
    animation: icon-line-long 0.75s;
}

@keyframes rotate-circle {
    0% {
        transform: rotate(-45deg);
    }
    5% {
        transform: rotate(-45deg);
    }
    12% {
        transform: rotate(-405deg);
    }
    100% {
        transform: rotate(-405deg);
    }
}

@keyframes icon-line-tip {
    0% {
        width: 0;
        left: 1px;
        top: 19px;
    }
    54% {
        width: 0;
        left: 1px;
        top: 19px;
    }
    70% {
        width: 50px;
        left: -8px;
        top: 37px;
    }
    84% {
        width: 17px;
        left: 21px;
        top: 48px;
    }
    100% {
        width: 25px;
        left: 14px;
        top: 45px;
    }
}

@keyframes icon-line-long {
    0% {
        width: 0;
        right: 46px;
        top: 54px;
    }
    65% {
        width: 0;
        right: 46px;
        top: 54px;
    }
    84% {
        width: 55px;
        right: 0px;
        top: 35px;
    }
    100% {
        width: 47px;
        right: 8px;
        top: 38px;
    }
}

/* Badge Styles */
.badge {
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
}

/* Alert Styles */
.alert {
    border-radius: 12px;
    border: none;
    box-shadow: var(--shadow-sm);
}

/* Form Styles */
.form-control,
.form-select {
    border-radius: 12px;
    border: 2px solid var(--border-color);
    padding: 0.75rem 1rem;
    transition: var(--transition-smooth);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(91, 155, 213, 0.15);
}

.input-group-text {
    border-radius: 12px 0 0 12px;
    border: 2px solid var(--border-color);
    border-right: none;
}

.input-group .form-control {
    border-left: none;
    border-radius: 0 12px 12px 0;
}

/* Modal Styles */
.modal-content {
    border-radius: 20px;
    border: none;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem;
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 1.5rem;
}

/* Dropdown Styles */
.dropdown-menu {
    border-radius: 12px;
    border: none;
    box-shadow: var(--shadow-md);
    padding: 0.5rem;
}

.dropdown-item {
    border-radius: 8px;
    padding: 0.75rem 1rem;
    transition: var(--transition-smooth);
}

.dropdown-item:hover {
    background-color: var(--light-bg);
}

/* Toast Notification */
.toast {
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
}

/* Custom Checkbox & Radio */
.form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Pagination */
.pagination {
    gap: 0.5rem;
}

.page-link {
    border-radius: 8px;
    border: none;
    padding: 0.5rem 1rem;
    color: var(--text-primary);
    transition: var(--transition-smooth);
}

.page-link:hover {
    background-color: var(--light-bg);
    transform: translateY(-2px);
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    color: white;
}

/* Footer */
footer {
    margin-top: auto;
}

/* Print Styles */
@media print {
    .navbar,
    .btn,
    .rating-container,
    .keyboard-shortcuts {
        display: none !important;
    }

    .flashcard {
        page-break-inside: avoid;
    }
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus Styles for Keyboard Navigation */
*:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

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

/* Custom Selection */
::selection {
    background-color: rgba(91, 155, 213, 0.3);
    color: var(--text-primary);
}

/* Smooth Page Transitions */
.page-transition-enter {
    opacity: 0;
    transform: translateY(20px);
}

.page-transition-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s, transform 0.3s;
}

.page-transition-exit {
    opacity: 1;
}

.page-transition-exit-active {
    opacity: 0;
    transition: opacity 0.3s;
}

/* Confetti Animation (for celebrations) */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background-color: var(--primary-color);
    position: absolute;
    animation: confetti-fall 3s linear forwards;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Microinteractions */
.btn-pulse {
    animation: btn-pulse 2s infinite;
}

@keyframes btn-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(91, 155, 213, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(91, 155, 213, 0);
    }
}

/* Glass Morphism Effect */
.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Neumorphism Effect (Optional) */
.neumorphic {
    background: #E0E5EC;
    box-shadow:
        9px 9px 16px rgba(163, 177, 198, 0.6),
        -9px -9px 16px rgba(255, 255, 255, 0.5);
}

.neumorphic:active {
    box-shadow:
        inset 9px 9px 16px rgba(163, 177, 198, 0.6),
        inset -9px -9px 16px rgba(255, 255, 255, 0.5);
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Loading Skeleton */
.skeleton-text {
    height: 1rem;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

/* Responsive Utilities */
@media (max-width: 576px) {
    .card-body {
        padding: 1rem;
    }

    .btn-lg {
        padding: 0.5rem 1rem;
        font-size: 1rem;
    }

    .display-1,
    .display-2,
    .display-3,
    .display-4,
    .display-5 {
        font-size: 2rem;
    }
}

/* Print Optimization */
@page {
    margin: 1cm;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #0056b3;
        --text-primary: #000000;
        --text-secondary: #333333;
    }

    .btn {
        border: 2px solid currentColor;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==========================================
   DASHBOARD SPECIFIC STYLES
   ========================================== */
.dashboard-container {
    background: linear-gradient(135deg, #F8F9FA 0%, #E9ECEF 100%);
    min-height: 100vh;
    padding-bottom: 3rem;
}

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

.review-cards-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

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

/* Progress Stat Boxes */
.progress-stat-box {
    background: linear-gradient(135deg, #EBF5FB, #FFFFFF);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.progress-stat-box:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.stat-icon-fire {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    background: linear-gradient(135deg, #5B9BD5, #4A7FB0);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon-fire i {
    color: white;
    font-size: 1.75rem;
}

.stat-icon-check {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    background: linear-gradient(135deg, #70AD47, #5A8A39);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon-check i {
    color: white;
    font-size: 1.75rem;
}

.stat-number {
    color: #2C3E50;
    font-size: 2.5rem;
}

.streak-message-box {
    padding: 1rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #FFF7E6, #FFE8CC);
    border-radius: 12px;
    border-left: 4px solid #FFC000;
}

.streak-emoji {
    font-size: 2rem;
}

.chart-badge {
    background: linear-gradient(135deg, #5B9BD5, #4A7FB0);
    padding: 0.5rem 1rem;
    border-radius: 8px;
}

/* === 3. SWIPE EXIT ANIMATIONS (Renamed to bypass style.css) === */
    
    /* Disable transition so it doesn't fight the animation */
    .flashcard.swipe-exit, .flashcard.swipe-exit-back {
        transition: none !important;
    }

    /* Prevent Mirror Glitch: Hide the "wrong" side immediately */
    .flashcard.swipe-exit-back .flashcard-front { visibility: hidden !important; opacity: 0 !important; }
    .flashcard.swipe-exit .flashcard-back { visibility: hidden !important; opacity: 0 !important; }

    /* EXIT ANIMATION: Swipe Left */
    /* Use 'swipe-exit' instead of 'card-exit' to avoid conflicts */
    .flashcard.swipe-exit { 
        animation: swipeOutLeft 0.5s ease-in forwards !important; 
    }
    .flashcard.swipe-exit-back { 
        animation: swipeOutLeftBack 0.5s ease-in forwards !important; 
    }

    @keyframes swipeOutLeft { 
        0% { transform: rotateY(0deg) translateX(0) scale(1); opacity: 1; } 
        100% { transform: rotateY(0deg) translateX(-120%) rotate(-10deg) scale(0.9); opacity: 0; } 
    }
    
    @keyframes swipeOutLeftBack { 
        0% { transform: rotateY(180deg) translateX(0) scale(1); opacity: 1; } 
        100% { transform: rotateY(180deg) translateX(-120%) rotate(-10deg) scale(0.9); opacity: 0; } 
    }

    /* ENTER ANIMATION */
    .flashcard.card-enter { 
        animation: slideInRight 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards !important; 
    }
    
    @keyframes slideInRight { 
        0% { transform: translateX(120%) scale(0.95); opacity: 0; } 
        100% { transform: translateX(0) scale(1); opacity: 1; } 
    }
/* End of Styles */
