/* ============================================
   WiFiHapa - Header Stylesheet
   Navigation, Sidebar, Theme Toggle, Language Dropdown
   ============================================ */

/* ----- CSS VARIABLES (Light Mode Default) ----- */
:root {
    --bg-body: #f8fafd;
    --text-primary: #0a2c3d;
    --text-secondary: #5a6e7c;
    --card-bg: #ffffff;
    --nav-bg: #ffffff;
    --footer-bg: linear-gradient(135deg, #0b2b40 0%, #0a1f2e 100%);
    --border-light: rgba(13, 110, 253, 0.05);
    --hero-bg: linear-gradient(145deg, #f2f8ff 0%, #ffffff 100%);
    --input-bg: #ffffff;
    --badge-light-bg: #f0f3fa;
    --modal-bg: #f8fafd;
    --dropdown-hover: #f8f9fa;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 20px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 12px 30px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s ease;
}

/* ----- DARK MODE VARIABLES ----- */
body.dark {
    --bg-body: #121826;
    --text-primary: #eef2ff;
    --text-secondary: #9ca3af;
    --card-bg: #1e2538;
    --nav-bg: #1a1f2e;
    --footer-bg: linear-gradient(135deg, #0a1424 0%, #070e1a 100%);
    --border-light: rgba(255, 255, 255, 0.05);
    --hero-bg: linear-gradient(145deg, #111827 0%, #1e2538 100%);
    --input-bg: #2d3748;
    --badge-light-bg: #2a3448;
    --modal-bg: #1a1f2e;
    --dropdown-hover: #2d3748;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 20px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 12px 30px rgba(0, 0, 0, 0.3);
}

/* ----- RESET & BASE ----- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.2s ease;
}

/* ----- BRAND COLORS ----- */
.wifi {
    color: #0d6efd;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.hapa {
    color: #d4a11e;
    position: relative;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.hapa::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 3px;
    background: #d4a11e;
    border-radius: 3px;
}

/* ----- LAYOUT UTILITIES ----- */
.full-width-wrapper {
    width: 100%;
    max-width: 100%;
}

.constrained-content {
    max-width: 1500px;
    margin: 0 auto;
    width: 100%;
    padding: 0 1.5rem;
}

/* ----- DESKTOP NAVIGATION ----- */
.desktop-nav {
    background-color: var(--nav-bg);
    box-shadow: var(--shadow-sm);
    padding: 0.8rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.desktop-nav .constrained-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.desktop-nav-brand {
    font-size: 1.9rem;
    font-weight: 800;
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition);
}

.desktop-nav-brand:hover {
    opacity: 0.85;
}

.desktop-nav-links {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.desktop-nav-links a {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    padding: 0.5rem 1.1rem;
    border-radius: 50px;
    transition: var(--transition);
    font-size: 0.95rem;
}

.desktop-nav-links a:hover,
.desktop-nav-links a.active {
    background-color: #0d6efd;
    color: white;
}

/* Dropdown Menu */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown > a {
    cursor: pointer;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: var(--card-bg);
    min-width: 200px;
    box-shadow: var(--shadow-md);
    border-radius: 16px;
    z-index: 1000;
    top: 100%;
    left: 0;
    margin-top: 0.5rem;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    visibility: hidden;
}

.dropdown:hover .dropdown-content,
.dropdown-content:hover {
    display: block;
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

.dropdown-content a {
    display: block;
    padding: 0.75rem 1.5rem;
    white-space: nowrap;
    border-radius: 0;
    color: var(--text-primary);
}

.dropdown-content a:first-child {
    border-radius: 16px 16px 0 0;
}

.dropdown-content a:last-child {
    border-radius: 0 0 16px 16px;
}

.dropdown-content a:hover {
    background-color: #0d6efd;
    color: white;
}

/* Register Button */
.desktop-nav-links .btn-register {
    background: #d4a11e;
    color: white;
}

.btn-register:hover {
    background: #b3881a !important;
    color: white !important;
}

/* ----- THEME TOGGLE SWITCH ----- */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 0.5rem;
}

.theme-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 30px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #d4a11e;
}

input:checked + .slider:before {
    transform: translateX(30px);
}

/* ----- LANGUAGE DROPDOWN ----- */
.lang-dropdown {
    position: relative;
    display: inline-block;
}

.lang-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--badge-light-bg);
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.lang-selector:hover {
    background: var(--dropdown-hover);
}

.lang-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    min-width: 160px;
    z-index: 1000;
    overflow: hidden;
}

.lang-dropdown.active .lang-dropdown-menu {
    display: block;
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    text-decoration: none;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
}

.lang-option:hover {
    background: var(--dropdown-hover);
}

.lang-option.active {
    background: #0d6efd;
    color: white;
}

.lang-option i {
    width: 20px;
}

/* ----- MOBILE HEADER ----- */
.mobile-header {
    background: var(--nav-bg);
    padding: 0.8rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.mobile-brand {
    font-size: 1.6rem;
    font-weight: 800;
    text-decoration: none;
    color: var(--text-primary);
}

.mobile-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.mobile-controls .theme-switch {
    width: 50px;
    height: 26px;
}

.mobile-controls .slider:before {
    height: 18px;
    width: 18px;
}

input:checked + .slider:before {
    transform: translateX(24px);
}

.btn-mobile-menu {
    border: 1px solid #0d6efd;
    background: transparent;
    border-radius: 50px;
    padding: 0.5rem 1rem;
    color: #0d6efd;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-mobile-menu:hover {
    background: #0d6efd10;
}

/* Responsive Navigation */
@media (min-width: 992px) {
    .mobile-header {
        display: none;
    }
}

@media (max-width: 991.98px) {
    .desktop-nav {
        display: none;
    }
}

/* ----- SIDEBAR (OFFCANVAS) ----- */
.offcanvas-start {
    background-color: #0b2b40;
    color: white;
    width: 280px;
}

.offcanvas-header .btn-close {
    filter: invert(1) brightness(2);
    opacity: 0.9;
}

.sidebar-brand {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    padding-left: 0.5rem;
}

.sidebar-nav {
    list-style: none;
    padding: 0;
}

.sidebar-nav li {
    margin-bottom: 0.5rem;
}

.sidebar-nav a,
.dropdown-nav-btn {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    display: block;
    padding: 0.8rem 1rem;
    border-radius: 40px;
    transition: var(--transition);
    cursor: pointer;
}

.sidebar-nav a i,
.dropdown-nav-btn i {
    width: 28px;
    margin-right: 12px;
    text-align: center;
    color: #d4a11e;
}

.sidebar-nav a:hover,
.dropdown-nav-btn:hover {
    background-color: rgba(255, 255, 255, 0.12);
    color: white;
}

/* Sidebar Dropdown */
.sidebar-nav .dropdown-nav {
    margin-bottom: 0.5rem;
}

.dropdown-nav-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dropdown-nav-content {
    display: none;
    list-style: none;
    padding-left: 2.5rem;
    margin-top: 0.5rem;
}

.dropdown-nav.open .dropdown-nav-content {
    display: block;
}

.dropdown-nav-btn .fa-chevron-down {
    transition: transform 0.2s;
    font-size: 0.8rem;
}

.dropdown-nav.open .dropdown-nav-btn .fa-chevron-down {
    transform: rotate(180deg);
}

.dropdown-nav-content li {
    margin-bottom: 0.3rem;
}

.dropdown-nav-content a {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* ----- RESPONSIVE HEADER ----- */
@media (max-width: 1200px) {
    .constrained-content {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

@media (max-width: 992px) {
    .desktop-nav-links {
        gap: 0.3rem;
    }
    .desktop-nav-links a {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 768px) {
    .theme-switch-wrapper {
        margin-left: 0;
    }
    .lang-selector {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .mobile-controls {
        gap: 0.4rem;
    }
    .mobile-brand {
        font-size: 1.3rem;
    }
    .btn-mobile-menu {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--badge-light-bg);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #0d6efd;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #d4a11e;
}

/* Utility Classes */
.text-primary {
    color: #0d6efd !important;
}

.text-gold {
    color: #d4a11e !important;
}

.bg-gold {
    background: #d4a11e !important;
}

.cursor-pointer {
    cursor: pointer;
}

.no-select {
    user-select: none;
}

