/* =====================================================================
   Portal File — O. Solihin
   Token sistem warna & tipografi
   Palet lembut: sage/emerald pudar + emas antik + gading hangat
   ===================================================================== */

:root {
    --bg:            #F7F5F0;
    --bg-elevated:   #FFFFFF;
    --bg-sidebar:    #F1EEE6;
    --ink:           #2B2A28;
    --ink-soft:      #6E6A62;
    --ink-faint:     #9A958B;
    --accent:        #3F6B5C;
    --accent-strong: #2C4E43;
    --accent-soft:   #DCE7E1;
    --gold:          #B08A4E;
    --gold-soft:     #F1E6D2;
    --rose:          #C97B63;
    --rose-soft:     #F5E2DC;
    --line:          #E4E0D6;
    --line-strong:   #D2CDC0;
    --shadow:        0 12px 32px -12px rgba(43, 42, 40, 0.16);
    --shadow-sm:      0 4px 12px -6px rgba(43, 42, 40, 0.14);
    --radius-lg:     18px;
    --radius-md:     12px;
    --radius-sm:     8px;
    --font-display:  'Fraunces', Georgia, serif;
    --font-body:     'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono:     'IBM Plex Mono', ui-monospace, monospace;
}

html[data-theme="dark"] {
    --bg:            #1B1D1B;
    --bg-elevated:   #232622;
    --bg-sidebar:    #20231F;
    --ink:           #ECE9E2;
    --ink-soft:      #ABA69C;
    --ink-faint:     #726E64;
    --accent:        #7FAB96;
    --accent-strong: #9CC2AF;
    --accent-soft:   #2B3B34;
    --gold:          #D3B074;
    --gold-soft:     #3A3323;
    --rose:          #D99A85;
    --rose-soft:     #3B2C27;
    --line:          #333630;
    --line-strong:   #40443C;
    --shadow:        0 12px 32px -12px rgba(0, 0, 0, 0.5);
    --shadow-sm:     0 4px 12px -6px rgba(0, 0, 0, 0.45);
}

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

body {
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    transition: background 0.25s ease, color 0.25s ease;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
svg { width: 1em; height: 1em; display: block; }

/* ---------------------------------------------------------------
   Alert file baru
   --------------------------------------------------------------- */
.new-alert {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(90deg, var(--rose-soft), var(--gold-soft));
    color: var(--ink);
    padding: 12px 20px;
    font-size: 13.5px;
    border-bottom: 1px solid var(--line);
    position: relative;
}
.new-alert__icon { font-size: 16px; }
.new-alert__text { flex: 1; }
.new-alert__close {
    background: none;
    border: none;
    font-size: 20px;
    line-height: 1;
    color: var(--ink-soft);
    padding: 2px 6px;
}
.new-alert.is-hidden { display: none; }

/* ---------------------------------------------------------------
   Shell: sidebar + main
   --------------------------------------------------------------- */
.shell {
    display: grid;
    grid-template-columns: 300px 1fr;
    min-height: calc(100vh - 52px);
}

.sidebar {
    background: var(--bg-sidebar);
    border-right: 1px solid var(--line);
    padding: 28px 22px;
    display: flex;
    flex-direction: column;
    gap: 26px;
}

/* Kartu profil ------------------------------------------------- */
.profile-card {
    position: relative;
    background: var(--bg-elevated);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 28px 20px 22px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.profile-card__pattern {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 64px;
    background-color: var(--accent);
    background-image:
        radial-gradient(circle at 12.5% 50%, transparent 8px, var(--accent) 8.5px),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='0.35' stroke-width='1'%3E%3Cpath d='M22 2 L30 12 L42 14 L34 22 L42 30 L30 32 L22 42 L14 32 L2 30 L10 22 L2 14 L14 12 Z'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 44px 44px;
    opacity: 0.9;
}
.profile-card__photo {
    position: relative;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--bg-elevated);
    margin-top: 28px;
    box-shadow: var(--shadow-sm);
}
.profile-card__photo--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    color: #fff;
    font-family: var(--font-display);
    font-size: 30px;
}
.profile-card__name {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 21px;
    margin: 14px 0 6px;
    color: var(--ink);
}
.profile-card__desc {
    font-size: 12.8px;
    color: var(--ink-soft);
    margin: 0 0 16px;
    line-height: 1.6;
}
.profile-card__desc strong { color: var(--accent-strong); font-weight: 600; }
html[data-theme="dark"] .profile-card__desc strong { color: var(--accent-strong); }

.profile-card__social {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 18px;
}
.profile-card__social a {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-soft);
    color: var(--accent-strong);
    transition: transform 0.15s ease, background 0.15s ease;
}
.profile-card__social a svg { width: 16px; height: 16px; }
.profile-card__social a:hover {
    background: var(--accent);
    color: #fff;
    transform: translateY(-2px);
}

.btn-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: var(--accent);
    color: #fff !important;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.2px;
    transition: background 0.15s ease, transform 0.15s ease;
}
.btn-back svg { width: 15px; height: 15px; }
.btn-back:hover { background: var(--accent-strong); transform: translateY(-1px); }
.btn-back--ghost {
    background: transparent;
    border: 1px solid var(--line-strong);
    color: var(--ink) !important;
    margin-top: 10px;
}
.btn-back--ghost:hover { background: var(--accent-soft); }

/* Navigasi folder ------------------------------------------------ */
.folder-nav__title {
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-faint);
    padding: 0 10px 8px;
}
.folder-nav__item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-align: left;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    background: transparent;
    border: none;
    color: var(--ink-soft);
    font-size: 13.5px;
    font-weight: 500;
    margin-bottom: 2px;
}
.folder-nav__item svg { width: 15px; height: 15px; flex-shrink: 0; }
.folder-nav__item:hover { background: var(--accent-soft); color: var(--ink); }
.folder-nav__item.is-active { background: var(--accent-soft); color: var(--accent-strong); }
.folder-nav__children { padding-left: 16px; }
.folder-nav__badge {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--ink-faint);
}

/* ---------------------------------------------------------------
   Topbar
   --------------------------------------------------------------- */
.topbar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 28px;
    border-bottom: 1px solid var(--line);
}
.topbar__menu {
    display: none;
    background: none;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    padding: 8px;
    color: var(--ink);
}
.search-box {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-elevated);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 10px 16px;
    max-width: 480px;
}
.search-box svg { width: 16px; height: 16px; color: var(--ink-faint); flex-shrink: 0; }
.search-box input {
    border: none;
    outline: none;
    background: none;
    color: var(--ink);
    font-size: 14px;
    width: 100%;
    font-family: var(--font-body);
}
.search-box__count {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--ink-faint);
    white-space: nowrap;
}
.theme-toggle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--bg-elevated);
    color: var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    flex-shrink: 0;
}
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-moon { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: block; color: var(--accent-strong); }

/* ---------------------------------------------------------------
   Strip statistik ringkas & breadcrumb
   --------------------------------------------------------------- */
.stat-strip {
    display: flex;
    gap: 10px;
    padding: 16px 28px 0;
    flex-wrap: wrap;
}
.stat-pill {
    background: var(--accent-soft);
    color: var(--accent-strong);
    font-size: 12.5px;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 999px;
}
.stat-pill__num { font-family: var(--font-mono); font-weight: 600; margin-right: 4px; }

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 18px 28px 6px;
    font-size: 13px;
    color: var(--ink-soft);
    flex-wrap: wrap;
}
.breadcrumb button {
    background: none;
    border: none;
    color: var(--ink-soft);
    font-size: 13px;
    padding: 2px 4px;
    border-radius: 6px;
}
.breadcrumb button:hover { color: var(--accent-strong); background: var(--accent-soft); }
.breadcrumb .is-current { color: var(--ink); font-weight: 600; }
.breadcrumb .sep { color: var(--ink-faint); }

/* ---------------------------------------------------------------
   Listing ala Finder / Explorer
   --------------------------------------------------------------- */
.listing {
    margin: 10px 28px 40px;
    background: var(--bg-elevated);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.listing__head {
    display: grid;
    grid-template-columns: 1fr 150px 90px 130px 46px;
    padding: 12px 22px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-faint);
    border-bottom: 1px solid var(--line);
}
.listing__body { max-height: none; }

.row {
    display: grid;
    grid-template-columns: 1fr 150px 90px 130px 46px;
    align-items: center;
    padding: 11px 22px;
    border-bottom: 1px solid var(--line);
    transition: background 0.12s ease;
    cursor: pointer;
}
.row:last-child { border-bottom: none; }
.row:hover { background: var(--accent-soft); }

.row__name {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    font-weight: 500;
    color: var(--ink);
}
.row__icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.row__icon svg { width: 17px; height: 17px; }
.row--folder .row__icon { background: var(--gold-soft); color: var(--gold); }
.row--file .row__icon { background: var(--accent-soft); color: var(--accent-strong); }

.row__label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.row__path {
    display: block;
    font-size: 11px;
    color: var(--ink-faint);
    font-family: var(--font-mono);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.badge-new {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--rose-soft);
    color: var(--rose);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.03em;
    vertical-align: middle;
}

.col-modified, .row__modified { font-family: var(--font-mono); font-size: 12px; color: var(--ink-soft); }
.col-size, .row__size { font-family: var(--font-mono); font-size: 12px; color: var(--ink-soft); }

.row__stats {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--ink-soft);
    display: flex;
    align-items: center;
    gap: 12px;
}
.row__stat { display: flex; align-items: center; gap: 4px; }
.row__stat svg { width: 13px; height: 13px; color: var(--ink-faint); }
.row--folder .row__modified, .row--folder .row__size, .row__stats:empty { color: var(--ink-faint); }

.row__action { display: flex; justify-content: center; }
.download-btn {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: var(--bg-elevated);
    color: var(--ink-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.download-btn svg { width: 14px; height: 14px; }
.download-btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

.empty-state {
    padding: 60px 20px;
    text-align: center;
    color: var(--ink-faint);
}
.empty-state svg { width: 40px; height: 40px; margin: 0 auto 12px; }

/* ---------------------------------------------------------------
   Footer
   --------------------------------------------------------------- */
.site-footer {
    background: var(--bg-sidebar);
    border-top: 1px solid var(--line);
    padding: 40px 28px 24px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr;
    gap: 32px;
    max-width: 1200px;
    margin: 0 auto;
}
.footer-block h3 {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 14px;
    color: var(--ink);
}
.footer-muted { color: var(--ink-soft); font-size: 13px; }

.visit-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}
.visit-card {
    background: var(--bg-elevated);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 12px 8px;
    text-align: center;
}
.visit-card__num {
    display: block;
    font-family: var(--font-mono);
    font-size: 18px;
    font-weight: 600;
    color: var(--accent-strong);
}
.visit-card__label { font-size: 10.5px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.04em; }

.browser-bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.browser-bars li { display: flex; align-items: center; gap: 10px; font-size: 12.5px; }
.browser-bars__name { width: 74px; flex-shrink: 0; color: var(--ink-soft); }
.browser-bars__track { flex: 1; height: 7px; background: var(--line); border-radius: 999px; overflow: hidden; }
.browser-bars__fill { display: block; height: 100%; background: var(--gold); border-radius: 999px; }
.browser-bars__pct { width: 38px; text-align: right; font-family: var(--font-mono); color: var(--ink-faint); }

.footer-copy {
    text-align: center;
    font-size: 12px;
    color: var(--ink-faint);
    margin: 32px 0 0;
}

/* ---------------------------------------------------------------
   Responsif
   --------------------------------------------------------------- */
@media (max-width: 900px) {
    .shell { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed;
        z-index: 50;
        top: 0; left: 0; bottom: 0;
        width: 280px;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        box-shadow: var(--shadow);
    }
    .sidebar.is-open { transform: translateX(0); }
    .topbar__menu { display: flex; }
    .footer-grid { grid-template-columns: 1fr; }
    .listing__head .col-size, .row .row__size { display: none; }
    .listing__head, .row { grid-template-columns: 1fr 110px 120px 40px; }
}

@media (max-width: 560px) {
    .listing__head .col-modified, .row .row__modified { display: none; }
    .listing__head, .row { grid-template-columns: 1fr 100px 36px; }
    .row__stats { gap: 8px; }
    .visit-cards { grid-template-columns: repeat(2, 1fr); }
    .listing { margin: 10px 14px 30px; }
    .topbar, .stat-strip, .breadcrumb { padding-left: 14px; padding-right: 14px; }
}

/* Hormati preferensi "reduced motion" */
@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}

/* Fokus keyboard yang jelas */
a:focus-visible, button:focus-visible, input:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
