/* ── Dashboard de progresso ─────────────────────────────────────────────── */
.dash { padding-bottom: 60px; }
.dash-title { color: #f8f8f2; font-size: 1.6rem; margin: 10px 0 18px; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 16px; }
.dash-grid.two { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.dash-card {
    background: rgba(40, 42, 54, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    padding: 20px 22px;
    margin-bottom: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    color: #f8f8f2;
}
.dash-grid .dash-card { margin-bottom: 0; }
.dash-card h3 { color: #f1fa8c; font-size: 1rem; margin: 0 0 12px; }
.dash-card h3.mt { margin-top: 18px; }
.dash-empty { text-align: center; padding: 40px; }
.dash-empty p { color: #bfbfd4; max-width: 520px; margin: 10px auto 0; }

.stat { display: flex; flex-direction: column; gap: 8px; }
.stat-label { color: #bfbfd4; font-size: 0.85rem; }
.stat-value { font-size: 2.2rem; font-weight: 700; color: #f8f8f2; line-height: 1; }
.stat-sub { color: #6272a4; font-size: 0.8rem; }
.stat-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 0.75rem; padding: 3px 8px; border-radius: 12px; background: rgba(255, 255, 255, 0.06); }
.chip-green { color: #50fa7b; } .chip-yellow { color: #f1fa8c; } .chip-red { color: #ff7979; }

.dash-btn {
    background: linear-gradient(135deg, #bd93f9, #ff79c6);
    border: none; color: #1e1e2f; font-weight: 700;
    padding: 10px 14px; border-radius: 12px; cursor: pointer; font-size: 0.95rem;
}
.dash-btn:disabled { opacity: 0.4; cursor: default; }
.dash-btn.secondary { background: rgba(255, 255, 255, 0.08); color: #f8f8f2; }

.dash-search {
    width: 100%; box-sizing: border-box; padding: 12px 14px; border-radius: 12px;
    border: 1px solid rgba(189, 147, 249, 0.4); background: rgba(0, 0, 0, 0.25);
    color: #f8f8f2; font-size: 1rem;
}
.search-results { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.search-items { display: flex; flex-wrap: wrap; gap: 8px; }
.search-item { background: rgba(189, 147, 249, 0.12); border: 1px solid rgba(189, 147, 249, 0.35); border-radius: 10px; padding: 6px 10px; font-size: 0.85rem; }
.search-item b { color: #f8f8f2; } .search-item small { color: #bfbfd4; }
.sentence-card { background: rgba(255, 255, 255, 0.04); border-radius: 12px; padding: 12px 14px; }
.sentence-text { font-size: 1.05rem; } .sentence-text mark { background: rgba(241, 250, 140, 0.3); color: inherit; border-radius: 3px; }
.sentence-translation { color: #bfbfd4; font-size: 0.9rem; margin-top: 4px; }
.sentence-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; font-size: 0.8rem; color: #6272a4; flex-wrap: wrap; }
.sentence-meta a { color: #8be9fd; text-decoration: none; }
.scene-btn { background: transparent; border: 1px solid #bd93f9; color: #bd93f9; border-radius: 8px; padding: 3px 10px; cursor: pointer; font-size: 0.8rem; }
.scene-video { width: 100%; max-width: 480px; border-radius: 10px; margin-top: 8px; }
.muted { color: #6272a4; font-size: 0.9rem; }

.week-chart { display: flex; align-items: flex-end; gap: 10px; height: 140px; padding-top: 10px; }
.week-bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.week-bar .bar { width: 100%; max-width: 38px; background: linear-gradient(180deg, #bd93f9, #6272a4); border-radius: 6px 6px 2px 2px; min-height: 3px; }
.week-bar span { font-size: 0.7rem; color: #6272a4; }
.week-bar b { font-size: 0.75rem; color: #f8f8f2; }

.lang-list, .recent-list { display: flex; flex-direction: column; gap: 8px; font-size: 0.9rem; }
.lang-row { display: flex; justify-content: space-between; gap: 10px; }
.recent-list a { color: #8be9fd; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Sessão de revisão ─────────────────────────────────────────────────── */
/* O card nunca passa da altura da tela: o conteúdo rola por dentro e o "✕" fica sempre visível */
.review-modal { max-width: 560px; width: 92%; max-height: 90vh; display: flex; flex-direction: column; padding-bottom: 1.25rem; }
#review-body, #chest-body { overflow-y: auto; min-height: 0; padding: 0 4px; overscroll-behavior: contain; }
/* Imagem grande e inteira (sem cortar); toque amplia em tela cheia */
.review-modal .item-image { max-height: min(340px, 40vh); object-fit: contain; cursor: zoom-in; }
.review-modal .scene-video { max-height: 32vh; }
.review-modal .review-term { margin-top: 10px; }
.review-progress { height: 6px; background: rgba(255, 255, 255, 0.1); border-radius: 3px; overflow: hidden; margin: 6px 0 18px; }
#review-progress-bar { height: 100%; width: 0; background: #50fa7b; transition: width 0.3s; }
.review-tag { font-size: 0.75rem; color: #6272a4; text-transform: uppercase; letter-spacing: 1px; }
.review-term { font-size: 2.2rem; text-align: center; margin: 18px 0 6px; color: #f8f8f2; }
.review-reading { text-align: center; color: #bfbfd4; }
.review-meaning { text-align: center; font-size: 1.2rem; color: #50fa7b; margin: 10px 0; }
.review-sentence { font-size: 1.25rem; text-align: center; margin: 16px 0 8px; line-height: 1.6; }
.review-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0; }
.review-option { padding: 12px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.15); background: rgba(255, 255, 255, 0.05); color: #f8f8f2; font-size: 1.05rem; cursor: pointer; }
.review-option.correct { border-color: #50fa7b; background: rgba(80, 250, 123, 0.15); }
.review-option.wrong { border-color: #ff5555; background: rgba(255, 85, 85, 0.15); }
.review-ratings { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 16px; }
.review-ratings.three { grid-template-columns: repeat(3, 1fr); }
.rate { padding: 10px 6px; border-radius: 10px; border: none; cursor: pointer; font-weight: 700; color: #1e1e2f; }
.rate small { display: block; font-weight: 400; font-size: 0.7rem; opacity: 0.8; }
.rate-1 { background: #ff5555; } .rate-2 { background: #ffb86c; } .rate-3 { background: #50fa7b; } .rate-4 { background: #8be9fd; }
.review-center { text-align: center; margin-top: 16px; }
@media (max-width: 480px) { .review-options { grid-template-columns: 1fr; } .stat-value { font-size: 1.8rem; } }

/* ── Hábito ────────────────────────────────────────────────────────────── */
.habit-strip { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 22px; }
.habit-streak { display: flex; align-items: center; gap: 12px; }
.streak-flame { font-size: 2.4rem; filter: drop-shadow(0 0 8px rgba(255, 121, 0, 0.6)); }
.streak-flame.off { filter: grayscale(1); opacity: 0.5; }
.streak-number { font-size: 1.1rem; } .streak-number b { font-size: 1.6rem; color: #ffb86c; }
.habit-goal { display: flex; flex-direction: column; gap: 6px; }
.goal-label { display: flex; justify-content: space-between; font-size: 0.85rem; color: #bfbfd4; }
.goal-bar { height: 10px; background: rgba(255, 255, 255, 0.08); border-radius: 5px; overflow: hidden; }
#hb-goal-bar { height: 100%; width: 0; background: linear-gradient(90deg, #ffb86c, #50fa7b); transition: width 0.4s; }
.risk { color: #ffb86c; font-weight: 600; }
.chest-btn.opened { background: rgba(255, 255, 255, 0.08); color: #f8f8f2; }

.heatmap { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 14px); gap: 3px; overflow-x: auto; padding-bottom: 4px; }
.heat { width: 14px; height: 14px; border-radius: 3px; background: rgba(255, 255, 255, 0.06); }
.heat.l1 { background: rgba(80, 250, 123, 0.3); } .heat.l2 { background: rgba(80, 250, 123, 0.55); }
.heat.l3 { background: rgba(80, 250, 123, 0.8); } .heat.l4 { background: #50fa7b; }
.heat.freeze { background: rgba(139, 233, 253, 0.6); }
.achievements { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.badge { background: rgba(241, 250, 140, 0.1); border: 1px solid rgba(241, 250, 140, 0.35); color: #f1fa8c; border-radius: 12px; padding: 4px 10px; font-size: 0.8rem; }

.chest-title { text-align: center; font-size: 1.3rem; color: #f1fa8c; margin: 6px 0 14px; }
.chest-big { text-align: center; font-size: 3rem; }
.chest-text { text-align: center; font-size: 1.05rem; line-height: 1.6; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(120px); background: #282a36;
         border: 1px solid #50fa7b; color: #f8f8f2; padding: 10px 18px; border-radius: 14px; z-index: 10005;
         transition: transform 0.3s; box-shadow: 0 10px 30px rgba(0,0,0,0.4); }
.toast.show { transform: translateX(-50%) translateY(0); }
@media (max-width: 720px) { .habit-strip { grid-template-columns: 1fr; } }

/* ── Imagens de cena e ilustrações ─────────────────────────────────────── */
.sentence-card.with-thumb { display: grid; grid-template-columns: 120px 1fr; column-gap: 14px; }
.sentence-card.with-thumb > :not(.scene-thumb) { grid-column: 2; }
.scene-thumb { grid-row: 1 / span 4; width: 120px; height: 68px; object-fit: cover; border-radius: 8px; background: #111; }
.similar-tag { font-size: 0.7rem; color: #8be9fd; border: 1px solid rgba(139, 233, 253, 0.4); border-radius: 8px; padding: 1px 6px; justify-self: start; margin-bottom: 4px; }
.item-image { display: block; max-width: 100%; max-height: 300px; margin: 6px auto 0; border-radius: 12px; object-fit: cover; }
@media (max-width: 480px) { .sentence-card.with-thumb { grid-template-columns: 84px 1fr; } .scene-thumb { width: 84px; height: 48px; } }

/* ── Correção de itens ─────────────────────────────────────────────────── */
.report-box { margin-top: 10px; text-align: center; }
.report-link { background: transparent; border: none; color: #6272a4; cursor: pointer; font-size: 0.8rem; text-decoration: underline; }
.report-form { text-align: left; margin-top: 8px; background: rgba(255, 255, 255, 0.04); border-radius: 12px; padding: 12px; }
.report-form label { display: block; font-size: 0.8rem; color: #bfbfd4; margin-bottom: 8px; }
.report-form input { display: block; width: 100%; box-sizing: border-box; margin-top: 3px; padding: 7px 9px; border-radius: 8px;
                     border: 1px solid rgba(255, 255, 255, 0.15); background: rgba(0, 0, 0, 0.25); color: #f8f8f2; }
.report-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }

/* ── Importar do Anki ──────────────────────────────────────────────────── */
.import-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 10px 0; }
.import-row select, .import-row input[type=file] { color: #f8f8f2; background: rgba(0,0,0,0.25); border: 1px solid rgba(255,255,255,0.15); border-radius: 8px; padding: 6px 8px; }
.import-row .check { font-size: 0.85rem; color: #bfbfd4; display: flex; align-items: center; gap: 6px; }

.review-buttons { display: flex; flex-direction: column; gap: 8px; }

/* ── Abas de idioma ────────────────────────────────────────────────────── */
.lang-tabs { display: flex; gap: 10px; flex-wrap: wrap; margin: -4px 0 16px; }
.lang-tab { background: rgba(40, 42, 54, 0.6); border: 1px solid rgba(255, 255, 255, 0.12); color: #f8f8f2;
            border-radius: 14px; padding: 8px 14px; cursor: pointer; font-size: 0.95rem; text-align: left; }
.lang-tab small { display: block; color: #a4a7c4; font-size: 0.72rem; margin-top: 2px; }
/* Aba ativa no estilo "adesivo" do menu: fundo roxo sólido e texto escuro (contraste alto) */
.lang-tab.active { background: #bd93f9; color: #12121c; border: 2.5px solid #12121c; box-shadow: 0 3px 0 #12121c; font-weight: 600; }
.lang-tab.active small { color: #2e2350; font-weight: 500; }
.lang-row { cursor: pointer; border-radius: 8px; padding: 2px 6px; margin: 0 -6px; }
.lang-row:hover, .lang-row.active { background: rgba(189, 147, 249, 0.12); }

/* ── Card da revisão: Voltar, Tirar dúvida, Editar ─────────────────────── */
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-tools { display: flex; gap: 6px; flex-wrap: wrap; }
.tool-btn { background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.14); color: #f8f8f2;
            border-radius: 10px; padding: 5px 10px; font-size: 0.8rem; cursor: pointer; }
.tool-btn:hover:not(:disabled) { background: rgba(189, 147, 249, 0.18); }
.tool-btn:disabled { opacity: 0.35; cursor: default; }
.card-panel { margin-top: 10px; }
.audio-row { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.dash-btn.danger { background: #ff5555; color: #12121c; }
.edit-media { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 10px 0 4px; font-size: 0.85rem; color: #bfbfd4; }
.edit-media > span { min-width: 84px; }
.file-btn { cursor: pointer; }
.image-zoom { position: fixed; inset: 0; z-index: 10010;   /* acima do modal da revisão (10001) */ background: rgba(0, 0, 0, 0.88); display: flex;
              align-items: center; justify-content: center; cursor: zoom-out; padding: 16px; }
.image-zoom-close { position: absolute; top: 14px; right: 14px; width: 44px; height: 44px; border-radius: 50%; border: 0;
                    background: rgba(255, 255, 255, 0.18); color: #fff; font-size: 1.3rem; cursor: pointer; }
.image-zoom img { max-width: 100%; max-height: 100%; border-radius: 12px; object-fit: contain; }

/* Tira-dúvidas */
.qa-list { display: flex; flex-direction: column; gap: 6px; max-height: 30vh; overflow-y: auto; margin-bottom: 8px; }
.qa-q { align-self: flex-end; background: rgba(189, 147, 249, 0.2); border-radius: 12px 12px 2px 12px; padding: 6px 10px; font-size: 0.88rem; max-width: 85%; }
.qa-a { align-self: flex-start; background: rgba(255, 255, 255, 0.06); border-radius: 12px 12px 12px 2px; padding: 8px 10px; font-size: 0.88rem; line-height: 1.45; max-width: 92%; }
.qa-form { display: flex; gap: 8px; align-items: flex-end; }
.qa-form textarea { flex: 1; resize: none; padding: 8px 10px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.15);
                    background: rgba(0, 0, 0, 0.25); color: #f8f8f2; font: inherit; font-size: 0.9rem; }
