/* ============================================================================
   PAPIKOST PENGHUNI NAVIGATION - CLEAN & OPTIMIZED
   Zero Bootstrap | Modern Design | Responsive Layout
============================================================================ */

/* CSS VARIABLES - Using global variables from style-base.css */

/* ============================================================================
   BASE LAYOUT STRUCTURE  
============================================================================ */

/* SIDEBAR */
.penghuni-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, #ffee8c 0%, #fffbf0 25%, #ffffff 50%);
    border-right: 1px solid var(--gray-200);
    box-shadow: 0 2px 12px rgba(27, 117, 187, 0.08);
    z-index: 1050;
    overflow-y: auto;
    overflow-x: hidden;
    transition: var(--transition-smooth);
    transform: translateX(-100%); /* Hidden by default for mobile/tablet */
}

/* Default state - hidden scrollbar */
.penghuni-sidebar::-webkit-scrollbar {
    width: 6px;
}

.penghuni-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.penghuni-sidebar::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 3px;
}

/* Hover state - show scrollbar */
.penghuni-sidebar:hover::-webkit-scrollbar-thumb {
    background: rgba(108, 117, 125, 0.3);
}

.penghuni-sidebar:hover::-webkit-scrollbar-thumb:hover {
    background: rgba(108, 117, 125, 0.6);
}

.penghuni-sidebar:hover::-webkit-scrollbar-thumb:active {
    background: rgba(108, 117, 125, 0.8);
}



/* TOPBAR */
.penghuni-topbar {
    position: sticky;
    top: 0;
    height: var(--topbar-height);
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}

/* ============================================================================
   DESKTOP LAYOUT (≥1025px) - Sidebar visible by default
============================================================================ */
@media (min-width: 1025px) {
    /* Default state: sidebar visible */
    .penghuni-sidebar {
        transform: translateX(0) !important; /* Show sidebar by default */
    }
    
    .penghuni-content-wrapper {
        margin-left: var(--sidebar-width) !important; /* Add sidebar margin */
    }
    
    /* When sidebar is hidden via hamburger click */
    .sidebar-hidden .penghuni-sidebar {
        transform: translateX(-100%) !important;
    }
    
    .sidebar-hidden .penghuni-content-wrapper {
        margin-left: 0 !important;
    }
}

/* ============================================================================
   SIDEBAR CONTENT
============================================================================ */

/* Brand Header */
.sidebar-brand {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.brand-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
}

/* Navigation Menu */
.sidebar-nav {
    padding: 8px 0;
}

.nav-section {
    margin-bottom: 16px;
}

.nav-section-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 16px 20px 8px 20px;
    margin-top: 8px;
}

.nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item {
    margin-bottom: 1px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: var(--gray-600);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition-smooth);
    margin: 0 12px;
    border-radius: 8px;
}

.nav-link:hover {
    background: rgba(255, 241, 0, 0.15);
    color: var(--gray-900);
    text-decoration: none;
}

.nav-link.active {
    background: var(--yellow);
    color: var(--gray-900);
    text-decoration: none;
    font-weight: 600;
}

.nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

/* Enhanced hover effect with icon scaling */
.nav-link:hover .nav-icon {
    transform: scale(1.1);
}

/* Colorful Navigation Icons */
/* Menu Section Icons */
.nav-link[href*="dashboard"] .nav-icon {
    color: #3B82F6 !important; /* Blue for dashboard */
}

.nav-link[href*="profil"] .nav-icon {
    color: #8B4513 !important; /* Brown for profile */
}

.nav-link[href*="ubah-kata-sandi"] .nav-icon,
.nav-link[href*="password"] .nav-icon {
    color: #059669 !important; /* Emerald green for security */
}

/* Aktivitas Section Icons */
.nav-link[href*="reservasi"] .nav-icon,
.nav-link[href*="pesanan"] .nav-icon {
    color: #3B82F6 !important; /* Blue for reservations */
}

.nav-link[href*="chat"] .nav-icon {
    color: #06B6D4 !important; /* Cyan for chat */
}

.nav-link[href*="survey-lokasi"] .nav-icon,
.nav-link[href*="riwayat-survey"] .nav-icon {
    color: #A855F7 !important; /* Purple for survey */
}

.nav-link[href*="keluhan"] .nav-icon {
    color: #EF4444 !important; /* Red for complaints */
}

.nav-link[href*="favorit"] .nav-icon {
    color: #EC4899 !important; /* Pink for favorites */
}

.nav-link[href*="ulasan"] .nav-icon {
    color: #F59E0B !important; /* Orange for reviews */
}

/* Preferensi Section Icons */
.nav-link[href*="notifikasi"] .nav-icon {
    color: #22C55E !important; /* Green for notifications */
}

.nav-link[href*="pengingat-pembayaran"] .nav-icon {
    color: #FB923C !important; /* Orange for payment reminders */
}

.nav-link[href*="search"] .nav-icon {
    color: #6366F1 !important; /* Indigo for search */
}

/* Lainnya Section Icons */
.nav-link[href*="daftar-pemilik"] .nav-icon {
    color: #06B6D4 !important; /* Cyan for owner registration */
}

.nav-link[href*="keluar"] .nav-icon,
.nav-link[href*="logout"] .nav-icon {
    color: #DC2626 !important; /* Red for logout */
}

/* Sidebar Navigation Badges */
.sidebar-badge {
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: #ED1C24;
    color: var(--white);
    border-radius: 8px;
    font-size: 10px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    position: relative !important;
}

/* ============================================================================
   TOPBAR COMPONENTS
============================================================================ */

.topbar-left,
.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Mobile Buttons */
.mobile-menu-btn,
.mobile-profile-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: none;
    background: var(--gray-100);
    color: var(--gray-600);
    display: none; /* Hidden by default */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.mobile-menu-btn:hover,
.mobile-profile-btn:hover {
    background: rgba(255, 241, 0, 0.15);
    color: var(--gray-900);
}

/* DESKTOP: Hide both hamburger and profile button */
@media (min-width: 1025px) {
    .mobile-menu-btn {
        display: none !important;
    }
    
    .mobile-profile-btn {
        display: none !important;
    }
}

/* Page Title */
.page-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-900);
}

/* Topbar Icons */
.topbar-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50px;
    border: none;
    background: var(--gray-50);
    color: var(--gray-600);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    position: relative;
}

.topbar-icon-btn:hover {
    background: rgba(255, 241, 0, 0.15);
    color: var(--gray-900);
}

.notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 16px;
    height: 16px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--white);
}

/* User Profile */
.user-profile-dropdown {
    position: relative;
}

.profile-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.profile-trigger:hover {
    background: rgba(255, 241, 0, 0.15);
}

.profile-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue), #0d47a1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.profile-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 200px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 16px rgba(27, 117, 187, 0.08);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: var(--transition-smooth);
}

.profile-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: var(--gray-700);
    text-decoration: none;
    font-size: 13px;
    transition: var(--transition-smooth);
}

.dropdown-item:hover {
    background: rgba(255, 241, 0, 0.15);
    color: var(--gray-900);
    text-decoration: none;
}

.dropdown-divider {
    height: 1px;
    background: var(--gray-200);
    margin: 8px 0;
}

/* ============================================================================
   MOBILE SIDEBAR SYSTEM
============================================================================ */

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1059;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: var(--transition-smooth);
}

.sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Sidebar Open State */
.penghuni-sidebar.mobile-open {
    transform: translateX(0);
}

/* Body state when sidebar is open */
.sidebar-open .penghuni-sidebar {
    transform: translateX(0);
}

/* ============================================================================
   RESPONSIVE BREAKPOINTS
============================================================================ */

/* TABLET (769px - 1024px): Sidebar hidden by default, show with overlay */
@media (max-width: 1024px) and (min-width: 769px) {
    .penghuni-sidebar {
        transform: translateX(-100%) !important; /* Hidden by default */
        z-index: 1060; /* Higher z-index for overlay */
    }
    
    .mobile-menu-btn {
        display: flex !important;
    }
    
    .mobile-profile-btn {
        display: none !important;
    }
    
    .penghuni-content-wrapper {
        margin-left: 0 !important; /* Always full width */
    }
    
    /* When sidebar is opened - overlay mode */
    .sidebar-open .penghuni-sidebar {
        transform: translateX(0) !important;
    }
    
    /* Ensure content stays full width even when sidebar open */
    .sidebar-open .penghuni-content-wrapper {
        margin-left: 0 !important;
    }
}

/* MOBILE (≤768px): Hide sidebar & menu button, show only profile */
@media (max-width: 768px) {
    .penghuni-sidebar {
        display: none !important; /* Completely hide sidebar */
    }
    
    .mobile-menu-btn {
        display: none !important; /* Hide hamburger menu */
    }
    
    .mobile-profile-btn {
        display: flex !important; /* Show profile button */
    }
    
    .topbar-right {
        display: none !important; /* Hide other topbar elements */
    }
    
    .penghuni-content-wrapper {
        margin-left: 0 !important;
    }
}

/* ============================================================================
   FOCUS STATES & ACCESSIBILITY
============================================================================ */

.nav-link:focus,
.topbar-icon-btn:focus,
.mobile-menu-btn:focus,
.mobile-profile-btn:focus,
.profile-trigger:focus {
    outline: 2px solid var(--blue);
    outline-offset: 2px;
}

/* ============================================================================
   PRINT STYLES
============================================================================ */

@media print {
    .penghuni-sidebar,
    .penghuni-topbar {
        display: none;
    }
    
    .penghuni-content-wrapper {
        margin-left: 0;
    }
}
