/* =========================================
   ISYARATKU - KOMPONEN BERSAMA
   Header, tombol, lencana status, dan dialog
   yang dipakai semua halaman. Dimuat setelah
   CSS halaman.
   ========================================= */

/* HEADER */

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    min-height: 68px;
    padding: 0 5.5%;
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid var(--color-border);
    backdrop-filter: blur(10px);
    font-family: var(--font-sans);
}

.site-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--color-navy);
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.01em;
    text-decoration: none;
}

.site-logo {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background:
        linear-gradient(135deg, var(--color-primary), var(--color-primary-strong));
    box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.15);
    color: white;
    font-size: 13px;
    font-weight: 800;
}

.site-logo b {
    color: var(--color-accent);
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.site-nav a {
    padding: 8px 14px;
    border-radius: 999px;
    color: var(--color-navy);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s ease;
}

.site-nav a:hover {
    background: var(--color-mint);
}

.site-nav a[aria-current="page"] {
    background: var(--color-navy);
    color: white;
}

.site-user {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px 5px 5px;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: white;
    color: var(--color-navy);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.site-user:empty {
    display: none;
}

.site-avatar {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--color-accent);
    color: var(--color-navy);
    font-size: 12px;
    font-weight: 800;
}

.site-user small {
    color: var(--color-muted);
    font-size: 12px;
    font-weight: 600;
}

@media (max-width: 760px) {
    .site-header {
        flex-wrap: wrap;
        gap: 6px 12px;
        padding: 10px 16px;
    }

    .site-user {
        margin-left: auto;
    }

    .site-nav {
        order: 3;
        width: 100%;
        margin-left: 0;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .site-nav a {
        padding: 7px 12px;
        font-size: 13px;
    }
}

/* TOMBOL */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 22px;
    border: 1px solid transparent;
    border-radius: 999px;
    font: 700 15px var(--font-sans);
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background: var(--color-primary);
    box-shadow: 0 8px 18px rgba(8, 127, 140, 0.25);
    color: white;
}

.btn-primary:hover {
    background: var(--color-primary-strong);
}

.btn-dark {
    background: var(--color-navy);
    color: white;
}

.btn-dark:hover {
    background: #0E2229;
}

.btn-ghost {
    border-color: var(--color-border-strong);
    background: white;
    color: var(--color-navy);
}

.btn-ghost:hover {
    background: var(--color-mint);
}

.btn-quiet {
    min-height: 38px;
    padding: 0 14px;
    background: transparent;
    color: var(--color-muted);
    font-size: 14px;
}

.btn-quiet:hover {
    color: var(--color-navy);
}

.btn-danger {
    border-color: var(--color-danger-border);
    background: white;
    color: var(--color-danger);
}

.btn-danger:hover {
    background: var(--color-danger-bg);
}

/* LENCANA STATUS HURUF */

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    font: 700 11px var(--font-sans);
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.status-badge::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.status-badge[data-status="new"] {
    background: var(--color-surface-muted);
    color: var(--color-muted);
}

.status-badge[data-status="new"]::before {
    background: transparent;
    box-shadow: inset 0 0 0 1.5px currentColor;
}

.status-badge[data-status="viewed"] {
    background: var(--color-warning-bg);
    color: var(--color-warning);
}

.status-badge[data-status="practiced"] {
    background: var(--color-success-bg);
    color: var(--color-success);
}

/* BATANG PROGRES */

.progress-bar {
    position: relative;
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--color-surface-muted);
}

.progress-bar span {
    position: absolute;
    inset: 0 auto 0 0;
    border-radius: inherit;
    background: var(--color-primary);
    transition: width 0.4s ease;
}

.progress-bar span + span {
    background: var(--color-accent);
    mix-blend-mode: multiply;
}

/* DIALOG */

.app-dialog {
    width: min(440px, calc(100vw - 32px));
    padding: 28px;
    border: none;
    border-radius: 22px;
    box-shadow: 0 30px 80px rgba(16, 36, 43, 0.3);
    color: var(--color-navy);
    font-family: var(--font-sans);
}

.app-dialog::backdrop {
    background: rgba(16, 36, 43, 0.5);
    backdrop-filter: blur(3px);
}

.app-dialog h2 {
    margin: 0 0 6px;
    font-size: 22px;
}

.app-dialog p {
    margin: 0 0 18px;
    color: var(--color-muted);
    font-size: 14px;
    line-height: 1.55;
}

.app-dialog label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 700;
}

.app-dialog input {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border: 1px solid var(--color-border-strong);
    border-radius: 12px;
    color: var(--color-navy);
    font: 16px var(--font-sans);
}

.app-dialog .dialog-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* FOOTER */

.site-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 28px 5.5%;
    background: var(--color-navy);
    color: var(--color-on-dark-muted);
    font: 13px var(--font-sans);
}

.site-footer strong {
    color: white;
    font-size: 15px;
}

.site-footer nav {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
}

.site-footer a {
    color: var(--color-on-dark-muted);
    text-decoration: none;
}

.site-footer a:hover {
    color: white;
}

.site-footer :focus-visible {
    outline-color: var(--color-accent);
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
