/* 1. VARIABLES (Matches src/theme/colors.ts - Light Mode) */
:root {
    --bg-color: #b1d6f7;
    --surface: #fff1f1;
    --surface-highlight: #e8ecf0;
    --text-primary: #1F1F1F;
    --text-secondary: #444746;
    --text-tertiary: #8E918F;
    --primary: #0B57D0;
    --border: #E0E0E0;
    --error: #D93025;

    /* Accents */
    --accent-gold: #FFD700;
    --accent-medical: #1967D2;
    --accent-hsc: #E37400;
    --accent-stats: #188038;
}

/* 2. GLOBAL RESET */
body {
    background-color: var(--bg-color);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    padding: 20px;
    color: var(--text-primary);
    display: flex;
    justify-content: center; /* Center the "Mobile View" on desktop */
}

/* 3. MOBILE CONTAINER (Keeps app width on desktop) */
.mobile-container {
    width: 100%;
    max-width: 480px; /* Standard phone width limit */
    background: transparent;
    padding-bottom: 100px; /* Space for footer */
}

/* 4. HEADER SECTION */
.header {
    margin-top: 10px;
    margin-bottom: 25px;
}
.greeting {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-secondary);
}
.user-email {
    font-size: 26px;
    font-weight: bold;
    text-transform: capitalize;
    margin-top: 4px;
    margin-bottom: 8px;
}
.status-badge {
    display: inline-block;
    background-color: var(--surface-highlight);
    color: var(--primary);
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* 5. MENU CARDS (The exact styling from your App) */
.section-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    margin-top: 5px;
    color: var(--text-secondary);
}

.menu-card {
    display: flex;
    align-items: center;
    background-color: var(--surface);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 16px;
    text-decoration: none; /* Remove link underline */
    box-shadow: 0 4px 6px rgba(0,0,0,0.1); /* elevation: 4 */
    border-left: 4px solid transparent; /* Set by inline style */
    transition: transform 0.1s;
}

.menu-card:active {
    transform: scale(0.98); /* Touch feedback */
}

.icon-container {
    width: 48px;
    height: 48px;
    border-radius: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 16px;
    font-size: 24px;
}

.card-content {
    flex: 1;
}

.card-title {
    display: block;
    font-size: 17px;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.card-subtitle {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
}

.arrow {
    font-size: 22px;
    font-weight: bold;
    color: var(--text-tertiary);
    margin-left: 10px;
}

/* 6. FOOTER BUTTONS */
.footer {
    margin-top: 30px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.btn-logout {
    background: transparent;
    border: 1px solid var(--border);
    padding: 10px 30px;
    border-radius: 20px;
    color: var(--error);
    font-weight: 600;
    cursor: pointer;
    font-size: 15px;
}

.btn-theme {
    background: var(--surface-highlight);
    border: 1px solid var(--border);
    padding: 8px 20px;
    border-radius: 20px;
    color: var(--primary);
    font-weight: bold;
    cursor: pointer;
}

/* 7. MODAL (Hidden by default) */
.modal-overlay {
    display: none; /* Hidden */
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: var(--surface);
    width: 85%;
    max-width: 350px;
    padding: 25px;
    border-radius: 20px;
    text-align: center;
}

.modal-title {
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 20px;
    display: block;
}

.plan-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 15px;
    border-radius: 10px;
    border: 1px solid var(--border);
    margin-bottom: 10px;
    background: var(--bg-color);
    cursor: pointer;
    box-sizing: border-box; /* Fix padding width issue */
}

/* --- SUBJECT SCREEN --- */

.big-button {
    display: block;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 20px;
    text-decoration: none;
    color: white;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.1s ease;
    border: none;
}

.big-button:hover {
    filter: brightness(110%);
}

.big-button:active {
    transform: scale(0.98);
}

.big-btn-title {
    display: block;
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 5px;
}

.big-btn-subtitle {
    display: block;
    font-size: 14px;
    opacity: 0.9;
}

/* Colors matching your Theme */
.btn-practice {
    background-color: var(--primary); /* Blue */
}

.btn-test {
    background-color: var(--accent-medical); /* Darker Blue/Red depending on theme */
}


/* --- MEDICAL SCREEN --- */

/* 1. Mode Selection Cards */
.mode-card {
    display: flex;
    align-items: center;
    background: var(--surface);
    padding: 20px;
    border-radius: 16px;
    margin-bottom: 20px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: 1px solid var(--border);
    border-left-width: 6px; /* Thick colored border */
    transition: transform 0.1s;
}
.mode-card:active { transform: scale(0.98); }

.mode-icon { font-size: 32px; margin-right: 15px; }
.mode-title { font-size: 20px; font-weight: 900; margin-bottom: 4px; display: block; }
.mode-desc { font-size: 13px; color: var(--text-secondary); display: block; }

/* Specific Colors */
.card-hot { border-left-color: #FF5722; }
.text-hot { color: #D84315; }

.card-full { border-left-color: #2196F3; }
.text-full { color: #1565C0; }

/* 2. Subject Grid (2 Columns) */
.subject-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.grid-card {
    background: var(--surface);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    text-decoration: none;
    color: var(--text-primary);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-top: 4px solid transparent; /* Colored top border */
    display: flex;
    flex-direction: column;
    align-items: center;
}

.grid-card.disabled {
    opacity: 0.6;
    background: var(--surface-highlight);
    cursor: not-allowed;
}

.grid-icon-box {
    width: 50px; height: 50px;
    border-radius: 25px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    margin-bottom: 10px;
}

/* --- DECK LIST SCREEN --- */

.deck-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding-bottom: 40px;
}

.deck-item {
    background: var(--surface);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-decoration: none;
    color: var(--text-primary);
    transition: transform 0.1s;
    cursor: pointer;
    border: 1px solid transparent;
}

.deck-item:active {
    transform: scale(0.99);
}

.deck-item.locked {
    background: var(--surface-highlight);
    opacity: 0.8;
    cursor: not-allowed;
}

.deck-content {
    flex: 1;
}

.deck-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 5px;
    display: block;
}

.deck-info {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Badges */
.free-badge {
    border: 1px solid var(--success);
    color: var(--success);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
}

.lock-icon {
    font-size: 20px;
}

/* --- STUDY SCREEN (Flashcard Player) --- */

.study-container {
    max-width: 600px;
    margin: 0 auto;
    padding-bottom: 50px;
}

/* 1. THE CARD (3D Flip Logic) */
.flashcard-scene {
    width: 100%;
    height: 350px;
    perspective: 1000px; /* Gives the 3D depth */
    margin-bottom: 20px;
    cursor: pointer;
}

.flashcard-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border-radius: 15px;
}

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

.flashcard-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden; /* Hides the back when facing front */
    border-radius: 15px;
    background: var(--surface);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow-y: auto;
}

.flashcard-back {
    transform: rotateY(180deg); /* The back is naturally rotated */
    background-color: #f8f9fa; 
    border: 2px solid var(--primary);
}

/* Content Styling */
.card-label {
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.card-content {
    font-size: 18px;
    line-height: 1.6;
    color: var(--text-primary);
}

/* 2. CONTROLS */
.controls-area {
    text-align: center;
}

.flip-btn {
    width: 100%;
    padding: 15px;
    background: var(--surface-highlight);
    border: none;
    border-radius: 12px;
    font-weight: bold;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 16px;
    margin-bottom: 15px;
}

.answer-row {
    display: flex;
    gap: 10px;
    display: none; /* Hidden by default */
}

.btn-forgot { background-color: var(--error); color: white; flex: 1; padding: 15px; border-radius: 10px; border:none; font-weight:bold; cursor:pointer;}
.btn-got-it { background-color: var(--success); color: white; flex: 1; padding: 15px; border-radius: 10px; border:none; font-weight:bold; cursor:pointer;}

/* 3. AI BUTTON */
.ai-button {
    background: linear-gradient(135deg, #6C63FF, #4834d4);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 10px auto;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(108, 99, 255, 0.3);
    transition: transform 0.2s;
}

.ai-button:hover { transform: scale(1.05); }

/* 4. NAVIGATION */
.nav-row {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    border-top: 1px solid var(--border);
    padding-top: 20px;
}

.nav-btn {
    background: none;
    border: none;
    color: var(--primary);
    font-weight: bold;
    cursor: pointer;
}
.nav-btn:disabled { color: var(--text-tertiary); cursor: default; }