/* C:\laragon\www\TenRusl-DiffView\assets\css\chrome.css */
/* =====================================================================
   CHROME (shared controls/nav/buttons, print rules, skip-link)
   File: chrome.css
   Relies on tokens from theme.css
   ===================================================================== */

/* right bar: controls (app) or nav (pages) — container & scrollbars */
:is(.controls, .nav) {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.35) transparent;
}
:is(.controls, .nav)::-webkit-scrollbar {
    height: 8px;
}
:is(.controls, .nav)::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.35);
    border-radius: 999px;
}

/* generic icon button */
.icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    min-width: 36px;
    padding: 0 10px;
    gap: 6px;
    border: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
    color: var(--text);
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.08s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    white-space: nowrap;
}
.icon-btn:hover {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
}
.icon-btn:active {
    transform: scale(0.98);
}
.icon-btn.ghost {
    background: transparent;
}
.icon-btn.sm {
    height: 30px;
    min-width: 30px;
    border-radius: 10px;
}

/* Icon sizing helper (overrides the .icon in app.css when this is loaded later) */
.icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    font-size: 18px;
    line-height: 1;
}

/* Sun/Moon animation helpers (optional if JS swaps FA icons) */
.icon-sun {
    transition: transform 0.25s ease, opacity 0.25s ease;
}
.icon-moon {
    position: absolute;
    opacity: 0;
    transform: scale(0.85) rotate(-8deg);
    transition: opacity 0.25s ease, transform 0.25s ease;
}
:root.light .icon-sun {
    opacity: 0;
    transform: scale(0.85) rotate(8deg);
}
:root.light .icon-moon {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

/* mini badge (for language badge) */
.badge-mini {
    font-size: 10px;
    line-height: 1;
    padding: 3px 6px;
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted);
    border: 1px solid var(--border);
}

/* Active state utk menu di .controls */
.controls .icon-btn.active {
    border-color: var(--brand, #8b5cf6);
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2) inset;
}

/* Skip link: hidden kecuali fokus */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 8px;
    background: var(--panel);
    color: var(--text);
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    z-index: 80;
}
.skip-link:focus {
    left: 8px;
}

/* PRINT: hide chrome on print (header/footer and panel heads) */
@media print {
    header,
    footer,
    .panel.left .panel-head,
    .panel.right .panel-head {
        display: none !important;
    }
}

/* Mobile tweaks for shared icon sizes */
@media (max-width: 980px) {
    .icon-btn {
        height: 44px;
        min-width: 44px;
        border-radius: 14px;
    }
    .icon {
        width: 20px;
        height: 20px;
        font-size: 20px;
    }
}
