/* =============================================
   NAVBAR.CSS — Tema Putih Kehijauan
   Path: /portalperaturan/assets/css/navbar.css
   ============================================= */

/* =====================
   NAVBAR BASE
   ===================== */
.main-navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1100;
    background: #ffffff;
    border-bottom: 2px solid #e8f5e9;
    transition: all 0.3s ease;
    height: 68px;
    display: flex;
    align-items: center;
}

/* Scrolled — tambah shadow */
.main-navbar.scrolled {
    box-shadow: 0 4px 20px rgba(23,128,13,0.10);
    border-bottom-color: #c8e6c9;
    height: 62px;
}

.navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 20px;
}

.navbar-spacer { height: 68px; }

/* =====================
   BRAND / LOGO
   ===================== */
.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    flex-shrink: 0;
}
.navbar-logo {
    height: 42px;
    width: auto;
    object-fit: contain;
    transition: transform 0.2s;
}
.navbar-brand:hover .navbar-logo { transform: scale(1.04); }

.navbar-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}
.brand-name {
    font-size: 15px;
    font-weight: 800;
    color: #1b5e20;
    letter-spacing: 0.3px;
}
.brand-tagline {
    font-size: 10px;
    color: #66bb6a;
    font-weight: 500;
    letter-spacing: 0.4px;
}

/* Divider antara logo dan menu */
.navbar-divider {
    width: 1px;
    height: 32px;
    background: #e8f5e9;
    flex-shrink: 0;
}

/* =====================
   DESKTOP MENU
   ===================== */
.navbar-menu {
    display: flex;
    align-items: center;
    gap: 2px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.navbar-menu .nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    color: #4a7a4e;
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s;
    position: relative;
}
.navbar-menu .nav-link i { font-size: 12px; opacity: 0.7; }

.navbar-menu .nav-link:hover {
    background: #f1f8f1;
    color: #1b5e20;
}
.navbar-menu .nav-link.active {
    background: #e8f5e9;
    color: #1b5e20;
    font-weight: 700;
}
.navbar-menu .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 18px;
    height: 2.5px;
    background: #28a745;
    border-radius: 2px;
}


/* =====================
   RIGHT: LOGIN BUTTON + HAMBURGER
   ===================== */
.navbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.btn-login {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 20px;
    background: linear-gradient(135deg, #28a745, #1b5e20);
    color: #fff;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
    border: none;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(40,167,69,0.25);
}
.btn-login:hover {
    background: linear-gradient(135deg, #218838, #145214);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 5px 16px rgba(40,167,69,0.35);
}
.btn-login i { font-size: 12px; }

/* Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: #f1f8f1;
    border: 1px solid #c8e6c9;
    padding: 9px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}
.hamburger:hover { background: #e8f5e9; }
.hamburger span {
    display: block;
    width: 20px;
    height: 2px;
    background: #2e7d32;
    border-radius: 2px;
    transition: all 0.3s ease;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* =====================
   MOBILE MENU
   ===================== */
.mobile-menu {
    display: none;
    background: #fff;
    border-top: 1px solid #e8f5e9;
    padding: 10px 0 14px;
    position: absolute;
    top: 100%; left: 0; right: 0;
    box-shadow: 0 8px 24px rgba(40,167,69,0.1);
    animation: slideDown 0.22s ease;
}
.mobile-menu.show { display: block; }

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.mobile-nav-list {
    list-style: none;
    margin: 0; padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    color: #4a7a4e;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s;
}
.mobile-nav-link i { font-size: 14px; color: #66bb6a; }
.mobile-nav-link:hover,
.mobile-nav-link.active {
    background: #f1f8f1;
    color: #1b5e20;
}
.mobile-login {
    margin-top: 8px;
    background: #e8f5e9;
    color: #1b5e20 !important;
}
.mobile-login i { color: #28a745 !important; }
.mobile-login:hover { background: #c8e6c9 !important; }

/* =====================
   RESPONSIVE
   ===================== */
@media (max-width: 768px) {
    .navbar-menu    { display: none; }
    .navbar-divider { display: none; }
    .btn-login span { display: none; }
    .btn-login      { padding: 9px 13px; }
    .hamburger      { display: flex; }
    .brand-tagline  { display: none; }
}
@media (max-width: 400px) {
    .navbar-logo  { height: 34px; }
    .brand-name   { font-size: 13px; }
}
/* ══════════════════════════════════════════════
   NAVBAR LOGIN NOTICE
   Tambahkan/append ke: /portalperaturan/assets/css/navbar.css
   ══════════════════════════════════════════════ */

/* Belum login — badge kuning/amber */
.navbar-login-notice {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(234, 179, 8, 0.1);
    border: 1px solid rgba(234, 179, 8, 0.35);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #92400e;
    white-space: nowrap;
    text-decoration: none;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    line-height: 1;
}
.navbar-login-notice:hover {
    background: rgba(234, 179, 8, 0.18);
    border-color: rgba(234, 179, 8, 0.55);
    color: #78350f;
    text-decoration: none;
}
.navbar-login-notice i { font-size: 11px; }

/* Sudah login — badge hijau */
.navbar-loggedin-notice {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(22, 163, 74, 0.08);
    border: 1px solid rgba(22, 163, 74, 0.22);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #15803d;
    white-space: nowrap;
    line-height: 1;
}
.navbar-loggedin-notice i { font-size: 11px; }

/* Mobile notice */
.mobile-notice-login {
    color: #92400e !important;
    background: rgba(234, 179, 8, 0.08) !important;
}
.mobile-notice-ok {
    color: #15803d !important;
    background: rgba(22, 163, 74, 0.06) !important;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 500;
    cursor: default;
}

/* Sembunyikan teks label di layar kecil, hanya ikon */
@media (max-width: 900px) {
    .navbar-login-notice span,
    .navbar-loggedin-notice span {
        display: none;
    }
    .navbar-login-notice,
    .navbar-loggedin-notice {
        padding: 6px 8px;
    }
}

/* ══════════════════════════════════════════════
   NAVBAR LOGIN NOTICE
   Tambahkan/append ke: /portalperaturan/assets/css/navbar.css
   ══════════════════════════════════════════════ */

/* Belum login — badge kuning/amber */
.navbar-login-notice {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(234, 179, 8, 0.1);
    border: 1px solid rgba(234, 179, 8, 0.35);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #92400e;
    white-space: nowrap;
    text-decoration: none;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    line-height: 1;
}
.navbar-login-notice:hover {
    background: rgba(234, 179, 8, 0.18);
    border-color: rgba(234, 179, 8, 0.55);
    color: #78350f;
    text-decoration: none;
}
.navbar-login-notice i { font-size: 11px; }

/* Sudah login — badge hijau */
.navbar-loggedin-notice {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(22, 163, 74, 0.08);
    border: 1px solid rgba(22, 163, 74, 0.22);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #15803d;
    white-space: nowrap;
    line-height: 1;
}
.navbar-loggedin-notice i { font-size: 11px; }

/* Mobile notice */
.mobile-notice-login {
    color: #92400e !important;
    background: rgba(234, 179, 8, 0.08) !important;
}
.mobile-notice-ok {
    color: #15803d !important;
    background: rgba(22, 163, 74, 0.06) !important;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 500;
    cursor: default;
}

/* Tombol logout — merah soft */
.btn-logout {
    background: rgba(239, 68, 68, 0.08) !important;
    color: #b91c1c !important;
    border: 1px solid rgba(239, 68, 68, 0.25) !important;
}
.btn-logout:hover {
    background: #ef4444 !important;
    color: #fff !important;
    border-color: #ef4444 !important;
}

.mobile-logout {
    color: #b91c1c !important;
    background: rgba(239, 68, 68, 0.06) !important;
}

/* Sembunyikan teks label di layar kecil, hanya ikon */
@media (max-width: 900px) {
    .navbar-login-notice span,
    .navbar-loggedin-notice span {
        display: none;
    }
    .navbar-login-notice,
    .navbar-loggedin-notice {
        padding: 6px 8px;
    }
}

/* Profile button */
.nav-profile { position: relative; }
.nav-profile-btn {
    display: flex; align-items: center; gap: 9px;
    background: rgba(22,163,74,0.08);
    border: 1px solid rgba(22,163,74,0.2);
    border-radius: 12px; padding: 6px 12px 6px 6px;
    cursor: pointer; font-family: inherit;
    transition: all 0.2s;
}
.nav-profile-btn:hover {
    background: rgba(22,163,74,0.14);
    border-color: rgba(22,163,74,0.35);
}
.nav-avatar {
    width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0;
    background: linear-gradient(135deg, #16a34a, #14532d);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 800; color: #fff;
}
.nav-profile-info { text-align: left; }
.nav-profile-name {
    display: block; font-size: 13px; font-weight: 700;
    color: #14532d; line-height: 1; max-width: 120px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav-profile-role {
    display: block; font-size: 10.5px; color: #6b7280; margin-top: 1px;
    max-width: 120px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav-chevron {
    font-size: 10px; color: #6b7280;
    transition: transform 0.2s; flex-shrink: 0;
}
.nav-chevron.open { transform: rotate(180deg); }
 
/* Dropdown */
.nav-dropdown {
    position: absolute; top: calc(100% + 8px); right: 0;
    width: 240px; background: #fff;
    border: 1px solid #e5e7eb; border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    overflow: hidden; z-index: 999;
    opacity: 0; transform: translateY(-8px) scale(0.97);
    pointer-events: none;
    transition: all 0.2s cubic-bezier(0.22,1,0.36,1);
}
.nav-dropdown.show {
    opacity: 1; transform: translateY(0) scale(1);
    pointer-events: all;
}
.nav-dropdown-header {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 16px;
    background: #f0fdf4;
}
.nav-dropdown-avatar {
    width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
    background: linear-gradient(135deg, #16a34a, #14532d);
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; font-weight: 800; color: #fff;
}
.nav-dropdown-name {
    font-size: 13px; font-weight: 700; color: #14532d; line-height: 1;
}
.nav-dropdown-meta {
    font-size: 11px; color: #9ca3af; margin-top: 2px;
}
.nav-dropdown-divider {
    height: 1px; background: #f3f4f6;
}
.nav-dropdown-item {
    display: flex; align-items: center; gap: 10px;
    width: 100%; padding: 12px 16px;
    font-size: 13.5px; font-weight: 500; color: #374151;
    background: none; border: none; cursor: pointer;
    font-family: inherit; text-decoration: none;
    transition: background 0.15s;
}
.nav-dropdown-item:hover { background: #f9fafb; color: #111827; }
.nav-dropdown-item i { font-size: 13px; color: #9ca3af; width: 16px; }
.nav-dropdown-item:hover i { color: #16a34a; }
.nav-dropdown-logout { color: #dc2626 !important; }
.nav-dropdown-logout i { color: #fca5a5 !important; }
.nav-dropdown-logout:hover { background: #fef2f2 !important; }