:root {
    /* 
     * Ukuran font dasar (mengatur root size).
     */
    --font-size-root: 15px;

    /* Warna Utama (Primary) */
    --color-primary: #162447;
    --color-primary-hover: #1f3160;

    /* Konfigurasi Font Family Default */
    --font-base: 'Inter', sans-serif;

    /* Konfigurasi Warna Teks dan Latar Belakang Default */
    --color-text-default: #111827;
    /* Setara dengan text-gray-900 */
    --color-bg-default: #f9fafb;
    /* Setara dengan bg-gray-50 */

    /* Navbar */
    --navbar-height: 68px;
}

/* Mengatur ukuran font global */
html {
    font-size: var(--font-size-root);
}

/* Menerapkan font, warna background, dan warna text default ke body */
body {
    font-family: var(--font-base);
    color: var(--color-text-default);
    background-color: var(--color-bg-default);
}

/* Utility tambahan yang diperlukan secara global, contohnya Alpine.js cloak */
[x-cloak] {
    display: none !important;
}

/* ============================================================
 * TOP NAVBAR STYLES
 * ============================================================ */

.site-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    height: var(--navbar-height);
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                background-color 0.3s ease,
                box-shadow 0.3s ease;
    will-change: transform;
}

.site-navbar.navbar-scrolled {
    background-color: rgba(255, 255, 255, 0.92);
    box-shadow: 0 1px 20px rgba(0, 0, 0, 0.06);
}

.site-navbar.navbar-hidden {
    transform: translateY(-100%);
    pointer-events: none;
}

/* Offset konten sudah dihandle via Tailwind class di main.php */

.navbar-container {
    max-width: 1400px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    gap: 1rem;
}

/* --- Brand --- */
.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    text-decoration: none;
    flex-shrink: 0;
}

.navbar-logo-img {
    width: 38px;
    height: 38px;
    object-fit: contain;
}

.navbar-brand-text {
    display: flex;
    flex-direction: column;
}

.navbar-brand-name {
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--color-primary);
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.navbar-brand-sub {
    font-size: 0.625rem;
    color: #9ca3af;
    font-weight: 500;
    letter-spacing: 0.03em;
}

/* --- Desktop menu (hidden below lg) --- */
.navbar-menu {
    display: none;
    align-items: center;
    gap: 0.125rem;
}

@media (min-width: 1024px) {
    .navbar-menu {
        display: flex;
    }
}

/* --- Menu link / trigger --- */
.navbar-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #4b5563;
    border-radius: 0.5rem;
    white-space: nowrap;
    transition: color 0.2s, background-color 0.2s;
    border: none;
    background: transparent;
    cursor: pointer;
    position: relative;
}

.navbar-link:hover {
    color: var(--color-primary);
    background-color: rgba(22, 36, 71, 0.04);
}

.navbar-link.active {
    color: var(--color-primary);
    font-weight: 600;
}

.navbar-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 2.5px;
    background: var(--color-primary);
    border-radius: 2px;
}

.navbar-chevron {
    width: 14px;
    height: 14px;
    opacity: 0.45;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

/* --- Dropdown --- */
.navbar-dropdown-wrap {
    position: relative;
    /* padding-bottom creates a hover bridge between trigger and dropdown */
    padding-bottom: 6px;
    margin-bottom: -6px;
}

.navbar-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 230px;
    background: white;
    border-radius: 0.875rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1),
                0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.06);
    padding: 0.375rem;
    z-index: 60;
}

.navbar-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    color: #4b5563;
    border-radius: 0.5rem;
    transition: all 0.15s ease;
    text-decoration: none;
}

.navbar-dropdown-item:hover {
    background-color: rgba(22, 36, 71, 0.05);
    color: var(--color-primary);
}

.navbar-dropdown-item.active {
    background-color: rgba(22, 36, 71, 0.07);
    color: var(--color-primary);
    font-weight: 600;
}

/* --- Right actions --- */
.navbar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.navbar-user-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem;
    border-radius: 0.625rem;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: background-color 0.2s;
}

.navbar-user-btn:hover {
    background-color: #f3f4f6;
}

.navbar-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(22, 36, 71, 0.1), rgba(22, 36, 71, 0.15));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
    font-weight: 700;
    font-size: 0.8125rem;
}

.navbar-login-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1.125rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: white;
    background: var(--color-primary);
    border-radius: 0.625rem;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(22, 36, 71, 0.2);
}

.navbar-login-btn:hover {
    background: var(--color-primary-hover);
    box-shadow: 0 4px 12px rgba(22, 36, 71, 0.3);
    transform: translateY(-1px);
}

/* --- Hamburger (mobile only) --- */
.navbar-hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 0.625rem;
    border: none;
    background: transparent;
    color: #374151;
    cursor: pointer;
    transition: background-color 0.2s;
}

.navbar-hamburger:hover {
    background-color: #f3f4f6;
}

@media (min-width: 1024px) {
    .navbar-hamburger {
        display: none;
    }
}

/* ============================================================
 * MOBILE DRAWER STYLES
 * ============================================================ */

.mobile-drawer-link {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: 0.625rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #4b5563;
    transition: all 0.15s ease;
    border: none;
    background: transparent;
    cursor: pointer;
    text-align: left;
}

.mobile-drawer-link:hover {
    background-color: #f3f4f6;
    color: var(--color-primary);
}

.mobile-drawer-link.active {
    background-color: rgba(22, 36, 71, 0.05);
    color: var(--color-primary);
    font-weight: 600;
}

.mobile-drawer-icon {
    width: 34px;
    height: 34px;
    border-radius: 0.5rem;
    background-color: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.mobile-drawer-icon.active {
    background-color: rgba(22, 36, 71, 0.1);
    color: var(--color-primary);
}

.mobile-drawer-link:hover .mobile-drawer-icon {
    background-color: rgba(22, 36, 71, 0.08);
    color: var(--color-primary);
}

.mobile-drawer-sublink {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    color: #6b7280;
    text-decoration: none;
    transition: all 0.15s ease;
}

.mobile-drawer-sublink:hover {
    background-color: #f3f4f6;
    color: var(--color-primary);
}

.mobile-drawer-sublink.active {
    background-color: rgba(22, 36, 71, 0.06);
    color: var(--color-primary);
    font-weight: 600;
}


/* ============================================================
 * Styling untuk merender konten Rich Text (Quill / HTML) 
 * ============================================================ */
.richtext-render p {
    margin-bottom: 0.75rem;
    line-height: 1.7;
}
.richtext-render p:last-child {
    margin-bottom: 0;
}
.richtext-render ul {
    list-style-type: disc !important;
    list-style-position: outside !important;
    padding-left: 1.5rem !important;
    margin-bottom: 0.75rem;
}
.richtext-render ol {
    list-style-type: decimal !important;
    list-style-position: outside !important;
    padding-left: 1.5rem !important;
    margin-bottom: 0.75rem;
}
.richtext-render li {
    display: list-item !important;
    margin-bottom: 0.35rem;
    line-height: 1.6;
}
/* Menyembunyikan span ql-ui kosong yang kadang digenerate oleh Quill */
.richtext-render li .ql-ui {
    display: none !important;
}
.richtext-render h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
}
.richtext-render h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}
.richtext-render h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 0.75rem;
    margin-bottom: 0.35rem;
}
.richtext-render blockquote {
    border-left: 4px solid var(--color-primary, #162447);
    padding-left: 1rem;
    font-style: italic;
    color: #4b5563;
    margin-bottom: 1rem;
}
.richtext-render a {
    color: #2563eb;
    text-decoration: underline;
}
.richtext-render a:hover {
    color: #1d4ed8;
}

/* ============================================================
 * SKELETON SCREEN — Shimmer Effect
 * Gunakan class .skeleton pada elemen placeholder
 * ============================================================ */
@keyframes skeleton-shimmer {
    0%   { background-position: -1200px 0; }
    100% { background-position: 1200px 0; }
}

.skeleton {
    background: linear-gradient(
        90deg,
        #e8eaf0 25%,
        #f4f6fa 50%,
        #e8eaf0 75%
    );
    background-size: 1200px 100%;
    animation: skeleton-shimmer 1.5s infinite linear;
    border-radius: 0.5rem;
    color: transparent !important;
    pointer-events: none;
    user-select: none;
}

.skeleton * {
    visibility: hidden;
}

.skeleton-dark {
    background: linear-gradient(
        90deg,
        #d1d5db 25%,
        #e5e7eb 50%,
        #d1d5db 75%
    );
    background-size: 1200px 100%;
    animation: skeleton-shimmer 1.5s infinite linear;
    border-radius: 0.5rem;
}

/* Page-level skeleton screen — muncul sebelum JS selesai render */
.page-skeleton {
    opacity: 1;
    transition: opacity 0.3s ease;
}
.page-skeleton.loaded {
    opacity: 0;
    pointer-events: none;
    position: absolute !important;
    height: 0 !important;
    overflow: hidden !important;
}
.page-content {
    opacity: 0;
    transition: opacity 0.35s ease 0.05s;
}
.page-content.loaded {
    opacity: 1;
}

/* Skeleton block utilities */
.sk-block  { display: block; border-radius: 0.375rem; }
.sk-circle { border-radius: 9999px; }
.sk-img    { border-radius: 0.75rem; width: 100%; }

/* ============================================================
 * INLINE BUTTON SPINNER
 * ============================================================ */
@keyframes btn-spin {
    to { transform: rotate(360deg); }
}

.btn-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: btn-spin 0.65s linear infinite;
    flex-shrink: 0;
    vertical-align: middle;
    margin-right: 6px;
}

.btn-spinner-dark {
    border-color: rgba(22, 36, 71, 0.2);
    border-top-color: #162447;
}

/* tombol saat loading state */
[data-loading="true"] {
    opacity: 0.75;
    cursor: not-allowed !important;
    pointer-events: none;
}

/* ============================================
   BERANDA LANDING PAGE
   ============================================ */

/* Hero — breaks out of main padding to be full-bleed */
.beranda-hero {
    position: relative;
    overflow: hidden;
    min-height: 500px;
    height: calc(100vh - var(--navbar-height, 64px));
    margin: -1rem -1rem 0;
}

@media (min-width: 768px) {
    .beranda-hero {
        margin: -1.5rem -1.5rem 0;
    }
}

/* Stats dark bar */
.beranda-stats {
    background: var(--color-primary);
    margin: 0 -1rem;
}

@media (min-width: 768px) {
    .beranda-stats {
        margin: 0 -1.5rem;
    }
}

/* Generic section — breaks out of main padding */
.beranda-section {
    margin: 0 -1rem;
}

@media (min-width: 768px) {
    .beranda-section {
        margin: 0 -1.5rem;
    }
}

/* CTA banner with gradient + pattern */
.beranda-cta {
    background: linear-gradient(135deg, #162447 0%, #1a2f5e 50%, #1e3a6e 100%);
    margin: 0 -1rem;
    position: relative;
    overflow: hidden;
}

@media (min-width: 768px) {
    .beranda-cta {
        margin: 0 -1.5rem;
    }
}

.beranda-cta::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(255,255,255,0.06) 1px, transparent 1px);
    background-size: 24px 24px;
    pointer-events: none;
}