/* ═══════════════════════════════════════════════════════════
   LinguaSnap Web App — style.css
   Palet: Oxford & Yulaf (bkz. shared/design-system.css)
   ═══════════════════════════════════════════════════════════ */

@import url('../../shared/design-system.css');

:root {
    /* Ana içerik alanı (Yulaf — açık tema) tokenleri.
       Aynı isimler .sidebar içinde koyu (Oxford) temaya
       göre yeniden tanımlanır — bkz. aşağıdaki .sidebar bloğu. */
    --bg-dark:      var(--bg);
    --bg-panel:     var(--surface);
    --border-light: var(--border);
    --border-hover: var(--border-strong);

    --accent-primary:   var(--oxford);
    --accent-secondary: var(--oxford-l);
    --accent-cyan:      var(--oxford-l);

    --success: #15803d;
    --warning: #b45309;
    --error:   #dc2626;

    --text-primary:   var(--text);
    --text-secondary: var(--text-2);
    --text-muted:     var(--text-3);

    /* CEFR Colors (standart, marka paletinden bağımsız) */
    --lvl-a1: #22c55e;
    --lvl-a2: #84cc16;
    --lvl-b1: #b8860b;
    --lvl-b2: #f97316;
    --lvl-c1: #ef4444;
    --lvl-c2: #dc2626;

    /* Transitions */
    --trans-fast: 0.15s ease;
    --trans-normal: 0.3s ease;
    --trans-slow: 0.5s ease;
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-dark);
    color: var(--text-primary);
    overflow: hidden; /* App feels like a desktop app */
    line-height: 1.5;
}

h1, h2, h3 {
    font-family: var(--font-display);
    letter-spacing: -0.02em;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border-hover);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Layout */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Sidebar — Oxford Lacivert (marka rengi, koyu tema) */
.sidebar {
    /* Bu scope içinde yukarıdaki genel tokenler koyu zemine göre override edilir */
    --bg-panel:     rgba(255,255,255,0.06);
    --border-light: rgba(255,255,255,0.10);
    --border-hover: rgba(255,255,255,0.20);
    --text-primary:   #ffffff;
    --text-secondary: rgba(255,255,255,0.64);
    --text-muted:     rgba(255,255,255,0.42);
    --accent-primary:   var(--gold);
    --accent-secondary: #e8c976;
    --accent-cyan:      var(--gold);

    width: 260px;
    background: linear-gradient(180deg, var(--oxford), var(--oxford-d));
    border-right: 1px solid rgba(255,255,255,0.08);
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1rem;
    z-index: 10;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 0.5rem 2rem 0.5rem;
}

.logo-wordmark {
    height: 46px;
    width: auto;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-grow: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1rem;
    width: 100%;
    padding: 0.875rem 1rem;
    background: transparent;
    border: none;
    border-radius: 0.75rem;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--trans-normal);
    text-align: left;
}

.nav-item svg { flex-shrink: 0; }

.nav-item svg {
    width: 20px;
    height: 20px;
}

.nav-item:hover {
    color: var(--text-primary);
    background: var(--bg-panel);
}

.nav-item.active {
    color: var(--text-primary);
    background: linear-gradient(90deg, rgba(212,175,55,0.16) 0%, transparent 100%);
    border-left: 3px solid var(--accent-primary);
    border-radius: 0 0.75rem 0.75rem 0;
}

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

.sidebar-footer {
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--oxford-d);
    flex-shrink: 0;
}

.user-info {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-width: 0;
}
.user-info .user-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.user-profile .btn-icon {
    flex-shrink: 0;
}

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

.user-status {
    font-size: 0.75rem;
    color: var(--accent-cyan);
    font-weight: 600;
}

/* Main Content — Yulaf Beyazı (açık tema) */
.main-content {
    flex-grow: 1;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
    background:
        radial-gradient(circle at top right, rgba(0,33,71,0.045), transparent 40%),
        radial-gradient(circle at bottom left, rgba(212,175,55,0.05), transparent 40%);
}

.page-section {
    padding: 2.5rem 3rem;
    min-height: 100%;
    animation: fadeIn var(--trans-normal);
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.page-section.hidden {
    display: none;
}

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

/* Headers */
.section-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--oxford-d);
    margin-bottom: 0.5rem;
}

.section-header .subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

/* Glass Cards → Yulaf üzerinde temiz kart yüzeyi */
.glass-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-light);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--s-2);
}

/* Dashboard Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: transform var(--trans-normal), border-color var(--trans-normal);
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-hover);
    box-shadow: var(--s-3);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--oxford-ghost);
    color: var(--oxford);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon.success { background: rgba(21, 128, 61, 0.1); color: var(--success); }
.stat-icon.warning { background: rgba(180, 83, 9, 0.1); color: var(--warning); }
.stat-icon.accent  { background: var(--gold-l); color: #9c7a1f; }

.stat-content h3 {
    font-family: var(--font-body);
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--oxford-d);
}
.stat-value.text-sm {
    font-family: var(--font-body);
    font-size: 1.2rem;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.5rem; }

.widget h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 0.75rem;
}

/* Forms & Inputs */
.standard-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

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

.form-row {
    display: flex;
    gap: 1rem;
}

.half { flex: 1; }
.third { flex: 1; min-width: 0; }
.flex-group { flex-direction: row; align-items: flex-end; gap: 1rem; }
.flex-grow { flex-grow: 1; display: flex; flex-direction: column; gap: 0.5rem;}

.field-hint {
    font-weight: 400;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-style: italic;
}

@media (max-width: 640px) {
    .form-row { flex-direction: column; }
}

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

.required { color: var(--error); }

input[type="text"], input[type="email"], input[type="password"], textarea, select {
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    width: 100%;
    transition: all var(--trans-normal);
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(0,33,71,0.15);
}

/* Native <select> look is blocky/inconsistent across browsers — replace
   with a custom chevron + softer radius so it reads as part of the UI
   instead of an OS control. */
select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    border-radius: 0.65rem;
    padding-right: 2.5rem;
    background-color: #ffffff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23002147' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.9rem center;
    background-size: 14px;
}

select:hover {
    border-color: var(--border-hover);
}

select:focus {
    box-shadow: 0 0 0 3px rgba(0,33,71,0.12);
}

textarea { resize: vertical; }

/* Buttons */
button {
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: none;
    border-radius: 0.5rem;
    transition: all var(--trans-normal);
}

.btn-primary {
    background: linear-gradient(135deg, var(--oxford), var(--oxford-l));
    color: white;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    box-shadow: 0 4px 16px rgba(0,33,71,0.28);
}

.btn-primary:hover {
    filter: brightness(1.1);
    box-shadow: 0 6px 20px rgba(0,33,71,0.36);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-panel);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
}

.btn-secondary:hover {
    background: var(--oxford-ghost);
    border-color: var(--border-hover);
}

.btn-ai {
    background: linear-gradient(135deg, var(--gold-l), transparent);
    border-color: rgba(212,175,55,0.4);
    color: var(--oxford-d);
    font-weight: 600;
}
.btn-ai:hover { background: linear-gradient(135deg, rgba(212,175,55,0.28), transparent); border-color: var(--gold); }
.btn-ai:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-ai svg { color: var(--gold); }

.ai-quota-ring-slot {
    display: inline-flex;
    align-items: center;
}
.ai-quota-ring-slot:empty { display: none; }

/* ═══ Dairesel kota göstergesi (Claude tarzı % dolum) ═══ */
.quota-ring {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.quota-ring svg { display: block; }
.quota-ring-text {
    position: absolute;
    font-weight: 700;
    font-family: var(--font-mono, monospace);
    color: var(--text-primary);
}

.btn-icon {
    background: transparent;
    color: var(--text-secondary);
    padding: 0.5rem;
    border-radius: 0.5rem;
}
.btn-icon:hover {
    color: var(--text-primary);
    background: var(--bg-panel);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1rem;
}

/* Sozluk filtreleri - modern pill/toggle gruplari (eskiden duz <select>'lerdi) */
.filter-sort-wrap {
    position: relative;
    flex-shrink: 0;
}
.filter-sort-wrap > svg {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 16px;
    pointer-events: none;
}
.filter-select-modern {
    padding-left: 2.4rem;
    min-width: 190px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--oxford-d);
}

.filter-pills-row {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    padding: 0 0.25rem;
    margin: -0.25rem 0 1rem;
}
.filter-pill-group {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}
.filter-pill-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-right: 0.15rem;
}
.filter-pill {
    border: 1px solid var(--border-light);
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    transition: all var(--trans-normal);
}
.filter-pill:hover { border-color: var(--oxford); color: var(--oxford-d); }
.filter-pill.active {
    background: var(--oxford);
    border-color: var(--oxford);
    color: #fff;
}

/* Dictionary Grid & Cards */
.filters-bar {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex-grow: 1;
    min-width: 250px;
}
/* Sadece dogrudan cocuk (baslangictaki kilit/arama ikonu) - ':scope > svg'
   degil de '.search-box svg' (torun secici) kullanilsaydi, .pw-toggle-btn
   icindeki goz ikonunu da yakalayip onu da sol tarafa, kilit ikonunun
   ustune absolute konumlandirirdi (kutunun disina tasmis gibi gorunmesinin
   sebebi buydu) - '>' ile sadece asil ikon hedefleniyor. */
.search-box > svg {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 18px;
}
.search-box input {
    width: 100%;
    padding-left: 2.5rem;
}

.pw-toggle-btn {
    position: absolute;
    right: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    padding: 0.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 0.4rem;
    transition: color var(--trans-normal);
}
.pw-toggle-btn:hover { color: var(--text-primary); }
.pw-toggle-btn svg { width: 17px; height: 17px; }
.search-box.has-toggle input { padding-right: 2.4rem; }

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

.word-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-light);
    border-radius: 1rem;
    padding: 1.25rem;
    transition: all var(--trans-normal);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.word-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-hover);
    box-shadow: var(--s-3);
}

.word-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.word-en {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--oxford-d);
}

.word-tr {
    font-size: 1rem;
    color: var(--accent-cyan);
    font-weight: 500;
}

.word-example {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-style: italic;
    background: var(--oxford-ghost);
    padding: 0.75rem;
    border-radius: 0.5rem;
    border-left: 2px solid rgba(0,33,71,0.18);
}

.word-footer {
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.level-badge {
    font-family: var(--font-mono);
    padding: 0.25rem 0.6rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.word-badges { display: flex; align-items: center; gap: 0.4rem; }

.type-badge {
    font-family: var(--font-mono);
    padding: 0.25rem 0.6rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    background: var(--oxford-ghost);
    color: var(--text-muted);
}

.level-a1 { background: rgba(34, 197, 94, 0.15); color: var(--lvl-a1); }
.level-a2 { background: rgba(132, 204, 22, 0.15); color: var(--lvl-a2); }
.level-b1 { background: rgba(184, 134, 11, 0.15); color: var(--lvl-b1); }
.level-b2 { background: rgba(249, 115, 22, 0.15); color: var(--lvl-b2); }
.level-c1 { background: rgba(239, 68, 68, 0.15); color: var(--lvl-c1); }
.level-c2 { background: rgba(220, 38, 38, 0.15); color: var(--lvl-c2); }

.word-actions {
    display: flex;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity var(--trans-normal);
}
.word-card:hover .word-actions { opacity: 1; }

.word-actions button {
    padding: 0.4rem;
    border-radius: 0.4rem;
}
.word-actions .delete-btn:hover { color: var(--error); }
.word-actions .edit-btn:hover { color: var(--oxford); }

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    color: var(--text-secondary);
}
.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    color: var(--border-hover);
}

/* Quiz Section */
.quiz-modes {
    margin-top: 1rem;
}
.quiz-mode-card {
    text-align: center;
    padding: 2rem 1.5rem;
    cursor: pointer;
    transition: all var(--trans-normal);
}
.quiz-mode-card:hover {
    transform: translateY(-5px);
    border-color: var(--oxford);
    box-shadow: 0 8px 32px rgba(0,33,71,0.14);
}
.mode-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem auto;
    background: linear-gradient(135deg, rgba(0,33,71,0.12), rgba(212,175,55,0.18));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--oxford);
}
.mode-icon svg { width: 32px; height: 32px; }
.quiz-mode-card h3 { margin-bottom: 0.5rem; font-size: 1.25rem; color: var(--oxford-d); }
.quiz-mode-card p { color: var(--text-secondary); font-size: 0.9rem; }

.quiz-area {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    min-height: 400px;
}
.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}
.quiz-progress {
    flex-grow: 1;
    margin: 0 2rem;
    text-align: center;
}
.progress-bar-container {
    height: 6px;
    background: var(--oxford-ghost);
    border-radius: 3px;
    margin-top: 0.5rem;
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--oxford), var(--gold));
    width: 0%;
    transition: width 0.3s ease;
}
.quiz-score {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--accent-cyan);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quiz-content-wrapper {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Quiz Multi Choice */
.mc-container { width: 100%; max-width: 600px; text-align: center; }
.mc-question { font-family: var(--font-display); font-size: 2.5rem; font-weight: 700; color: var(--oxford-d); margin-bottom: 2rem; }
.mc-options { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.mc-option {
    padding: 1.25rem;
    background: var(--bg-panel);
    border: 2px solid var(--border-light);
    border-radius: 0.75rem;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
}
.mc-option:hover { border-color: var(--oxford); background: var(--oxford-ghost); }
.mc-option.correct { border-color: var(--success); background: rgba(21,128,61,0.1); color: var(--success); }
.mc-option.wrong { border-color: var(--error); background: rgba(220,38,38,0.1); color: var(--error); }

/* Flashcard */
.flashcard-container {
    width: 100%;
    max-width: 500px;
    perspective: 1000px;
}
.flashcard {
    width: 100%;
    height: 300px;
    position: relative;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    cursor: pointer;
}
.flashcard.flipped { transform: rotateY(180deg); }
.flashcard-front, .flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 1rem;
    border: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
    background: linear-gradient(145deg, #ffffff, var(--bg));
    box-shadow: var(--s-3);
}
.flashcard-back { transform: rotateY(180deg); }
.fc-word { font-family: var(--font-display); font-size: 2.5rem; font-weight: 700; color: var(--oxford-d); margin-bottom: 1rem; }
.fc-meaning { font-size: 2rem; font-weight: 600; color: var(--accent-cyan); margin-bottom: 1rem;}
.fc-example { font-style: italic; color: var(--text-secondary); }
.fc-hint { position: absolute; bottom: 1rem; font-size: 0.8rem; color: var(--text-muted); }
.fc-actions { margin-top: 2rem; display: flex; gap: 1rem; justify-content: center; opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.flashcard-container.show-actions .fc-actions { opacity: 1; pointer-events: all; }

/* Levels Section */
.levels-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 1.5rem;
    overflow-x: auto;
}
.level-tab {
    padding: 1rem 1.5rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-weight: 600;
    border-bottom: 2px solid transparent;
}
.level-tab:hover { color: var(--text-primary); }
.level-tab.active {
    color: var(--oxford);
    border-bottom-color: var(--gold);
}

.level-search-bar {
    position: relative;
    margin-bottom: 1rem;
}
.level-search-bar svg {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}
.level-search-bar input {
    width: 100%;
    padding-left: 2.5rem;
}

.level-progress { margin-bottom: 1.5rem; font-size: 0.9rem; color: var(--text-secondary); }

.word-card.added {
    border-color: var(--success);
}
.word-card.added .btn-add {
    display: none;
}
.word-card .added-badge {
    display: none;
    color: var(--success);
    font-size: 0.8rem;
    font-weight: 600;
}
.word-card.added .added-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

/* Toast Notifications — Oxford, marka rengiyle her zeminde okunur */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 9999;
}

.toast {
    background: var(--oxford-d);
    color: rgba(255,255,255,0.92);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 10px 30px rgba(0,33,71,0.28);
    animation: toastSlideIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    min-width: 250px;
}

.toast.fade-out {
    animation: toastFadeOut 0.3s ease forwards;
}

.toast svg { width: 20px; height: 20px; }
.toast.success svg { color: #4ade80; }
.toast.error svg { color: #f87171; }
.toast.info svg { color: var(--gold); }
.toast.warning svg { color: #fbbf24; }

@keyframes toastSlideIn {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes toastFadeOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(100%); }
}

/* Utilities */
.mt-4 { margin-top: 1rem; }
.text-center { text-align: center; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { 100% { transform: rotate(360deg); } }

.loading-state {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    padding: 3rem;
    color: var(--text-secondary);
}

.hidden { display: none !important; }

/* Quiz Results */
.quiz-results {
    text-align: center;
    padding: 3rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}
.quiz-results .result-icon {
    width: 72px;
    height: 72px;
    color: var(--gold);
    margin-bottom: 1rem;
}
.quiz-results h2 {
    font-size: 2rem;
    color: var(--oxford-d);
}
.result-score {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 700;
}
.result-score span {
    color: var(--accent-cyan);
}
.result-message {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}
.result-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

/* Edit Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 21, 48, 0.55);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    padding: 3vh 1rem;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}
.modal-content {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: 1rem;
    padding: 2rem;
    width: 90%;
    max-width: 500px;
    max-height: 94vh;
    overflow-y: auto;
    margin: auto;
    box-shadow: var(--s-4);
}
.modal-content h2 {
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
    color: var(--oxford-d);
}

.upsell-modal {
    max-width: 640px;
    position: relative;
    text-align: center;
}
.upsell-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--bg-panel);
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    line-height: 1;
}
.upsell-close:hover { background: var(--oxford-ghost); }
.upsell-header { margin-bottom: 1.2rem; }
.upsell-header svg { width: 32px; height: 32px; color: var(--gold); margin-bottom: 0.5rem; }
.upsell-header h2 { margin-bottom: 0.35rem; }
.upsell-header p { color: var(--text-muted); font-size: 0.9rem; margin: 0; }
.upsell-modal .plan-cards { text-align: left; margin-top: 1rem; }

/* ═══ Ödeme kartı — kart girişi flip animasyonu ═══ */
.payment-modal {
    max-width: 620px;
    position: relative;
    text-align: center;
}
.payment-note {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 0 0 1rem;
}

.payment-method-tabs {
    display: inline-flex;
    background: var(--bg-panel);
    border: 1px solid var(--border-light);
    border-radius: 999px;
    padding: 3px;
    gap: 2px;
    margin-bottom: 1.4rem;
}
.payment-method-tabs button {
    border: none;
    background: transparent;
    padding: 0.45rem 1.1rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--trans-normal);
}
.payment-method-tabs button.active { background: var(--oxford); color: #fff; }

.alt-method-pane { padding: 1rem 0 0.5rem; }
.alt-method-text { color: var(--text-secondary); font-size: 0.92rem; max-width: 40ch; margin: 0 auto 1.2rem; }

.card-flip-wrap {
    perspective: 1400px;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
}
.card-flip {
    position: relative;
    width: 100%;
    aspect-ratio: 1.586 / 1;
    transform-style: preserve-3d;
    transition: transform 600ms cubic-bezier(0.4, 0.2, 0.2, 1);
}
.card-flip.is-flipped { transform: rotateY(180deg); }

.card-face {
    position: absolute;
    inset: 0;
    border-radius: 18px;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    background: linear-gradient(135deg, #002147, #003366 60%, #001530);
    color: #f2f0e8;
    padding: 22px 24px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.25);
    display: flex;
    flex-direction: column;
    text-align: left;
}

.card-front { justify-content: space-between; }

.card-top-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.card-chip {
    width: 42px;
    height: 32px;
    border-radius: 6px;
    background: linear-gradient(135deg, #D4AF37, #f0d878);
}

.card-brand {
    font-family: Georgia, 'Times New Roman', serif;
    font-style: italic;
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: 0.5px;
    color: #f2f0e8;
    min-height: 1.2em;
}

.card-number {
    font-family: var(--font-mono, monospace);
    font-size: clamp(1.1rem, 4vw, 1.4rem);
    letter-spacing: 2px;
}

.card-bottom-row { margin-top: auto; }
.card-label {
    font-size: 0.62rem;
    letter-spacing: 0.08em;
    color: rgba(242,240,232,0.55);
    margin-bottom: 3px;
}
.card-value {
    font-family: var(--font-mono, monospace);
    font-size: 0.95rem;
    letter-spacing: 1px;
}

.card-back {
    transform: rotateY(180deg);
    padding: 0;
    justify-content: flex-start;
}
.card-stripe {
    width: 100%;
    height: 46px;
    background: #0a0a0a;
    margin-top: 22px;
}
.card-back-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin: 22px 24px 0;
}
.card-cvc-box {
    background: #f2f0e8;
    color: #1A202C;
    padding: 8px 14px;
    border-radius: 6px;
    width: fit-content;
}
.card-cvc-box .card-label { color: rgba(26,32,44,0.5); }
.card-cvc-box .card-value { color: #1A202C; }

@media (max-width: 640px) {
    .payment-modal { max-width: 92vw; }
}
.modal-content .form-group {
    margin-bottom: 1rem;
}
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Import button */
.import-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    background: var(--bg-panel);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all var(--trans-normal);
}
.import-label:hover {
    background: var(--oxford-ghost);
    border-color: var(--border-hover);
}

/* ── Auth Gate ────────────────────────────────────────────── */
.auth-screen {
    height: 100vh;
    width: 100vw;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background:
        radial-gradient(circle at top right, rgba(0,33,71,0.06), transparent 45%),
        radial-gradient(circle at bottom left, rgba(212,175,55,0.07), transparent 45%),
        var(--bg);
}

.auth-card {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    text-align: center;
}

.auth-logo {
    width: 56px;
    height: 56px;
    object-fit: contain;
    filter: invert(8%) sepia(55%) saturate(2200%) hue-rotate(200deg) brightness(85%) contrast(110%);
}

.auth-back-link {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: -0.5rem;
    transition: color var(--trans-normal);
}
.auth-back-link:hover { color: var(--accent-primary); }
.auth-back-link svg { width: 15px; height: 15px; }

.auth-tabs {
    display: flex;
    gap: 0.25rem;
    background: var(--oxford-ghost);
    padding: 0.25rem;
    border-radius: 0.75rem;
    width: 100%;
}
.auth-tab {
    flex: 1;
    padding: 0.6rem 1rem;
    border-radius: 0.5rem;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
}
.auth-tab.active {
    background: var(--oxford);
    color: #ffffff;
}

.auth-form {
    width: 100%;
    text-align: left;
}

.auth-submit { width: 100%; margin-top: 0.25rem; }

/* Auth ekranındaki inputlar — daha yumuşak, kapsül hissi veren stil */
.auth-form .search-box input {
    background: var(--bg);
    border: 1.5px solid transparent;
    border-radius: 0.85rem;
    padding: 0.8rem 1rem 0.8rem 2.75rem;
}
.auth-form .search-box input:focus {
    background: #ffffff;
    border-color: var(--oxford);
    box-shadow: 0 0 0 4px rgba(0,33,71,0.1);
}
.auth-form .search-box svg {
    left: 1.1rem;
    width: 17px;
    height: 17px;
}
.auth-form label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--oxford-d);
    margin-bottom: 0.1rem;
}

.auth-error {
    color: var(--error);
    font-size: 0.85rem;
    text-align: left;
}
/* Kayıt sonrası "e-postana gelen onay linkine tıkla" gibi bilgilendirme
   mesajları için - kırmızı hata gibi değil, nötr/olumlu görünmeli. */
.auth-error.is-success {
    color: #1f7a4d;
}

.auth-note {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.auth-forgot-link {
    align-self: flex-end;
    background: none;
    border: none;
    padding: 0;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--oxford);
    cursor: pointer;
    margin-top: -0.5rem;
}
.auth-forgot-link:hover { text-decoration: underline; }

.auth-link-btn {
    align-self: center;
    background: none;
    border: none;
    padding: 0;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
}
.auth-link-btn:hover { color: var(--oxford); text-decoration: underline; }

.form-error {
    color: var(--error);
    font-size: 0.85rem;
    margin-top: -0.4rem;
}

/* ═══ Settings: plan / abonelik ═══ */
.plan-widget { margin-bottom: 1.5rem; }

.billing-mini-toggle {
    display: inline-flex;
    background: var(--bg-panel);
    border: 1px solid var(--border-light);
    border-radius: 999px;
    padding: 3px;
    gap: 2px;
}
.billing-mini-toggle button {
    border: none;
    background: transparent;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--trans-normal);
}
.billing-mini-toggle button.active {
    background: var(--oxford);
    color: #fff;
}

.plan-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 1rem;
}
@media (max-width: 900px) { .plan-cards { grid-template-columns: 1fr; } }

.plan-card {
    border: 1px solid var(--border-light);
    border-radius: 0.85rem;
    padding: 1.1rem 1.1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    background: var(--bg-panel);
}
.plan-card.is-current { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.plan-card-name { font-weight: 700; font-size: 1rem; color: var(--text-primary); display: flex; align-items: center; gap: 8px; }
.plan-card-badge {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--oxford-d);
    background: var(--gold);
    padding: 2px 8px;
    border-radius: 999px;
}
.plan-card-price { font-family: inherit; font-size: 1.4rem; font-weight: 700; color: var(--text-primary); }
.plan-card-price span { font-size: 0.78rem; font-weight: 400; color: var(--text-muted); }
.plan-card-strike { font-size: 0.95rem; font-weight: 400; color: var(--text-muted); text-decoration: line-through; margin-right: 4px; }
.plan-card-savings-badge {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--oxford-d);
    background: var(--gold);
    padding: 2px 8px;
    border-radius: 999px;
    width: fit-content;
    margin-top: 6px;
}
.plan-card-ai { font-size: 0.8rem; color: var(--text-muted); }

/* Aylik/yillik anahtari - website/style.css'teki ile ayni tasarim,
   Upsell modalinda kullaniliyor (bkz. upsell.js). */
.billing-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin: 0 0 1.2rem;
}
.billing-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: color var(--trans-normal);
}
.billing-label.active { color: var(--oxford); font-weight: 700; }
.billing-switch {
    position: relative;
    width: 42px;
    height: 24px;
    border-radius: 999px;
    border: none;
    background: var(--oxford-ghost);
    cursor: pointer;
    padding: 0;
    transition: background var(--trans-normal);
}
.billing-switch[aria-checked="true"] { background: var(--oxford); }
.billing-switch-knob {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: var(--s-1);
    transition: transform var(--trans-normal);
}
.billing-switch[aria-checked="true"] .billing-switch-knob { transform: translateX(18px); }
.plan-card-btn {
    margin-top: auto;
    width: 100%;
    padding: 0.6rem;
    border-radius: 0.6rem;
    border: 1px solid var(--border-light);
    background: transparent;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--trans-normal);
}
.plan-card-btn:hover { background: var(--oxford-ghost); }
.plan-card-btn:disabled { opacity: 0.6; cursor: default; }
.plan-card-btn.is-primary { background: var(--oxford); color: #fff; border-color: var(--oxford); }
.plan-card-btn.is-primary:hover { background: var(--oxford-l); }

.plan-demo-note {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.9rem;
    font-style: italic;
}

.discount-row {
    display: flex;
    gap: 0.6rem;
    margin: 0.9rem 0 0.4rem;
}
.discount-row input {
    flex: 1;
    text-transform: uppercase;
}
.discount-row .btn-secondary { padding: 0.6rem 1.1rem; white-space: nowrap; }

.discount-status {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 0 0 0.6rem;
}
.discount-status.is-success { color: #1f7a4d; }
.discount-status.is-error { color: var(--error); }

/* ═══ Settings: profile forms + usage heatmap ═══ */
.settings-grid { margin-bottom: 1.5rem; }

.heatmap-widget { padding-bottom: 1.25rem; }

.heatmap-scroll {
    overflow-x: auto;
    padding: 0.75rem 0 0.25rem;
}

.usage-heatmap {
    display: grid;
    grid-auto-flow: column;
    grid-template-rows: repeat(7, 1fr);
    gap: 3px;
    width: max-content;
}

.heatmap-cell {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    background: var(--border-light);
}

.heatmap-cell.level-empty { background: transparent; }
.heatmap-cell.level-0 { background: var(--border-light); }
.heatmap-cell.level-1 { background: var(--gold-l); }
.heatmap-cell.level-2 { background: rgba(212, 175, 55, 0.5); }
.heatmap-cell.level-3 { background: rgba(212, 175, 55, 0.78); }
.heatmap-cell.level-4 { background: var(--gold); box-shadow: 0 0 0 1px rgba(0,33,71,0.15) inset; }

.heatmap-legend {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}
.heatmap-legend .heatmap-cell { width: 11px; height: 11px; }

.danger-zone { border: 1px solid rgba(220,38,38,0.25); margin-bottom: 1.5rem; }
.danger-zone .subtitle { margin-bottom: 0.85rem; }
.btn-danger { color: var(--error); border-color: rgba(220,38,38,0.35); }
.btn-danger:hover { background: rgba(220,38,38,0.08); border-color: var(--error); }

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

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 70px;
        padding: 1rem 0.5rem;
    }
    .sidebar .nav-item span,
    .sidebar .user-info {
        display: none;
    }
    .sidebar-header {
        justify-content: center;
        padding-bottom: 1rem;
    }
    .nav-item {
        justify-content: center;
        padding: 0.75rem;
    }
    .page-section {
        padding: 1.5rem;
    }
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    .grid-2 {
        grid-template-columns: 1fr;
    }
    .mc-options {
        grid-template-columns: 1fr;
    }
}
