/* Custom CSS for Claude AI Aesthetic and modern JuristDigi Branding */

:root {
    --claude-bg-light: #fbfaf7;
    --claude-sidebar-light: #f3f0e8;
    --claude-text-light: #191919;
    --claude-border-light: #e5e2d9;
    --claude-accent: #d97706; /* Elegant gold/bronze representing justice */
    
    --claude-bg-dark: #191919;
    --claude-sidebar-dark: #121212;
    --claude-text-dark: #f5f5f5;
    --claude-border-dark: #2d2d2d;
}

body {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    margin: 0;
    padding: 0;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Light / Dark Mode dynamic classes via Bootstrap theme attributes */
html[data-bs-theme="light"] {
    background-color: var(--claude-bg-light);
    color: var(--claude-text-light);
}

html[data-bs-theme="dark"] {
    background-color: var(--claude-bg-dark);
    color: var(--claude-text-dark);
}

h1, h2, h3, .brand-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
}

/* Sidebar Styling */
.claude-sidebar {
    background-color: var(--claude-sidebar-light);
    border-right: 1px solid var(--claude-border-light);
    transition: all 0.3s ease;
}

html[data-bs-theme="dark"] .claude-sidebar {
    background-color: var(--claude-sidebar-dark);
    border-right: 1px solid var(--claude-border-dark);
}

/* Chat Message Claude AI style */
.chat-container {
    max-width: 800px;
    margin: 0 auto;
}

.chat-bubble {
    border-radius: 16px;
    padding: 12px 18px;
    margin-bottom: 16px;
    max-width: 85%;
    line-height: 1.6;
    font-size: 1.05rem;
}

.chat-bubble-user {
    background-color: #f3f0e8;
    color: #191919;
    align-self: flex-end;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

html[data-bs-theme="dark"] .chat-bubble-user {
    background-color: #2d2d2d;
    color: #f5f5f5;
}

.chat-bubble-ai {
    background-color: transparent;
    color: inherit;
    align-self: flex-start;
    margin-right: auto;
    border: none;
    padding-left: 0;
    padding-right: 0;
}

/* Claude AI Input Bar */
.claude-input-bar {
    background: #ffffff;
    border: 1px solid var(--claude-border-light);
    border-radius: 24px;
    padding: 8px 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    transition: all 0.3s ease;
}

html[data-bs-theme="dark"] .claude-input-bar {
    background: #252525;
    border: 1px solid var(--claude-border-dark);
}

.claude-input-bar:focus-within {
    border-color: var(--claude-accent);
    box-shadow: 0 4px 16px rgba(217, 119, 6, 0.15);
}

.claude-textarea {
    border: none;
    outline: none;
    background: transparent;
    width: 100%;
    resize: none;
    font-size: 1.05rem;
}

/* Interactive Cards styling */
.claude-card {
    background-color: #ffffff;
    border: 1px solid var(--claude-border-light);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.01);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

html[data-bs-theme="dark"] .claude-card {
    background-color: #212121;
    border: 1px solid var(--claude-border-dark);
}

.claude-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
}

/* Accent Buttons */
.btn-accent {
    background-color: var(--claude-accent);
    color: white;
    font-weight: 500;
    border-radius: 8px;
    padding: 8px 16px;
    transition: all 0.2s ease;
}

.btn-accent:hover {
    background-color: #b45309;
    color: white;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.2);
}

/* Theme toggle button styling */
.theme-toggle-btn {
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background-color: #f3f0e8;
    border: 1px solid var(--claude-border-light);
    transition: all 0.2s ease;
}

html[data-bs-theme="dark"] .theme-toggle-btn {
    background-color: #2d2d2d;
    border: 1px solid var(--claude-border-dark);
}

.theme-toggle-btn:hover {
    background-color: #e5e2d9;
}

html[data-bs-theme="dark"] .theme-toggle-btn:hover {
    background-color: #3d3d3d;
}

/* ==========================================================================
   NAVIGASI UTAMA & AKSESIBILITAS
   ========================================================================== */

/* Tautan lewati navigasi: tersembunyi sampai difokus lewat papan ketik. */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 10000;
    padding: .6rem 1rem;
    border-radius: 0 0 .5rem 0;
    background-color: var(--claude-accent);
    color: #fff;
    text-decoration: none;
}

.skip-link:focus {
    left: 0;
    color: #fff;
}

/* Cincin fokus yang konsisten pada seluruh kendali; jangan dihapus, ini
   satu-satunya penanda posisi bagi pengguna papan ketik. */
.app-nav a:focus-visible,
.app-nav button:focus-visible,
.theme-toggle-btn:focus-visible,
.notif__btn:focus-visible {
    outline: 2px solid var(--claude-accent);
    outline-offset: 2px;
}

.app-nav__links { display: flex; align-items: center; gap: .25rem; }

.app-nav__link {
    padding: .35rem .6rem;
    border-radius: .45rem;
    text-decoration: none;
    color: var(--bs-secondary-color);
    font-size: .95rem;
    white-space: nowrap;
}

.app-nav__link:hover { color: var(--claude-accent); background-color: rgba(217, 119, 6, .08); }

.app-nav__link.is-active {
    color: var(--claude-accent);
    background-color: rgba(217, 119, 6, .12);
    font-weight: 600;
}

.app-nav__toggle {
    display: none;
    width: 40px; height: 40px;
    align-items: center; justify-content: center;
    border-radius: .5rem;
    border: 1px solid var(--claude-border-light);
    background: none;
    color: inherit;
    cursor: pointer;
}

html[data-bs-theme="dark"] .app-nav__toggle { border-color: var(--claude-border-dark); }

/* Di bawah lg, tautan runtuh menjadi panel vertikal agar tidak berdesakan. */
@media (max-width: 991.98px) {
    .app-nav__toggle { display: inline-flex; }

    .app-nav__links {
        display: none;
        position: absolute;
        top: 100%;
        right: .75rem;
        left: .75rem;
        flex-direction: column;
        align-items: stretch;
        gap: .15rem;
        padding: .6rem;
        border: 1px solid var(--claude-border-light);
        border-radius: .6rem;
        background-color: var(--bs-body-bg);
        box-shadow: 0 12px 28px rgba(0, 0, 0, .12);
    }

    html[data-bs-theme="dark"] .app-nav__links { border-color: var(--claude-border-dark); }

    .app-nav__links.is-open { display: flex; }
    .app-nav__link { padding: .55rem .7rem; }
}

/* ==========================================================================
   LONCENG NOTIFIKASI
   ========================================================================== */
.notif { position: relative; }

.notif__btn {
    position: relative;
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--claude-border-light);
    background-color: #f3f0e8;
    color: inherit;
    cursor: pointer;
    transition: background-color .2s ease;
}

html[data-bs-theme="dark"] .notif__btn {
    background-color: #2d2d2d;
    border-color: var(--claude-border-dark);
}

.notif__btn:hover { background-color: #e5e2d9; }
html[data-bs-theme="dark"] .notif__btn:hover { background-color: #3d3d3d; }

.notif__badge {
    position: absolute;
    top: -2px; right: -2px;
    min-width: 18px;
    padding: 0 4px;
    border-radius: 999px;
    background-color: #d03b3b;
    color: #fff;
    font-size: .66rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
}

/* Lapisan penutup: sekali klik di luar panel untuk menutupnya. */
.notif__scrim { position: fixed; inset: 0; z-index: 1040; }

.notif__panel {
    position: absolute;
    top: calc(100% + .5rem);
    right: 0;
    z-index: 1045;
    width: min(22rem, calc(100vw - 2rem));
    border: 1px solid var(--claude-border-light);
    border-radius: .7rem;
    background-color: var(--bs-body-bg);
    box-shadow: 0 16px 40px rgba(0, 0, 0, .16);
    overflow: hidden;
}

html[data-bs-theme="dark"] .notif__panel { border-color: var(--claude-border-dark); }

.notif__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding: .7rem .9rem;
    border-bottom: 1px solid var(--claude-border-light);
}

html[data-bs-theme="dark"] .notif__head { border-bottom-color: var(--claude-border-dark); }

.notif__title { font-weight: 600; font-size: .9rem; }

.notif__list { max-height: 24rem; overflow-y: auto; }

.notif__empty { padding: 1.5rem .9rem; margin: 0; text-align: center; font-size: .84rem; opacity: .6; }

.notif__item {
    display: flex;
    gap: .6rem;
    width: 100%;
    padding: .7rem .9rem;
    border: 0;
    border-bottom: 1px solid var(--claude-border-light);
    background: none;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

html[data-bs-theme="dark"] .notif__item { border-bottom-color: var(--claude-border-dark); }

.notif__item:last-child { border-bottom: 0; }
.notif__item:hover { background-color: rgba(217, 119, 6, .07); }
.notif__item.is-unread { background-color: rgba(217, 119, 6, .05); }
.notif__item.is-unread .notif__item-title { font-weight: 700; }

.notif__dot { flex: 0 0 auto; width: 8px; height: 8px; margin-top: .35rem; border-radius: 50%; }

/* Warna status tetap, tidak mengikuti tema, dan selalu didampingi teks
   sehingga makna tidak pernah dibawa oleh warna sendirian. */
.notif__dot--info { background-color: #2a78d6; }
.notif__dot--success { background-color: #0ca30c; }
.notif__dot--warning { background-color: #fab219; }
.notif__dot--danger { background-color: #d03b3b; }

.notif__body { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.notif__item-title { font-size: .84rem; line-height: 1.35; }
.notif__item-msg { font-size: .78rem; opacity: .75; line-height: 1.4; }
.notif__item-meta { font-size: .7rem; opacity: .55; }

/* ==========================================================================
   GERAK
   Hormati preferensi sistem untuk mengurangi animasi.
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ==========================================================================
   PORTAL ACCESS — pemilih layanan
   Pada layar sempit deretan tombol menggulir mendatar, bukan membungkus
   menjadi beberapa baris yang mendorong isi halaman ke bawah.
   ========================================================================== */
.access-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    justify-content: flex-end;
}

.access-tabs__btn {
    padding: .4rem .85rem;
    border-radius: .5rem;
    border: 1px solid var(--claude-border-light);
    background: none;
    color: inherit;
    font-size: .88rem;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease;
}

html[data-bs-theme="dark"] .access-tabs__btn { border-color: var(--claude-border-dark); }

.access-tabs__btn:hover { border-color: var(--claude-accent); }

.access-tabs__btn:focus-visible {
    outline: 2px solid var(--claude-accent);
    outline-offset: 2px;
}

.access-tabs__btn.is-active {
    border-color: var(--claude-accent);
    background-color: var(--claude-accent);
    color: #fff;
    font-weight: 600;
}

@media (max-width: 767.98px) {
    .access-tabs {
        flex-wrap: nowrap;
        justify-content: flex-start;
        width: 100%;
        overflow-x: auto;
        padding-bottom: .35rem;
        scrollbar-width: thin;
    }
}
