@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

:root { 
    --text-dark: #1e293b; 
    --text-light: #64748b; 
    --primary-accent: #6366F1; 
    --bg-light: #F7F7FD; 
    --bg-white: #ffffff; 
}

/* =================================================================== */
/* ===== GENERAL & LOGIN STYLES ====================================== */
/* =================================================================== */

body { 
    font-family: 'Poppins', sans-serif; 
    font-size: 14px; 
    margin: 0; 
    box-sizing: border-box; 
    -webkit-tap-highlight-color: transparent; 
}

.login-body { 
    background: #e6e0ff; 
    background-image: radial-gradient(circle at 50% 0%, #d5cffc 0%, #b8a9f3 100%); 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    min-height: 100vh; 
    padding: 20px; 
}

.login-card { 
    width: 100%; 
    max-width: 400px; 
    text-align: center; 
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.2)); 
    backdrop-filter: blur(15px); 
    border-radius: 24px; 
    border: 1px solid rgba(255, 255, 255, 0.2); 
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15); 
    padding: 40px; 
}

.login-card .logo-container {
    width: auto;
    height: auto;
    border-radius: 0;
    background: transparent;
    margin: 0 auto 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-card .logo-container img {
    width: 80px;
    height: 80px;
    object-fit: contain;
}
.login-card h1 { 
    color: #3f3c62; 
    font-size: 1.7rem; 
    font-weight: 700; 
    margin: 0; 
}

.login-card .subtitle { 
    color: #6a6a8a; 
    font-size: 0.9rem; 
    margin: 8px 0 30px 0; 
    font-weight: 400; 
}

.login-card input { 
    width: 100%; 
    padding: 14px; 
    margin-bottom: 18px; 
    border: 1px solid #d9d9e6; 
    border-radius: 12px; 
    font-size: 0.95rem; 
    font-family: 'Poppins', sans-serif; 
    box-sizing: border-box; 
    background-color: #f3f3ff; 
}

.signin-btn { 
    width: 100%; 
    padding: 15px; 
    border: none; 
    border-radius: 12px; 
    background: linear-gradient(135deg, #8E2DE2, #4A00E0); 
    color: white; 
    font-size: 1rem; 
    font-weight: 600; 
    cursor: pointer; 
    transition: all 0.2s ease; 
}

.signup-link { 
    margin-top: 25px; 
    font-size: 0.9rem; 
    color: #6a6a8a; 
}

.signup-link a { 
    color: #3f3c62; 
    font-weight: 600; 
    text-decoration: none; 
}

.login-footer { 
    margin-top: 25px; 
    font-size: 0.9rem; 
    color: #6a6a8a; 
}

.login-footer .forgot-link { 
    display: block; 
    margin-bottom: 15px; 
    font-weight: 500; 
    color: #3f3c62; 
    text-decoration: none; 
}

.login-footer p { margin: 0; }
.login-footer a { color: #3f3c62; font-weight: 600; text-decoration: none; }

/* =================================================================== */
/* ===== APP LAYOUT & NAVIGATION ===================================== */
/* =================================================================== */

.app-body { 
    background-color: var(--bg-light); 
}

.app-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 12px 20px; 
    position: sticky; 
    top: 0; 
    z-index: 100; 
    background: rgba(247, 247, 253, 0.85); 
    backdrop-filter: blur(12px); 
    border-bottom: 1px solid rgba(0, 0, 0, 0.04); 
}

.app-header .logo { 
    font-weight: 600; 
    font-size: 1.1rem; 
    color: #3f3c62; 
    display: flex; 
    align-items: center; 
}
.app-header .logo-icon {
    width: 32px;  /* Increased from 24px */
    height: 32px; /* Increased from 24px */
    margin-right: 10px; /* Slightly increased margin */
    object-fit: contain;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-header .header-icons { 
    display: flex; 
    gap: 18px; 
    font-size: 1.3rem; 
    cursor: pointer; 
}

.app-container { 
    padding: 15px 20px 90px 20px; 
}

.bottom-nav { 
    position: fixed; 
    bottom: 0; 
    left: 0; 
    right: 0; 
    background: var(--bg-white); 
    display: flex; 
    justify-content: space-around; 
    padding: 8px 0; 
    box-shadow: 0 -2px 15px rgba(102, 126, 234, 0.06); 
    border-top: 1px solid #f3f4f6; 
    height: 55px; 
    align-items: center; 
}

.nav-item { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center; 
    text-decoration: none; 
    color: #9ca3af; 
    font-size: 0.7rem; 
    font-weight: 500; 
}

.nav-item div { 
    width: 36px; 
    height: 36px; 
    border-radius: 12px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    margin-bottom: 2px; 
    background-color: transparent; 
    transition: all 0.2s ease; 
}

.nav-item svg { 
    width: 22px; 
    height: 22px; 
    fill: #9ca3af; 
    transition: all 0.2s ease; 
}

.nav-item.active { 
    color: var(--primary-accent); 
}

.nav-item.active div { 
    background-color: var(--primary-accent); 
}

.nav-item.active svg { 
    fill: white; 
}


/* =================================================================== */
/* ===== GENERAL COMPONENTS (CARDS, BUTTONS, ETC.) =================== */
/* =================================================================== */

.page-title { 
    margin-bottom: 25px; 
}

.page-title h1 { 
    font-size: 1.7rem; 
    font-weight: 700; 
    color: var(--text-dark); 
    margin: 1; 
}

.page-title p { 
    font-size: 0.95rem; 
    color: var(--text-light); 
    margin: 4px 0 0; 
}

.welcome-card { 
  margin-top: 16px;
    background: linear-gradient(135deg, #8666EA 0%, #6138C6 100%); 
    color: white; 
    padding: 22px; 
    border-radius: 20px; 
    margin-bottom: 25px; 
}

.welcome-card .welcome-subtitle { 
    margin: 0; 
    font-size: 0.9rem; 
    font-weight: 500; 
    opacity: 0.9; 
}

.welcome-card h2 { 
    margin: 6px 0 8px; 
    font-size: 1.5rem; 
    font-weight: 600; 
    line-height: 1.3; 
}

.welcome-card .welcome-subtext { 
    margin: 0; 
    font-size: 0.85rem; 
    opacity: 0.8; 
}

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

.stat-card { 
    background: var(--bg-white); 
    padding: 20px; 
    border-radius: 16px; 
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.07); 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}

.stat-info h3 { 
    margin: 0; 
    font-size: 0.9rem; 
    color: #6c757d; 
    font-weight: 500; 
}

.stat-info p { 
    margin: 5px 0 0; 
    font-size: 1.5rem; 
    font-weight: 600; 
    color: #343a40; 
}

.stat-icon { 
    font-size: 1.3rem; 
    width: 45px; 
    height: 45px; 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
}

.icon-xp { background-color: #EDE9FE; color: #8B5CF6; }
.icon-level { background-color: #FFEBEB; color: #EF4444; }
.icon-streak { background-color: #E0FBEA; color: #22C55E; }

.action-btn { 
    width: 100%; 
    padding: 15px; 
    font-size: 0.95rem; 
    font-weight: 600; 
    border-radius: 14px; 
    cursor: pointer; 
    text-decoration: none; 
    box-sizing: border-box; 
    transition: transform 0.2s; 
    border: none; 
}

.action-btn.primary { 
    color: white; 
    background: linear-gradient(135deg, #8666EA, #6138C6); 
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2); 
}

.action-btn.secondary { 
    color: var(--primary-accent); 
    background-color: #eef2ff; 
}

.action-btn:disabled { 
    background: #e2e8f0 !important; 
    color: #9ca3af !important; 
    cursor: not-allowed !important; 
    box-shadow: none !important; 
}

.quiz-list, .study-list { 
    display: grid; 
    gap: 12px; 
}

.quiz-card, .study-card { 
    background: var(--bg-white); 
    padding: 18px; 
    border-radius: 18px; 
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.04); 
    display: flex; 
    align-items: center; 
    gap: 15px; 
    text-decoration: none; 
    transition: transform 0.2s, box-shadow 0.2s; 
}

.quiz-icon, .study-icon { 
    font-size: 1rem; 
    width: 50px; 
    height: 50px; 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    flex-shrink: 0; 
}

.icon-bio { background-color: #e0fbf1; color: #10b981; }
.icon-chem { background-color: #e0f2fe; color: #3b82f6; }
.icon-phy { background-color: #fffbeb; color: #f59e0b; }
.icon-butterfly { background-color: #e0f2fe; color: #0ea5e9; }

.quiz-info, .study-info { 
    flex-grow: 1; 
    min-width: 0; 
}

.quiz-info h3, .study-info h3 { 
    margin: 0; 
    font-size: 1rem; 
    font-weight: 600; 
    color: var(--text-dark); 
}

/* ADD THE MISSING BRACE HERE V */
.quiz-info p, .study-info p { 
    margin: 3px 0 0; 
    font-size: 0.8rem; 
    color: var(--text-light); 
}


.arrow-icon { 
    font-size: 1.5rem; 
    color: #9ca3af; 
}

.empty-state-card { 
    background: #f8f9fa; 
    border: 1px dashed #dee2e6; 
    border-radius: 18px; 
    padding: 40px 20px; 
    text-align: center; 
}

.empty-state-card p { 
    margin: 0; 
    color: var(--text-light); 
    font-weight: 500; 
}

.progress-bar-container { 
    width: 100%; 
    height: 6px; 
    background-color: #e2e8f0; 
    border-radius: 3px; 
    overflow: hidden; 
}

.progress-bar { 
    height: 100%; 
    background: linear-gradient(135deg, #8666EA 0%, #6138C6 100%); 
    border-radius: 3px; 
}

/* =================================================================== */
/* ===== QUIZ & RESULTS PAGES ======================================== */
/* =================================================================== */

.quiz-container { 
    padding: 15px 20px; 
    padding-bottom: 120px; /* <-- ADD THIS LINE */
}


.progress-counter { 
    font-size: 0.85rem; 
    font-weight: 500; 
    color: var(--text-light); 
    margin-bottom: 8px; 
}

.question-container h2 { 
    font-size: 1.2rem; 
    font-weight: 600; 
    color: var(--text-dark); 
    line-height: 1.6; 
    min-height: 90px; 
}

.answer-options { 
    display: grid; 
    gap: 12px; 
    margin-top: 20px; 
}

.option { 
    width: 100%; 
    padding: 16px; 
    font-family: 'Poppins', sans-serif; 
    font-size: 0.95rem; 
    font-weight: 500; 
    text-align: left; 
    color: #3f3c62; 
    background-color: var(--bg-white); 
    border: 2px solid #e2e8f0; 
    border-radius: 14px; 
    cursor: pointer; 
    transition: all 0.2s ease; 
}

.option.selected { 
    border-color: var(--primary-accent); 
    background-color: #eef2ff; 
    font-weight: 600; 
}

.option.correct { 
    border-color: #10b981; 
    background-color: #e0fbf1; 
    color: #059669; 
}

.option.incorrect { 
    border-color: #ef4444; 
    background-color: #ffebeb; 
    color: #dc2626; 
}
.quiz-footer { 
    position: fixed;  /* <-- The main fix */
    bottom: 0;        /* Stick it to the bottom edge */
    left: 0;          /* Stick it to the left edge */
    right: 0;         /* Stick it to the right edge */
    
    /* These add styling */
    padding: 20px;
    background: var(--bg-white);
    border-top: 1px solid #f3f4f6;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.06);
}


.results-card { 
    background-color: var(--bg-white); 
    padding: 30px; 
    border-radius: 24px; 
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.1); 
    text-align: center; 
    margin-bottom: 30px; 
}

.score-circle { 
    position: relative; 
    width: 150px; 
    height: 150px; 
    margin: 10px auto 30px; 
}

.score-text { 
    position: absolute; 
    top: 50%; 
    left: 50%; 
    transform: translate(-50%, -50%); 
    font-size: 2.5rem; 
    font-weight: 700; 
    color: var(--text-dark); 
}

.score-ring { 
    width: 100%; 
    height: 100%; 
    transform: rotate(-90deg); 
}

.score-ring-bg, .score-ring-fg { 
    fill: none; 
    stroke-width: 4; 
}

.score-ring-bg { 
    stroke: #eef2ff; 
}

.score-ring-fg { 
    stroke: var(--primary-accent); 
    stroke-linecap: round; 
    transition: stroke-dasharray 0.5s ease-out; 
}

.results-details { 
    display: flex; 
    justify-content: space-around; 
    border-top: 1px solid #f3f4f6; 
    padding-top: 25px; 
}

.detail-item { 
    display: flex; 
    flex-direction: column; 
    gap: 4px; 
}

.detail-item span { 
    font-size: 0.85rem; 
    color: var(--text-light); 
}

.detail-item strong { 
    font-size: 1.1rem; 
    font-weight: 600; 
    color: var(--text-dark); 
}

.detail-item #xp-earned { 
    color: #8B5CF6; 
}

.results-actions { 
    display: flex; 
    gap: 15px; 
}

/* =================================================================== */
/* ===== LEADERBOARD PAGE ============================================ */
/* =================================================================== */

.leaderboard-top3 { 
    display: flex; 
    justify-content: center; 
    align-items: flex-end; 
    gap: 15px; 
    margin-bottom: 30px; 
}

.top-player { 
    background-color: var(--bg-white); 
    padding: 20px 10px; 
    border-radius: 18px; 
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.05); 
    text-align: center; 
    width: 100px; 
    border: 2px solid transparent; 
}

.top-player.gold { 
    order: 2; 
    transform: scale(1.15); 
    border-color: #ffd700; 
}

.top-player.silver { order: 1; }
.top-player.bronze { order: 3; }

.rank-badge { 
    font-size: 0.9rem; 
    font-weight: 500; 
    margin-bottom: 10px; 
}

.player-avatar { 
    width: 50px; 
    height: 50px; 
    border-radius: 50%; 
    background-color: #eef2ff; 
    color: var(--primary-accent); 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 1.5rem; 
    font-weight: 600; 
    margin: 0 auto 10px; 
}

.top-player h3 { 
    margin: 0; 
    font-size: 0.9rem; 
    font-weight: 600; 
    color: var(--text-dark); 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
}

.top-player p { 
    margin: 4px 0 0; 
    font-size: 0.8rem; 
    color: var(--text-light); 
}

.leaderboard-list { 
    display: grid; 
    gap: 12px; 
}

.list-player { 
    display: flex; 
    align-items: center; 
    background-color: var(--bg-white); 
    padding: 12px 15px; 
    border-radius: 16px; 
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.07); 
    gap: 15px; 
}

.list-rank { 
    font-size: 1rem; 
    font-weight: 600; 
    color: var(--text-light); 
    min-width: 30px; 
    text-align: center; 
}

.player-avatar.list-avatar { 
    width: 40px; 
    height: 40px; 
    font-size: 1.2rem; 
    margin: 0; 
}

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

.list-player-info h3 { 
    margin: 0; 
    font-size: 1rem; 
    font-weight: 600; 
    color: var(--text-dark); 
}

.list-player-info p { 
    margin: 3px 0 0; 
    font-size: 0.85rem; 
    color: var(--text-light); 
}

.current-user-rank { 
    position: fixed; 
    bottom: 75px; 
    left: 15px; 
    right: 15px; 
    z-index: 99; 
    display: none; 
    background: linear-gradient(135deg, #8666EA 0%, #6138C6 100%); 
    color: white; 
    padding: 12px 15px; 
    border-radius: 16px; 
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.3); 
    align-items: center; 
    gap: 15px; 
}

.current-user-rank .list-rank { color: white; }
.current-user-rank .list-avatar { background-color: rgba(255,255,255,0.2); color: white; }
.current-user-rank .list-player-info h3, .current-user-rank .list-player-info p { color: white; }

/* =================================================================== */
/* ===== HOME PAGE (DAILY CHALLENGE) ================================= */
/* =================================================================== */

.daily-challenge-card {
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    background: var(--bg-white);
    padding: 20px; 
    border-radius: 18px; 
    margin-bottom: 25px; 
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.05);
    text-decoration: none; 
    border: 2px solid var(--primary-accent);
}

.daily-challenge-info h3 { 
    margin: 0; 
    font-size: 1.05rem; 
    font-weight: 600; 
    color: var(--text-dark); 
}

.daily-challenge-info p { 
    margin: 4px 0 0; 
    font-size: 0.85rem; 
    color: var(--text-light); 
}

.daily-challenge-btn {
    background-color: var(--primary-accent); 
    color: white; 
    padding: 10px 20px; 
    border-radius: 12px;
    font-weight: 500; 
    font-size: 0.9rem; 
    transition: transform 0.2s;
}

.daily-challenge-card:hover .daily-challenge-btn { 
    transform: scale(1.05); 
}

/* --- Study Page: Progress Card (FIXED) --- */
/* * By adding #main-view, we make these styles
 * ONLY apply to the study page, not the home page.
*/
#main-view .progress-card {
    background-color: #fff;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    margin-bottom: 24px;
    margin-top: 16px;
}

#main-view .progress-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
    font-size: 1.1rem;
}

#main-view #progress-percentage-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: #6a5be2; /* Your app's purple color */
}

#main-view .progress-bar-container {
    width: 100%;
    height: 10px; 
    background-color: #f0f0f0; 
    border-radius: 5px;
    overflow: hidden;
}

#main-view .progress-bar-fill {
    height: 100%;
    width: 0%; /* JavaScript changes this */
    background-color: #6a5be2; /* Your app's purple color */
    border-radius: 5px;
    transition: width 0.5s ease-in-out;
}


.search-bar-container { 
    position: relative; 
    margin-bottom: 25px; 
}

.search-icon {
    position: absolute; 
    left: 20px; 
    top: 50%;
    transform: translateY(-50%); 
    color: var(--text-light); 
    font-size: 1.1rem;
}

.search-input {
    width: 100%; 
    box-sizing: border-box; 
    padding: 16px 20px 16px 55px;
    border-radius: 16px; 
    border: none; 
    background: var(--bg-white);
    font-family: 'Poppins', sans-serif; 
    font-size: 0.95rem;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.04); 
    color: var(--text-dark);
}

.search-input::placeholder { 
    color: #a0aec0; 
}

.filter-pills-container {
    display: flex; 
    gap: 12px; 
    margin-bottom: 25px;
    overflow-x: auto; 
    padding-bottom: 5px;
}

.filter-pills-container::-webkit-scrollbar { 
    display: none; 
}

.pill-btn {
    padding: 10px 22px; 
    font-family: 'Poppins', sans-serif; 
    font-size: 0.9rem;
    font-weight: 500; 
    border: none; 
    border-radius: 25px;
    background: var(--bg-white); 
    color: var(--text-light); 
    cursor: pointer;
    white-space: nowrap; 
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.pill-btn.active {
    background-color: var(--primary-accent); 
    color: white; 
    font-weight: 600;
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.3);
}

.activity-cards-container {
    display: grid; 
    grid-template-columns: 1fr; 
    gap: 15px; 
    margin-bottom: 25px;
}

.activity-card {
    padding: 25px 15px; 
    text-align: center; 
    border-radius: 18px;
    background: var(--bg-white); 
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.04);
    text-decoration: none; 
    color: var(--text-dark); 
    font-weight: 600;
    font-size: 1rem; 
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.activity-card:hover {
    transform: translateY(-4px); 
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.chapter-view-header {
    display: flex; 
    align-items: center; 
    gap: 15px; 
    margin-bottom: 25px;
}

.back-button {
    background: var(--bg-white); 
    border: 1px solid #e2e8f0;
    color: var(--text-dark); 
    width: 40px; 
    height: 40px;
    border-radius: 50%; 
    font-size: 1.5rem; 
    display: flex;
    align-items: center; 
    justify-content: center; 
    cursor: pointer;
}

#chapter-view-title {
    font-size: 1.5rem; 
    font-weight: 700; 
    margin: 3; 
    color: var(--text-dark);
}



/* =================================================================== */
/* ===== FLASHCARD PAGE V3 (IMPROVED DESIGN) - SCOPED STYLES ========= */
/* =================================================================== */

/* --- Flashcard Page Layout Specific Overrides --- */
/* These rules adjust the layout specifically for the flashcard page */
body.flashcard-page-body .app-container {
    /* --- MODIFIED: Adjusted padding-top to account for the lowered header --- */
    /* Increase padding-top by the same amount the header's 'top' was adjusted */
    padding-top: calc(60px + 8px); /* 68px. Using calc is clear or just write 68px */
    /* --- End Modified --- */
    padding-bottom: 90px; /* Keep existing padding-bottom */
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}


body.flashcard-page-body .main-content {
    /* Ensure it centers the card effectively, if your global main-content doesn't */
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 500px; /* Adjust as needed */
}

/* --- Flashcard Header Specific Styling --- */
/* These make the header fixed on the flashcard page */
body.flashcard-page-body .flashcard-header {
    position: fixed;
    /* --- MODIFIED: Pushes the header down from the very top --- */
    top: 8px; /* Moves the header 8px down from the browser's top edge */
    /* --- End Modified --- */
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--bg-light);
    color: var(--text-light);
    /* Keep any padding or other properties you had here */
    padding: 15px 20px; /* Keep your existing header padding */
}



body.flashcard-page-body .flashcard-header .back-link {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 101;
    /* Removed font-size and font-weight, as they apply to text, not SVGs */
    text-decoration: none;     /* Still important to remove underline from the link */
    color: var(--text-dark);   /* This color will be inherited by the SVG */
    display: flex;             /* Added to center the SVG icon */
    align-items: center;       /* Added to center the SVG icon */
    justify-content: center;   /* Added to center the SVG icon */
}
/* NEW: Style the SVG icon specifically within the back-link on the flashcard page */
body.flashcard-page-body .flashcard-header .back-link svg {
    width: 28px;   /* Adjust this size as needed; 24px (1.5rem) or 32px (2rem) are common */
    height: 28px;  /* Maintain aspect ratio, usually square */
    display: block; /* Prevents common issues with inline SVGs adding extra space */
}


/* --- FLASHCARD FLIPPING ANIMATION STYLES (Scoped) --- */
/* The outer container for the flip effect */
body.flashcard-page-body .flashcard-card {
    width: 100%;
    aspect-ratio: 5 / 7; /* Keep your elongated aspect ratio */
    perspective: 1000px; /* This creates the 3D effect for the flip */
    cursor: pointer;
    border-radius: 20px; /* Keep your border-radius */
    background-color: transparent; /* Outer card is transparent, inner faces have color */
    /* Only define properties here that are critical for the 3D container */
}

/* The inner element that actually flips */
body.flashcard-page-body .flashcard-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s; /* Duration of the flip animation */
    transform-style: preserve-3d; /* Key for 3D transformation */
    border-radius: 20px; /* Match outer border-radius */
}

/* Class added by JS to trigger the flip */
body.flashcard-page-body .flashcard-inner.is-flipped {
    transform: rotateY(180deg);
}

/* Styles for both front and back faces */
body.flashcard-page-body .flashcard-face {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden; /* Hide the back of the face when rotated away */
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 30px; /* Use your original padding */
    border-radius: 20px; /* Use your original border-radius */
    background: white; /* Use your original background color */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.07); /* Use your original box-shadow */
    box-sizing: border-box; /* Include padding in element's total width and height */
    color: var(--text-dark); /* Ensure text color is applied to faces */
}

/* Specific rotation for front and back */
body.flashcard-page-body .flashcard-front {
    transform: rotateY(0deg);
}

body.flashcard-page-body .flashcard-back {
    transform: rotateY(180deg); /* Start rotated for the back face */
}

/* Ensure text styles apply within the new face structure */
body.flashcard-page-body .flashcard-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary-accent);
    margin: 0 0 15px 0;
    text-align: center;
    letter-spacing: 1px;
}

body.flashcard-page-body .flashcard-text {
    font-size: 1.3rem;
    line-height: 1.6;
    color: var(--text-dark);
    text-align: center;
    margin: 0;
    max-height: 70%; /* Prevents text overflow for long answers/questions */
    overflow-y: auto; /* Adds scrollbar if content is too long */
}
/* --- END FLASHCARD FLIPPING ANIMATION STYLES --- */

/* --- Flashcard Controls Specific Styling --- */
/* These make the controls fixed at the bottom on the flashcard page */
body.flashcard-page-body .flashcard-controls {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 15px 20px;
    background: var(--bg-light);
    border-top: 1px solid #e2e8f0;
}

/* --- DISABLED BUTTON STYLING (Scoped) --- */
/* This specific styling for disabled buttons only applies on the flashcard page */
body.flashcard-page-body .action-btn:disabled,
body.flashcard-page-body .action-btn.disabled-btn {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #a0a0a0; /* A generic light gray for disabled state */
    color: #e0e0e0; /* A generic lighter text color for disabled state */
    box-shadow: none;
    /* !important might be needed if other global .action-btn:disabled rules are very specific */
}

/* Re-assert primary/secondary colors if the scoped disabled state overrides too much */
body.flashcard-page-body .action-btn.primary {
    background-color: var(--primary-accent);
    color: #fff;
}
body.flashcard-page-body .action-btn.secondary {
    background-color: var(--muted);
    color: var(--text-dark);
}
/* Ensure hover states are still working for non-disabled buttons */
body.flashcard-page-body .action-btn.primary:hover:not(:disabled):not(.disabled-btn) {
    background-color: color-mix(in srgb, var(--primary-accent) 80%, black);
}
body.flashcard-page-body .action-btn.secondary:hover:not(:disabled):not(.disabled-btn) {
    background-color: color-mix(in srgb, var(--muted) 80%, black);
}




/* =================================================================== */
/* ===== ACTIVE QUIZ PAGE ENHANCEMENTS =============================== */
/* =================================================================== */

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

.quiz-progress {
    flex-grow: 1;
}

.quiz-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #f1f5f9;
    color: var(--text-light);
    text-decoration: none;
    flex-shrink: 0;
    transition: background-color 0.2s, color 0.2s;
}

.quiz-close-btn:hover {
    background-color: #e2e8f0;
    color: var(--text-dark);
}

/* =================================================================== */
/* ===== GLASSMORPHISM MODAL V2 (SMOOTHER ANIMATION) ================= */
/* =================================================================== */

#modal-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1001;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease-out;
}

#modal-container.show {
    opacity: 1;
    pointer-events: auto;
}

#modal-content {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    padding: 25px 35px;
    text-align: center;
    width: 80%;
    max-width: 300px;
    transform: scale(0.9);
    transition: transform 0.2s ease-out;
}

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

#modal-content p {
    margin: 0;
    color: var(--text-dark);
    font-weight: 500;
    font-size: 1rem;
    line-height: 1.5;
}

/* =================================================================== */
/* ===== SKELETON LOADER ============================================= */
/* =================================================================== */

.skeleton { 
    opacity: 0.7; 
    animation: skeleton-loading 1s linear infinite alternate; 
}

.skeleton-card { 
    background: #ffffff; 
    padding: 18px; 
    border-radius: 18px; 
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.04); 
    display: flex; 
    align-items: center; 
    gap: 15px; 
    margin-bottom: 14px; 
}

.skeleton-icon { 
    width: 50px; 
    height: 50px; 
    border-radius: 50%; 
    background-color: #e2e8f0; 
}

.skeleton-text-container { 
    flex-grow: 1; 
}

.skeleton-text { 
    height: 12px; 
    border-radius: 4px; 
    background-color: #e2e8f0; 
    margin-bottom: 8px; 
}

.skeleton-text.heading { 
    width: 70%; 
    height: 16px; 
}

.skeleton-text.subheading { 
    width: 50%; 
}

@keyframes skeleton-loading { 
    0% { background-color: #e2e8f0; } 
    100% { background-color: #f8fafc; } 
}
/* =================================================================== */
/* ===== CHAPTER LIST DESIGN FIX ===================================== */
/* =================================================================== */

/* =================================================================== */
/* ===== CHAPTER LIST DESIGN FIX (FOR QUIZ & STUDY) ================== */
/* =================================================================== */

/* --- Updated chapter title font to non-bold and enhanced emoji style --- */
.study-card .study-info h3,
.quiz-card .quiz-info h3 {
    line-height: 1.5;
    font-size: 1.1rem; 
    font-weight: 500; /* Changed from 600 (bold) to 500 (medium) */
    color: #333;
    font-family: 'Poppins', sans-serif; /* Explicitly using your main font */
    letter-spacing: 0.2px; /* Slightly more readable */
}

/* --- Enhanced emoji-based icon with larger size --- */
.study-card .study-icon,
.quiz-card .quiz-icon {
    background-color: #eef2ff;
    color: var(--primary-accent); 
    border-radius: 14px; /* Slightly more rounded */
    width: 52px; /* Increased from 48px */
    height: 52px; /* Increased from 48px */
    font-size: 1.8rem; /* Increased from 1.5rem for larger emojis */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease; /* Smooth hover effects */
}

/* Optional: Add hover effect for better interactivity */
.study-card:hover .study-icon,
.quiz-card:hover .quiz-icon {
    transform: scale(1.05);
    background-color: #e0e7ff;
}

/* --- Removes the old rule for the SVG, which is no longer needed --- */
.study-card .study-icon svg,
.quiz-card .quiz-icon svg {
    display: none;
}

/* --- Chapter description text style (if needed) --- */
.study-card .study-info p,
.quiz-card .quiz-info p {
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 400; /* Regular weight for descriptions */
    line-height: 1.4;
    margin: 4px 0 0;
}

.quiz-card.error-card {
    pointer-events: none; /* Make it unclickable */
    opacity: 0.6; /* Dim it out */
    border: 1px solid #d9534f; /* Red border to highlight error */
    background-color: #fdd; /* Light red background */
    cursor: not-allowed;
}

.quiz-card.error-card .quiz-info h3,
.quiz-card.error-card .quiz-info p {
    color: #d9534f; /* Make text red */
}

/* Profile Page Specific Styles */
.profile-main-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    width: 100%;
    box-sizing: border-box;
}

.profile-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.profile-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    color: white;
    margin-right: 16px;
    flex-shrink: 0;
}

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

.profile-name {
    font-size: 18px;
    font-weight: 600;
    color: #2d3748;
    margin: 0 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-email {
    font-size: 14px;
    color: #718096;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Horizontal Stats Row - 3 items side by side */
.profile-stats-single {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
}

.profile-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #f7fafc;
    padding: 16px 12px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    flex: 1;
    min-width: 0;
    box-sizing: border-box;
    text-align: center;
}

.profile-stat .stat-icon {
    font-size: 20px;
    margin-bottom: 8px;
}

.profile-stat .stat-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
    width: 100%;
}

.stat-label {
    font-size: 11px;
    color: #718096;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.stat-value {
    font-size: 16px;
    font-weight: 700;
    color: #2d3748;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

/* Edit Profile Section */
.edit-profile-section {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    width: 100%;
    box-sizing: border-box;
}

.edit-profile-section h3 {
    margin: 0 0 16px 0;
    color: #2d3748;
    font-size: 18px;
    font-weight: 600;
}

.input-group {
    margin-bottom: 16px;
    width: 100%;
}

.input-group label {
    display: block;
    margin-bottom: 6px;
    color: #4a5568;
    font-weight: 500;
    font-size: 14px;
}

.profile-input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.profile-input:focus {
    outline: none;
    border-color: #667eea;
}

.profile-input:disabled {
    background-color: #f7fafc;
    color: #a0aec0;
    cursor: not-allowed;
}

/* Buttons */
.btn-primary {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 10px;
    transition: transform 0.2s ease;
    box-sizing: border-box;
}

.btn-primary:hover {
    transform: translateY(-2px);
}

.btn-secondary {
    width: 100%;
    padding: 14px;
    background: #e53e3e;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
    box-sizing: border-box;
}

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

/* Responsive Design */
@media (max-width: 380px) {
    .profile-stats-single {
        gap: 8px;
    }
    
    .profile-stat {
        padding: 12px 8px;
    }
    
    .profile-stat .stat-icon {
        font-size: 18px;
        margin-bottom: 6px;
    }
    
    .stat-value {
        font-size: 14px;
    }
    
    .stat-label {
        font-size: 10px;
    }
}
/*
 * =========================================
 * 1. FIX FOR SCROLLING & LAYOUT
 * =========================================
 */

/* Make the body take up the full screen, no margin */
body.app-body {
    margin: 0;
    overflow: hidden; /* Prevents the whole window from scrolling */
}

/* Fix the header to the top */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: #fff; /* Ensure it has a background */
    box-shadow: 0 2px 4px rgba(0,0,0,0.05); /* Optional shadow */
}

/* Fix the bottom nav to the bottom */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: #fff; /* Ensure it has a background */
    box-shadow: 0 -2px 4px rgba(0,0,0,0.05); /* Optional shadow */
}

/* Fix the purple "You" bar above the nav */
.current-user-rank {
    position: fixed;
    /* Adjust '65px' to match your bottom-nav's height */
    bottom: 75px; 
    left: 16px;  /* Add margin */
    right: 16px; /* Add margin */
    z-index: 99;
    
    /* Styles from your image */
    background-color: #6a5be2; /* Your purple color */
    color: white;
    padding: 12px 16px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(106, 91, 226, 0.4);
    
    /* This makes it look like your JS wants it to */
    display: flex;
    align-items: center;
    gap: 12px;
}

/* --- THE MAIN SCROLLING FIX --- */
/* Make the .app-container the part that scrolls */
.app-container {
    /* Set heights for your fixed bars. 
      Adjust these to match your design!
    */
    --header-height: 60px;
    --nav-height: 65px;
    --user-bar-height: 80px; /* Height of purple bar + its margins */

    overflow-y: auto; /* THIS IS THE KEY: Makes this area scroll */
    height: 100vh;    /* Takes up the full screen */
    box-sizing: border-box; /* Crucial! */

    /* THIS IS THE OTHER KEY:
      Add padding so content clears the fixed bars.
    */
    padding-top: var(--header-height);
    padding-bottom: calc(var(--nav-height) + var(--user-bar-height) + 10px);
}


/*
 * =========================================
 * 2. FIX FOR TOP 3 CARD STYLES
 * =========================================
 */

/* This container aligns the 3 cards */
.leaderboard-top3 {
    display: flex;
    justify-content: center;
    align-items: flex-end; /* Aligns them at the bottom */
    gap: 8px; /* Space between cards */
    margin-bottom: 24px;
}

/* Base style for ALL 3 top players */
.top-player {
    flex: 1; /* Make them share space */
    min-width: 90px;
    padding: 16px 8px;
    border-radius: 12px;
    background-color: #fff;
    text-align: center;
    border: 2px solid #f0f0f0; /* Default border for consistency */
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    transition: all 0.2s ease-in-out;
}

/* Style for Rank 1 (Gold) - makes it pop */
.top-player.gold {
    border-color: #FFD700; /* Gold */
    transform: translateY(-10px); /* Lifts it up */
    font-weight: 600;
}

/* Style for Rank 2 (Silver) - YOU WERE MISSING THIS */
.top-player.silver {
    border-color: #C0C0C0; /* Silver */
}

/* Style for Rank 3 (Bronze) - YOU WERE MISSING THIS */
.top-player.bronze {
    border-color: #CD7F32; /* Bronze */
}

/* Fixes long names like "Risabh kum..." */
.top-player h3 {
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 8px;
    margin-bottom: 4px;
}

.top-player p {
    font-size: 0.8rem;
    color: #555;
    margin: 0;
}
/* Simple Notification System */
.notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #4CAF50;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    font-weight: 500;
    max-width: 90%;
    text-align: center;
    font-family: 'Poppins', sans-serif;
    box-sizing: border-box;
}

.notification.show {
    display: block;
}

.notification.error {
    background: #f44336;
}

.notification.info {
    background: #2196F3;
}

.notification.warning {
    background: #ff9800;
}

.notification.success {
    background: #4CAF50;
}
/* Custom Confirm Dialog */
.custom-confirm {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.custom-confirm.show {
    display: flex;
}

.confirm-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.confirm-dialog {
    background: white;
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    max-width: 300px;
    width: 90%;
    text-align: center;
    z-index: 10001;
    position: relative;
}

.confirm-message {
    font-size: 16px;
    color: #2d3748;
    margin-bottom: 20px;
    line-height: 1.4;
    font-weight: 500;
}

.confirm-buttons {
    display: flex;
    gap: 12px;
}

.confirm-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.confirm-cancel {
    background: #e2e8f0;
    color: #4a5568;
}

.confirm-cancel:hover {
    background: #d1d9e6;
}

.confirm-ok {
    background: #e53e3e;
    color: white;
}

.confirm-ok:hover {
    background: #c53030;
}

/* Quiz Hub Specific Styles */
.capsules-section {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 25px 0;
    padding: 0 10px;
}

.capsules-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scrollbar-width: none;
    flex: 1;
    padding: 5px 0;
}

.capsules-scroll::-webkit-scrollbar {
    display: none;
}

.capsule {
    padding: 10px 20px;
    background: var(--bg-white);
    border: 2px solid #e2e8f0;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.9rem;
    color: #64748b;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.capsule.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.capsule:hover:not(.active) {
    border-color: #667eea;
    color: #667eea;
}

.filter-icon {
    width: 45px;
    height: 45px;
    background: var(--bg-white);
    border: 2px solid #e2e8f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.filter-icon:hover, .filter-icon.active {
    background: #667eea;
    border-color: #667eea;
}

.filter-icon:hover svg, .filter-icon.active svg {
    fill: white;
}

.filter-icon svg {
    fill: #64748b;
    transition: fill 0.3s ease;
}

/* Filter Dropdown */
.filter-dropdown {
    position: absolute;
    top: 180px;
    right: 20px;
    background: var(--bg-white);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    padding: 10px;
    z-index: 100;
    display: none;
    min-width: 160px;
    border: 1px solid #e2e8f0;
}

.filter-dropdown.show {
    display: block;
    animation: slideDown 0.2s ease;
}

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

.filter-option {
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    color: #374151;
    transition: all 0.2s ease;
}

.filter-option:hover {
    background: #f3f4f6;
}

.filter-option.active {
    background: #eef2ff;
    color: #4f46e5;
}

/* Tests Container */
.tests-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 20px;
}

.test-card {
    background: var(--bg-white);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.test-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    border-color: rgba(139, 92, 246, 0.3);
}

.test-card.resume {
    border-left: 4px solid #f59e0b;
}

.test-card.attempted {
    border-left: 4px solid #10b981;
}

.test-card.unattempted {
    border-left: 4px solid #3b82f6;
}

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

.test-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

.test-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-pyq { background: #fef3c7; color: #d97706; }
.badge-aits { background: #dbeafe; color: #1d4ed8; }
.badge-mock { background: #f3e8ff; color: #7c3aed; }
.badge-recommended { background: #dcfce7; color: #166534; }

.test-subtitle {
    color: #6b7280;
    font-size: 0.9rem;
    margin-bottom: 15px;
    line-height: 1.5;
}

.test-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #4b5563;
    font-size: 0.85rem;
}

.meta-item svg {
    width: 16px;
    height: 16px;
    fill: #6b7280;
}

.meta-value {
    font-weight: 600;
    color: #1f2937;
}

.test-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid #f3f4f6;
}

.test-date {
    font-size: 0.8rem;
    color: #9ca3af;
}

.test-action {
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-resume { background: #fef3c7; color: #d97706; }
.btn-start { background: #4f46e5; color: white; }
.btn-review { background: #e0f2fe; color: #0ea5e9; }

.btn-resume:hover { background: #fcd34d; }
.btn-start:hover { background: #4338ca; }
.btn-review:hover { background: #bae6fd; }

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.empty-state svg {
    width: 80px;
    height: 80px;
    fill: #d1d5db;
    margin-bottom: 20px;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.quick-action-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--bg-white);
    border-radius: 16px;
    text-decoration: none;
    border: 2px solid #f1f5f9;
    transition: all 0.3s ease;
    cursor: pointer;
}

.quick-action-card:hover {
    border-color: var(--learning-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.15);
}

.action-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--learning-color), #7c3aed);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.action-info {
    flex: 1;
}

.action-info h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0 0 4px 0;
}

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

.action-arrow {
    color: var(--text-light);
    font-size: 1.2rem;
    font-weight: 600;
    transition: transform 0.3s ease;
}

.quick-action-card:hover .action-arrow {
    transform: translateX(4px);
    color: var(--learning-color);
}

/* Responsive Quick Actions */
@media (max-width: 480px) {
    .quick-action-card {
        padding: 16px;
        gap: 12px;
    }
    
    .action-icon {
        width: 40px;
        height: 40px;
        font-size: 1.3rem;
    }
    
    .action-info h3 {
        font-size: 1rem;
    }
    
    .action-info p {
        font-size: 0.85rem;
    }
}

/* Bookmarks Page Styles */
.bookmarks-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: var(--bg-white);
    border-radius: 16px;
    border: 2px solid #f1f5f9;
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--learning-color), #7c3aed);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.stat-card .stat-info {
    display: flex;
    flex-direction: column;
}

.stat-card .stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1;
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 4px;
}

/* Practice All Button */
.practice-all-section {
    margin-bottom: 25px;
}

.btn-primary.full-width {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    font-size: 1rem;
    font-weight: 600;
}

.btn-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Bookmarks List */
.bookmarks-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bookmark-item {
    background: var(--bg-white);
    border: 2px solid #f1f5f9;
    border-radius: 16px;
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.bookmark-item:hover {
    border-color: var(--learning-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.15);
}

.bookmark-content {
    margin-bottom: 15px;
}

.bookmark-question {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-dark);
    line-height: 1.5;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bookmark-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.bookmark-tag {
    background: #f3f0ff;
    color: var(--learning-color);
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.bookmark-set {
    background: #f0f9ff;
    color: #0ea5e9;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.bookmark-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.bookmark-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}
.bookmark-btn.primary {
    background: transparent;
    color: var(--learning-color);
    border: 2px solid var(--learning-color); /* Visible outline */
}

.bookmark-btn.primary:hover {
    background: #7c3aed;
    transform: translateY(-1px);
}

.bookmark-btn.secondary {
    background: #f1f5f9;
    color: var(--text-dark);
}

.bookmark-btn.secondary:hover {
    background: #e2e8f0;
}

.bookmark-btn svg {
    width: 16px;
    height: 16px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-white);
    border-radius: 20px;
    border: 2px dashed #e2e8f0;
}

.empty-state .empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.3rem;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-light);
    margin-bottom: 25px;
}

/* Back Button */
.back-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f1f5f9;
    color: var(--text-light);
    text-decoration: none;
    transition: all 0.2s ease;
}

.back-button:hover {
    background: #e2e8f0;
    color: var(--text-dark);
}

/* Loading State */
.bookmark-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--text-light);
}

.skeleton-loader {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 8px;
}

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
    border-radius: 4px;
}

.skeleton-text.short {
    width: 60%;
}

.skeleton-tag {
    height: 24px;
    width: 80px;
    border-radius: 12px;
}

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

/* Responsive Bookmarks */
@media (max-width: 768px) {
    .bookmarks-stats {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-card .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1.3rem;
    }
    
    .stat-card .stat-value {
        font-size: 1.5rem;
    }
    
    .bookmark-item {
        padding: 16px;
    }
    
    .bookmark-actions {
        flex-direction: column;
    }
    
    .bookmark-btn {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .bookmark-meta {
        flex-direction: column;
        gap: 8px;
    }
    
    .empty-state {
        padding: 40px 16px;
    }
    
    .empty-state .empty-icon {
        font-size: 3rem;
    }
}




