/* Main App Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', 'Noto Sans KR', sans-serif;
    /* Premium Midnight Background */
    background: radial-gradient(circle at 50% 0%, #2c2c2e 0%, #1c1c1e 40%, #000000 100%);
    background-attachment: fixed;
    color: #f5f5f7;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* --- DEBUG CONSOLE --- */
#debug-console {
    display: none;
    /* HIDDEN BY DEFAULT, SHOWN ON ERROR */
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30%;
    background: rgba(30, 0, 0, 0.95);
    color: #fcc;
    z-index: 99999;
    overflow: auto;
    border-top: 2px solid #f00;
    font-size: 11px;
    padding: 10px;
    font-family: monospace;
}

#debug-console.visible {
    display: block;
}

.log-line {
    margin-bottom: 4px;
    border-bottom: 1px solid #400;
    padding: 2px 0;
}

#root {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* HEADER */
header {
    width: 100%;
    height: auto;
    /* Slightly taller for larger logo */
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 24px 14px 24px;
    background: rgba(20, 20, 22, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 2px solid #ffffff;
    z-index: 100;
    position: sticky;
    top: 0;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.brand {
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -1px;
    color: #FF6600;
    cursor: pointer;
    filter: drop-shadow(0 0 15px rgba(255, 102, 0, 0.4));
    font-family: 'Roboto Slab', serif;
    font-style: normal;
    padding-right: 10px;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.membership-badge {
    font-size: 0.8rem;
    color: #00f7ff;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    background: rgba(0, 247, 255, 0.1);
    padding: 6px 12px;
    border-radius: 20px;
    border: 1.5px solid rgba(0, 247, 255, 0.4);
    transition: all 0.2s ease;
}

.membership-badge:hover {
    background: rgba(0, 247, 255, 0.2);
    border-color: #00f7ff;
    transform: translateY(-1px);
}

.voice-toggle {
    font-size: 0.8rem;
    color: #a1a1a6;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.05);
    padding: 6px 12px;
    border-radius: 20px;
    transition: 0.2s;
}

.voice-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.level-toggle {
    display: flex;
    background: rgba(118, 118, 128, 0.24);
    padding: 2px;
    border-radius: 8px;
}

.level-opt {
    padding: 4px 10px;
    font-size: 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    color: #a1a1a6;
    font-weight: 600;
    transition: 0.2s;
}

.level-opt.active {
    background: #FFE100;
    /* Yellow active state */
    color: #000;
    font-weight: 700;
    box-shadow: 0 0 10px rgba(255, 225, 0, 0.4);
}

/* DASHBOARD */
.main-container {
    flex: 1;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    padding-bottom: 80px;
}

.dashboard-content {
    padding: 16px 20px 24px 20px;
}

/* Mobile: Add breathing room */
@media (max-width: 480px) {
    .dashboard-content {
        padding: 0px 16px 20px 16px;
        /* Reduced from 5px top */
    }
}

/* TABS */
.mode-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    gap: 12px;
    background: rgba(255, 255, 255, 0.05);
    /* [MODIFIED] Lighter/Weaker background */
    padding: 4px;
    border-radius: 16px;
    width: 60%;
    /* [MODIFIED] Reduced to match content card alignment */
    margin-left: auto;
    margin-right: auto;
}

.mode-tab {
    padding: 10px 24px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    background: transparent;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 2px solid rgba(255, 193, 7, 0.4);
    box-shadow: 0 0 15px rgba(255, 193, 7, 0.3), 0 0 25px rgba(255, 193, 7, 0.15);
    display: flex;
    align-items: center;
    gap: 6px;
}

.mode-tab:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 20px rgba(255, 193, 7, 0.5), 0 0 35px rgba(255, 193, 7, 0.25);
}

.mode-tab.active {
    background: linear-gradient(135deg, #FFE100 0%, #FFB800 100%) !important;
    color: #000 !important;
    box-shadow: 0 0 25px rgba(255, 193, 7, 0.6), 0 0 45px rgba(255, 193, 7, 0.4), inset 0 0 15px rgba(255, 193, 7, 0.2);
    border: 2px solid rgba(255, 193, 7, 0.8);
    font-weight: 800;
    transform: scale(1.01);
}

/* SECTION HEADERS */
.section-header {
    font-size: 1.3rem;
    font-weight: 800;
    color: #fff;
    margin-top: 40px;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-left: 4px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    border-left: 4px solid #FF6600;
    padding-left: 12px;
}

/* GRID CARDS */
.category-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}



.card {
    /* Glassmorphism V2 - Lighter & Glossier */
    background: linear-gradient(145deg, rgba(40, 40, 45, 0.6) 0%, rgba(20, 20, 25, 0.8) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: auto;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.3);
}

.card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: rgba(255, 102, 0, 0.4);
    box-shadow: 0 15px 35px -5px rgba(255, 102, 0, 0.15);
}

/* [NEW] Premium Dark Glass Card Style - "Apple Dark Mode" Vibe */
.vocab-card-white {
    background: linear-gradient(135deg, rgba(30, 30, 35, 0.9) 0%, rgba(15, 15, 20, 0.95) 100%);
    border: 2px solid rgba(0, 247, 255, 0.4);
    color: #fff;
    box-shadow: 0 4px 20px rgba(0, 247, 255, 0.15), inset 0 0 15px rgba(0, 247, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 24px 24px;
    min-height: 120px;
    position: relative;
    border-radius: 20px;
    overflow: hidden;
}

.vocab-card-white:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 10px 30px rgba(0, 247, 255, 0.4), inset 0 0 20px rgba(0, 247, 255, 0.15);
    border-color: #00f7ff;
    background: linear-gradient(135deg, rgba(40, 40, 45, 0.9) 0%, rgba(20, 20, 25, 0.95) 100%);
}

.vocab-card-white .card-title {
    color: #fff;
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 6px;
    text-align: left;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    width: 100%;
}

.vocab-card-white .card-sub {
    color: #00CED1;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: left;
}

.vocab-card-white .count-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    margin-top: 0;

    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #000;
    font-weight: 800;

    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    border: none;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4), inset 0 -2px 5px rgba(0, 0, 0, 0.1);
    letter-spacing: -0.3px;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.4);
}

.vocab-card-white .arrow-icon {
    display: none;
    /* Removed as requested */
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.03), transparent);
    transform: translateX(-100%);
    transition: 0.5s;
}

.card:hover::before {
    transform: translateX(100%);
}

.card-icon {
    font-size: 2.2rem;
    margin-bottom: 16px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
    margin-bottom: 4px;
}

.card-sub {
    font-size: 0.8rem;
    color: #a1a1a6;
    line-height: 1.4;
}

/* FOOTER STYLES */
.footer {
    background: #0a0a0a;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 40px 20px 20px;
    margin-top: auto;
    width: 100%;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.footer-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: #FF6600;
    margin-bottom: 10px;
    font-family: 'Roboto Slab', serif;
}

.footer-info {
    color: #86868b;
    font-size: 0.85rem;
    line-height: 1.6;
    margin-bottom: 15px;
}

.footer-links {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.footer-link {
    color: #86868b;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.footer-link:hover {
    color: #FF6600;
}

.footer-copyright {
    color: #666;
    font-size: 0.8rem;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

@media (max-width: 768px) {
    .footer {
        padding: 30px 15px 15px;
    }

    .footer-links {
        flex-direction: column;
        gap: 10px;
    }

    .footer-brand {
        font-size: 1.3rem;
    }
}

/* BOTTOM CTA */
.login-cta {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #00f7ff 0%, #00c6ff 100%);
    color: #000;
    font-weight: 800;
    padding: 16px 32px;
    border-radius: 100px;
    box-shadow: 0 4px 25px rgba(0, 247, 255, 0.4);
    cursor: pointer;
    z-index: 500;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    white-space: nowrap;
    border: 2px solid rgba(255, 255, 255, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.login-cta:hover {
    transform: translateX(-50%) scale(1.05) translateY(-5px);
    box-shadow: 0 10px 40px rgba(0, 247, 255, 0.6);
}

/* LEARNING VIEW */
.learning-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 24px;
    text-align: center;
    justify-content: center;
}

.passage-box {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    padding: 24px;
    border-radius: 20px;
    text-align: left;
    font-size: 1.05rem;
    line-height: 1.7;
    color: #d1d1d6;
    margin-bottom: 24px;
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.2);
    white-space: pre-wrap;
}

.sentence-ko {
    font-size: 1.7rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 28px;
    word-break: keep-all;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.sentence-en-box {
    background: rgba(30, 30, 35, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 24px;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    transition: 0.2s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.sentence-en-box:active {
    transform: scale(0.98);
    background: rgba(44, 44, 46, 0.8);
}

.en-text {
    font-size: 1.7rem;
    background: linear-gradient(120deg, #00f7ff, #00c6ff);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

.choices-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.choice-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 18px;
    border-radius: 14px;
    color: #eeeeee;
    font-size: 1rem;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
}

.choice-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(5px);
    border-color: rgba(255, 255, 255, 0.2);
}

.choice-btn.correct {
    border-color: #30d158;
    color: #30d158;
    background: rgba(48, 209, 88, 0.15);
    box-shadow: 0 0 15px rgba(48, 209, 88, 0.2);
}

.choice-btn.incorrect {
    border-color: #ff453a;
    color: #ff453a;
    background: rgba(255, 69, 58, 0.15);
    box-shadow: 0 0 15px rgba(255, 69, 58, 0.2);
}

/* [NEW] CHUNKING LEVEL BUTTONS */
.chunking-level-btn {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.01) 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.chunking-level-btn:hover {
    transform: translateY(-5px) !important;
    border-color: rgba(0, 247, 255, 0.5) !important;
    box-shadow: 0 10px 30px -5px rgba(0, 247, 255, 0.3) !important;
    background: linear-gradient(135deg, rgba(0, 247, 255, 0.2) 0%, rgba(0, 198, 255, 0.1) 100%) !important;
}

.chunking-ko {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 4px;
    color: #fff;
}

.chunking-en {
    font-size: 0.9rem;
    color: #a1a1a6;
    font-weight: 500;
}

.chunking-level-btn:hover .chunking-en {
    color: #fff;
}

.next-btn {
    margin-top: 30px;
    background: #00f7ff;
    color: #000;
    font-weight: 800;
    width: 100%;
    padding: 18px;
    border-radius: 14px;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 247, 255, 0.3);
    transition: all 0.2s;
}

.next-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 247, 255, 0.5);
}

/* GLOBAL INPUT OVERRIDES */
input {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(10px);
    transition: 0.3s !important;
    color: #fff !important;
}

input:focus {
    border-color: #00f7ff !important;
    box-shadow: 0 0 15px rgba(0, 247, 255, 0.2) !important;
    background: rgba(255, 255, 255, 0.08) !important;
}

/* [MODIFIED] GLOBAL BOTTOM BACK BUTTON - PREMIUM GLASS STYLE */
.global-bottom-back-btn {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(30, 30, 35, 0.6);
    /* Darker Glass */
    border: 1px solid rgba(255, 255, 255, 0.2);
    /* Subtle White Border */
    color: #fff;
    /* White Text */
    padding: 12px 28px;
    border-radius: 100px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    z-index: 9999;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    white-space: nowrap;
    letter-spacing: 0.5px;
}

.global-bottom-back-btn:hover {
    transform: translateX(-50%) translateY(-3px);
    background: rgba(255, 255, 255, 0.1);
    border-color: #fff;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    color: #fff;
}

.global-bottom-back-btn:active {
    transform: translateX(-50%) scale(0.96);
    background: rgba(255, 255, 255, 0.05);
}



/* MOBILE OPTIMIZATION < 480px */
@media (max-width: 480px) {
    .main-container {
        width: 100%;
        padding: 0px 16px 80px 16px;
        /* Reduced from 5px top */
    }

    /* HEADER COMPACTING */
    header {
        height: auto;
        padding: 5px 12px 0px 12px;
        /* Set bottom padding to 0 */
        margin-bottom: 0px;
    }

    .brand {
        font-size: 1.3rem;
        padding-right: 0;
    }

    .header-controls {
        gap: 6px;
    }

    .voice-toggle {
        padding: 4px 8px;
        font-size: 0.75rem;
    }

    .membership-badge {
        font-size: 0.7rem;
    }

    /* TABS: FORCE HORIZONTAL ROW LIKE PC */
    /* Fixed overflow issue by allowing wrapping and reducing size */
    .mode-tabs {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        /* NEW: Allow wrapping for 2x2 grid */
        gap: 8px;
        /* Slightly increased gap */
        background: rgba(0, 0, 0, 0.3);
        padding: 8px;
        /* More padding */
        border-radius: 12px;
        margin-bottom: 24px;
    }

    .mode-tab {
        flex: 1 1 45%;
        /* NEW: Basis 45% forces 2 items per row */
        padding: 12px 0;
        /* Taller touch target */
        /* Minimal side padding */
        font-size: 0.9rem;
        /* Restore readable font size */
        /* Smaller font to fit 3 items */
        line-height: 1.25;
        justify-content: center;
        border-radius: 8px;
        text-align: center;
        /* white-space: nowrap;  <-- REMOVED to allow <br/> to work */
    }

    .mode-tab span {
        display: block;
    }

    /* Ensure text block behaves */
    .mode-tab i {
        display: none;
    }

    /* OPTIONAL: Hide icons on really small screens if needed, strictly text might be cleaner? let's keep icons but small */
    .mode-tab i {
        font-size: 0.9rem;
        margin-right: 3px;
        display: inline-block;
    }

    /* IF screen is VERY narrow, maybe stack icon on top? */
    @media (max-width: 360px) {
        .mode-tab {
            flex-direction: column;
            gap: 2px;
        }

        .mode-tab i {
            margin-right: 0;
            margin-bottom: 2px;
        }
    }

    /* GRID & CONTENT */
    .section-header {
        margin-top: 5px !important;
        /* Extremely tight */
        margin-bottom: 8px !important;
        font-size: 1.1rem;
    }

    .category-grid {
        gap: 10px;
    }

    /* [MODIFIED] Max Compact Card Style */
    .card {
        padding: 12px 16px;
        /* [MODIFIED] Reduced padding (Vertical 12px) */
        min-height: 64px;
        /* [MODIFIED] Reduced height (was 80px) */
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        background: linear-gradient(145deg, #1c1c1e 0%, #151515 100%);
        border: 1px solid rgba(255, 255, 255, 0.08);
        /* Thinner look */
        transition: all 0.2s;
    }

    /* Deleted .card-icon style */

    .card-title {
        font-size: 1.05rem;
        /* [MODIFIED] Slightly smaller */
        font-weight: 700;
        margin-bottom: 2px;
        /* [MODIFIED] Tighter spacing */
        line-height: 1.1;
    }

    .card-sub {
        font-size: 0.8rem;
        /* [MODIFIED] Smaller subtext */
        color: #888;
        line-height: 1.2;
    }

    /* Section Header Polish */
    .section-header {
        font-size: 1.15rem;
        margin-top: 32px;
        margin-bottom: 16px;
        border-left-width: 3px;
        padding-left: 10px;
    }

    /* LEARNING VIEW SCALING */
    .en-text {
        font-size: 1.35rem;
    }

    .passage-box {
        padding: 16px;
        font-size: 0.95rem;
    }

    .choice-btn {
        padding: 14px;
        font-size: 0.9rem;
    }

    .next-btn {
        padding: 15px;
        font-size: 1rem;
    }

    /* CTA */
    .login-cta {
        width: 90%;
        bottom: 20px;
        padding: 12px 20px;
        font-size: 0.9rem;
    }


    /* [NEW] Mobile Compact Card for Pattern English */
    .vocab-card-white {
        padding: 12px 14px;
        /* Even more compact on mobile */
        min-height: 85px;
        /* Smaller height */
        border-radius: 16px;
    }

    .vocab-card-white .card-title {
        font-size: 0.95rem;
        /* Smaller title on mobile */
        margin-bottom: 3px;
    }

    .vocab-card-white .card-sub {
        font-size: 0.7rem;
        /* Smaller subtitle on mobile */
    }

    .vocab-card-white .count-badge {
        top: 10px;
        right: 10px;
        padding: 3px 8px;
        font-size: 0.65rem;
    }

}

/* CLOSE EXISTING MOBILE QUERY (max-width: 480px) */

/* --- NEW GLOBAL ANALYSIS STYLES (Applies to all widths first) --- */
.csat-sentence-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.csat-chunk-item {
    cursor: pointer;
    position: relative;
    padding: 6px 10px;
    border-radius: 6px;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.csat-chunk-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.csat-chunk-item.active {
    background: rgba(0, 247, 255, 0.15);
    border: 1px solid rgba(0, 247, 255, 0.5);
}

.chunk-analysis-item {
    margin-bottom: 12px;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
}

.chunk-analysis-content {
    margin-right: 8px;
}

.chunk-analysis-trans {
    color: #ffcc00;
    font-size: 0.9em;
}


/* EXAM MODE CHUNK ANALYSIS */
.exam-chunk-item {
    margin-bottom: 8px;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
}

.exam-chunk-en {
    color: #fff;
    font-size: 1rem;
    margin-right: 8px;
}

.exam-chunk-ko {
    color: #a1a1a6;
    font-size: 0.9rem;
}

/* --- EXTENDED MOBILE OVERRIDES (Up to 600px for better coverage) --- */
@media (max-width: 600px) {

    /* 1. CSAT Reading View Stacking */
    .csat-sentence-container {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }

    .csat-chunk-item {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        background: rgba(255, 255, 255, 0.03);
        margin-bottom: 4px;
        padding: 12px;
    }

    .csat-chunk-item span {
        /* English text block */
        display: block;
        width: 100%;
        margin-bottom: 6px;
        /* Spacing between En and Ko */
    }

    .csat-chunk-item div {
        /* Korean translation div (injected by React) */
        width: 100%;
        margin-top: 0 !important;
        /* Override inline margin */
        padding-left: 0 !important;
    }

    /* 2. Chunk Practice View Stacking */
    .chunk-analysis-item {
        flex-direction: column;
        align-items: flex-start;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        padding-bottom: 10px;
        margin-bottom: 16px;
    }

    .chunk-analysis-content {
        display: block;
        width: 100%;
        margin-bottom: 6px;
        line-height: 1.5;
    }

    .chunk-analysis-trans {
        display: block;
        width: 100%;
        margin-left: 0;
        color: #ffcc00;
        opacity: 0.95;
    }

    /* 3. Exam Mode Stacking (New) */
    .exam-chunk-item {
        flex-direction: column;
        align-items: flex-start;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        padding-bottom: 6px;
        margin-bottom: 10px;
    }

    .exam-chunk-en {
        display: block;
        width: 100%;
        margin-right: 0;
        margin-bottom: 4px;
        line-height: 1.5;
    }

    .exam-chunk-ko {
        display: block;
        width: 100%;
        color: #ffcc00;
        opacity: 0.95;
    }
}

/* HEADER BUTTON STYLES & MOBILE OPTIMIZATION */
.header-btn {
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 24px;
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-membership {
    border: 2px solid #30d158;
    color: #30d158;
    background: rgba(48, 209, 88, 0.05);
}

.btn-membership:hover {
    box-shadow: 0 0 10px rgba(48, 209, 88, 0.3);
    background: rgba(48, 209, 88, 0.1);
}

.btn-login {
    background: rgba(255, 0, 153, 0.05);
    border: 2px solid #FF0099;
    color: #FF0099;
    backdrop-filter: blur(10px);
    box-shadow: 0 0 10px rgba(255, 0, 153, 0.3), inset 0 0 5px rgba(255, 0, 153, 0.1);
}

.btn-login:hover {
    box-shadow: 0 0 20px rgba(255, 0, 153, 0.6), inset 0 0 10px rgba(255, 0, 153, 0.2);
    text-shadow: 0 0 8px rgba(255, 0, 153, 0.8);
}

.btn-signup {
    background: linear-gradient(135deg, #FF6600 0%, #FF8800 100%) !important;
    /* Orange Gradient */
    color: #fff !important;
    font-weight: 800;
    box-shadow: 0 4px 15px rgba(255, 102, 0, 0.4);
    border: none !important;
}

.btn-signup:hover {
    transform: translateY(-2px);
}

/* MOBILE HEADER OPTIMIZATION */
@media (max-width: 600px) {
    .header-controls {
        gap: 6px;
    }

    .header-btn {
        padding: 6px 10px;
        /* Smaller padding */
        font-size: 0.8rem;
        /* Smaller font */
        border-width: 1.5px;
        /* Thinner borders */
        height: 32px;
        /* Fixed height for alignment */
    }

    .brand {
        font-size: 1.4rem;
        /* Smaller logo */
    }
}

/* [NEW] LOGIN OVERLAY STYLES */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

.login-card {
    background: #1c1c1e;
    padding: 40px;
    border-radius: 24px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    position: relative;
}

.google-btn {
    background: #fff;
    color: #000;
    font-weight: 600;
    padding: 12px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: 0.2s;
    margin-bottom: 20px;
}

.google-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.skeleton {
    background: linear-gradient(90deg, #1e1e24 25%, #2a2a30 50%, #1e1e24 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
    border-radius: 8px;
    opacity: 0.7;
}

.skeleton-text {
    height: 20px;
    margin-bottom: 10px;
}

.skeleton-block {
    height: 100px;
    margin-bottom: 20px;
}

/* TOAST */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    pointer-events: none;
}

.toast {
    background: rgba(20, 20, 25, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 12px 24px;
    border-radius: 50px;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    animation: slideDownFade 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: auto;
}

.toast.error {
    border-color: #ff453a;
    color: #ff453a;
}

.toast.success {
    border-color: #30d158;
    color: #30d158;
}

@keyframes slideDownFade {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* --- RESPONSIVE HEADER STYLES (Added Step 223) --- */

/* Base Styles for New Classes */
.user-status-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    /* Allow consistent wrapping */
}

.header-text-btn {
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.inquiry-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    backdrop-filter: blur(5px);
}

.inquiry-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #fff;
    transform: translateY(-2px);
}

.record-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    gap: 4px;
}

.record-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.user-name-display {
    color: #fff;
    font-weight: bold;
    font-size: 0.9rem;
    white-space: nowrap;
}

.user-info-group {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 5px;
    width: 100%;
}

.admin-dashboard-btn {
    cursor: pointer;
    padding: 6px 16px;
    border-radius: 20px;
    border: 1px solid #FF8800;
    color: #FF8800;
    background: rgba(255, 136, 0, 0.1);
    font-weight: bold;
    font-size: 0.9rem;
    margin-left: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
    text-shadow: 0 0 5px rgba(255, 136, 0, 0.3);
    white-space: nowrap;
    transition: all 0.2s;
}

.admin-dashboard-btn:hover {
    background: rgba(255, 136, 0, 0.2);
    transform: scale(1.05);
}

.logout-btn {
    font-size: 0.8rem;
    cursor: pointer;
    color: #FFE100;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 20px;
    background: rgba(255, 225, 0, 0.1);
    border: 1.5px solid rgba(255, 225, 0, 0.4);
    transition: all 0.2s ease;
    margin-left: 8px;
    white-space: nowrap;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logout-btn:hover {
    background: rgba(255, 225, 0, 0.2);
    border-color: #FFE100;
    color: #FFE100;
    transform: translateY(-1px);
}

/* --- MOBILE LAYOUT (< 768px) --- */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        /* Vertical Stack */
        align-items: flex-start;
        padding: 10px 15px;
        height: auto;
        gap: 5px;
    }

    /* Brand tweaks for mobile */
    .brand {
        font-size: 1.8rem;
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        padding-bottom: 5px;
        margin-bottom: 2px;
    }

    /* Container for controls */
    .header-controls {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        /* Maximum separation */
        gap: 10px;
    }

    /* User Row */
    .user-status-row {
        flex: 1;
        justify-content: flex-start;
        gap: 10px;
        flex-wrap: wrap;
    }

    /* Adjust Buttons for easy tapping */
    .header-text-btn {
        padding: 8px 16px;
        font-size: 0.85rem;
    }

    /* .inquiry-btn styles removed (empty) */

    .user-name-display {
        font-size: 0.95rem;
        margin-right: auto;
        /* Push subsequent items if wrapped */
        width: auto;
    }

    /* Make Admin button fit better */
    .admin-dashboard-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
        margin-left: 0;
    }

    /* Normalize Logout button */
    .logout-btn {
        margin-left: 0;
        padding: 6px 12px;
        background: rgba(255, 225, 0, 0.1);
        border-radius: 20px;
        text-decoration: none;
        border: 1.5px solid rgba(255, 225, 0, 0.4);
        color: #FFE100;
    }
}

/* [NEW] Header Button Unification (Step 1168) */
/* Force all header buttons (Logged-out & Logged-in) to White Border Style */
.header-btn,
.btn-membership,
.btn-login,
/* .btn-signup removed from here */
.header-text-btn,
.inquiry-btn,
.record-btn,
.info-btn {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    background: transparent !important;
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    color: #fff !important;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-btn:hover,
.btn-membership:hover,
.btn-login:hover,
/* .btn-signup:hover removed from here */
.header-text-btn:hover,
.inquiry-btn:hover,
.record-btn:hover,
.info-btn:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: #fff !important;
    transform: translateY(-2px);
}


/* --- DASHBOARD GRID STYLES (Added Step 280) --- */
.category-grid {
    display: grid;
    /* [MODIFIED] Auto-fit grid to prevent squashing (Increased from 280px to 380px) */
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 20px;
    max-width: 900px;
    /* [MODIFIED] Wider for PC side-by-side */
    margin: 20px auto 0 auto;
    padding: 20px;
}

.dashboard-card {
    /* Base styles */
    padding: 24px;
    background: linear-gradient(145deg, #1a1a1c 0%, #000 100%);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 6px;
    position: relative;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    min-height: auto;
    /* [MODIFIED] Fixed reasonable height */
    cursor: pointer;
}

.card-general {
    border: 2px solid #00f7ff !important;
}

.card-general:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 247, 255, 0.4);
    border-color: #00f7ff !important;
}

.card-premium {
    /* [MODIFIED] thicker border + glow + premium gradient */
    border: 3px solid #00f7ff !important;
    background: linear-gradient(135deg, rgba(0, 247, 255, 0.08) 0%, rgba(0, 0, 0, 0) 60%) !important;
    box-shadow: 0 0 15px rgba(0, 247, 255, 0.15) !important;
}

.card-premium:hover {
    transform: translateY(-5px);
    /* [MODIFIED] Stronger glow on hover */
    box-shadow: 0 0 30px rgba(0, 247, 255, 0.4) !important;
    border-color: #00f7ff !important;
    background: linear-gradient(135deg, rgba(0, 247, 255, 0.12) 0%, rgba(0, 0, 0, 0) 60%) !important;
}

/* Mobile Overrides for Dashboard */
@media (max-width: 768px) {
    .category-grid {
        grid-template-columns: 1fr !important;
        /* [RESTORED] Force 1-Column on Mobile/Tablet */
        /* [MODIFIED] Vertical on Mobile */
        gap: 20px;
        max-width: 100%;
    }

    /* [NEW] Reduce Section Header Spacing on Mobile */
    .section-header {
        margin: 30px auto 15px !important;
        /* Override inline 60px */
    }

    .dashboard-card {
        width: 100%;
        aspect-ratio: auto;
        /* Remove fixed aspect ratio */
        min-height: auto;
        /* Slim layout */
        padding: 10px 15px !important;
        /* [MODIFIED] Reduced padding for 2-column mobile layout */
    }
}

/* [NEW] Shimmer animation for banner borders */
@keyframes shimmer {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* [NEW] Responsive Mode Banner Container */
.mode-banner-container {
    display: flex;
    gap: 16px;
    width: 60%;
    margin: 10px auto 20px;
}

@media (max-width: 600px) {
    .mode-banner-container {
        display: flex;
        flex-direction: column;
        width: 100%;
        padding: 0 10px;
        margin: 10px auto 30px;
        gap: 12px;
    }
}