/* =========================================
   ISYARATKU - DASHBOARD BELAJAR (home.html)
   ========================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    background: var(--color-bg);
    color: var(--color-navy);
    font-family: var(--font-sans);
    line-height: 1.5;
}

h1, h2, h3, p {
    margin: 0;
}

[hidden] {
    display: none !important;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.dash {
    flex: 1;
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 32px 5.5% 56px;
}

/* SAPAAN */

.dash-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    padding: 32px 36px;
    border-radius: 28px;
    background:
        radial-gradient(500px 300px at 100% 0%, rgba(244, 201, 93, 0.25), transparent 60%),
        linear-gradient(135deg, var(--color-navy), #0F3A42);
    color: white;
}

.dash-eyebrow {
    color: var(--color-accent);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.dash-hello h1 {
    margin: 8px 0 8px;
    font-size: clamp(28px, 4vw, 40px);
    letter-spacing: -0.02em;
}

.dash-hello p {
    max-width: 520px;
    color: var(--color-on-dark-muted);
    font-size: 16px;
}

.dash-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}

.dash-hero .btn-ghost {
    border-color: rgba(255, 255, 255, 0.35);
    background: transparent;
    color: white;
}

.dash-hero .btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
}

.dash-hero .btn-primary {
    background: var(--color-accent);
    box-shadow: none;
    color: var(--color-navy);
}

.dash-hero .btn-primary:hover {
    background: #FFD978;
}

.dash-hero :focus-visible {
    outline-color: var(--color-accent);
}

/* Cincin progres */

.dash-ring {
    position: relative;
    flex: none;
    width: 170px;
    height: 170px;
}

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

.dash-ring circle {
    fill: none;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.6s ease;
}

.ring-track {
    stroke: rgba(255, 255, 255, 0.12);
    stroke-width: 10;
}

.ring-learned {
    stroke: #3FC1C9;
    stroke-width: 10;
}

.ring-practiced {
    stroke: var(--color-accent);
    stroke-width: 7;
}

.ring-label {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.ring-label strong {
    font-size: 40px;
    line-height: 1;
}

.ring-label span {
    color: var(--color-on-dark-muted);
    font-size: 12px;
}

/* STATISTIK */

.dash-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 16px;
}

.stat {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    column-gap: 10px;
    padding: 16px 20px;
    border: 1px solid var(--color-border);
    border-radius: 18px;
    background: white;
}

.stat strong {
    font-size: 26px;
    line-height: 1.1;
}

.stat > span:last-child {
    grid-column: 2;
    color: var(--color-muted);
    font-size: 13px;
}

.stat-dot {
    grid-row: span 2;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    box-shadow: inset 0 0 0 2px var(--color-border-strong);
}

.stat-dot.is-learned {
    background: #3FC1C9;
    box-shadow: none;
}

.stat-dot.is-practiced {
    background: var(--color-accent);
    box-shadow: none;
}

/* PROGRES PER KELOMPOK */

.dash-section {
    margin-top: 40px;
    scroll-margin-top: 90px;
}

.section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.section-head h2 {
    font-size: 24px;
    letter-spacing: -0.01em;
}

.section-head p {
    color: var(--color-muted);
    font-size: 14px;
}

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.groups {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.group {
    padding: 18px;
    border: 1px solid var(--color-border);
    border-radius: 20px;
    background: white;
    box-shadow: var(--shadow-card);
}

.group-head {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.group-head h3 {
    font-size: 16px;
}

.group-head span {
    color: var(--color-muted);
    font-size: 13px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.group-tiles {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    margin-top: 14px;
}

.letter-tile {
    position: relative;
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    border: 1.5px solid var(--color-border);
    border-radius: 12px;
    background: var(--color-surface-muted);
    color: var(--color-muted);
    font-size: 18px;
    font-weight: 800;
    text-decoration: none;
    transition: transform 0.15s ease;
}

.letter-tile:hover {
    transform: translateY(-2px);
}

.letter-tile[data-status="viewed"] {
    border-color: #EBC873;
    background: var(--color-warning-bg);
    color: var(--color-warning);
}

.letter-tile[data-status="practiced"] {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: white;
}

.letter-tile[data-status="practiced"]::after {
    content: "✓";
    position: absolute;
    top: -6px;
    right: -6px;
    display: grid;
    place-items: center;
    width: 18px;
    height: 18px;
    border: 2px solid white;
    border-radius: 50%;
    background: var(--color-accent);
    color: var(--color-navy);
    font-size: 10px;
}

.storage-note {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 16px;
    padding: 16px 20px;
    border-radius: 16px;
    background: var(--color-surface-muted);
    color: var(--color-muted);
    font-size: 14px;
}

.storage-note p {
    flex: 1 1 360px;
}

.storage-note strong {
    color: var(--color-navy);
}

.storage-note .btn {
    min-height: 40px;
    font-size: 14px;
}

.storage-note .btn:disabled {
    opacity: 0.45;
    cursor: default;
}

/* PINTASAN */

.shortcuts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.shortcut {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 20px;
    border: 1px solid var(--color-border);
    border-radius: 20px;
    background: white;
    color: var(--color-navy);
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.shortcut:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 30px rgba(23, 49, 58, 0.1);
}

.shortcut strong {
    font-size: 17px;
}

.shortcut > span:last-child {
    color: var(--color-muted);
    font-size: 14px;
}

.shortcut-icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin-bottom: 10px;
    border-radius: 12px;
    background: var(--color-mint);
    color: var(--color-primary-strong);
    font-size: 14px;
    font-weight: 800;
}

.shortcut.is-dark {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: white;
}

.shortcut.is-dark > span:last-child {
    color: #D5F0EE;
}

.shortcut.is-dark .shortcut-icon {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.site-footer p {
    margin-top: 4px;
}

@media (max-width: 860px) {
    .dash-hero {
        flex-direction: column-reverse;
        align-items: flex-start;
        padding: 24px;
    }

    .dash-ring {
        width: 130px;
        height: 130px;
    }

    .ring-label strong {
        font-size: 30px;
    }

    .groups,
    .shortcuts {
        grid-template-columns: 1fr;
    }

    .group-tiles {
        grid-template-columns: repeat(9, minmax(0, 1fr));
        gap: 5px;
    }

    .letter-tile {
        border-radius: 8px;
        font-size: 14px;
    }
}

@media (max-width: 520px) {
    .dash-stats {
        grid-template-columns: 1fr;
    }

    .group-tiles {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

/* MODE TAMU */

.guest-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 16px;
    margin-bottom: 16px;
    padding: 14px 18px;
    border: 1px solid #EBC873;
    border-radius: 18px;
    background: var(--color-warning-bg);
    color: var(--color-navy);
    font-size: 14px;
}

.guest-banner p {
    flex: 1 1 320px;
}

.guest-banner-icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--color-accent);
    font-weight: 800;
}

.guest-banner .btn {
    min-height: 40px;
    font-size: 14px;
}

.save-warning {
    margin: 14px 0 0 !important;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--color-warning-bg);
    color: var(--color-warning) !important;
    font-weight: 600;
}

/* UJIAN */

.exams {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.exam-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 18px;
    border: 1px solid var(--color-border);
    border-radius: 20px;
    background: white;
    color: var(--color-navy);
    text-decoration: none;
}

.exam-card strong {
    font-size: 16px;
}

.exam-card > span:last-child {
    color: var(--color-muted);
    font-size: 13px;
}

.exam-card-icon {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    margin-bottom: 8px;
    border-radius: 12px;
    background: var(--color-surface-muted);
    font-size: 16px;
}

.exam-card[data-open="false"] {
    border-style: dashed;
    background: transparent;
    opacity: 0.85;
}

.exam-card[data-open="true"] {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-card);
    transition: transform 0.15s ease;
}

.exam-card[data-open="true"]:hover {
    transform: translateY(-3px);
}

.exam-card[data-open="true"] .exam-card-icon {
    background: var(--color-primary);
    color: white;
}

.review-note {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    padding: 12px 16px;
    border: 1px solid var(--color-danger-border);
    border-radius: 14px;
    background: var(--color-danger-bg);
    color: var(--color-danger);
    font-size: 14px;
}

.review-letters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.review-letters a {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: white;
    color: var(--color-danger);
    font-weight: 800;
    text-decoration: none;
}

/* Huruf yang salah saat ujian */
.letter-tile[data-review="true"]::before {
    content: "";
    position: absolute;
    bottom: -4px;
    left: 50%;
    width: 14px;
    height: 4px;
    border-radius: 999px;
    background: var(--color-danger);
    transform: translateX(-50%);
}

@media (max-width: 860px) {
    .exams {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
