/* =============================================
   PRIVATE HEADER - Desktop & Mobile Optimized
   ============================================= */

/* Base Styles */
.private-header {
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* Animated Gradient Top Bar */
.gradient-top-bar {
    height: 4px;
    background: linear-gradient(90deg, 
        var(--ahda-orange) 0%, 
        var(--ahda-maroon) 25%, 
        var(--ahda-green) 50%, 
        var(--ahda-teal) 75%, 
        var(--ahda-orange) 100%);
    background-size: 200% 100%;
    animation: gradientMove 3s ease infinite;
}

@keyframes gradientMove {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ============================================
   SECTION 1: TOP BAR (Light/White Background)
   ============================================ */
.header-top {
    background: linear-gradient(135deg, 
        var(--ahda-white) 0%,
        rgba(245, 123, 44, 0.03) 50%,
        var(--ahda-white) 100%);
    border-bottom: none;
    padding: 0.6rem 0;
    position: relative;
}

.header-top .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Logo */
.logo-wrapper {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 0.25rem 0.5rem;
    border-radius: 16px;
}

.logo-wrapper:hover {
    transform: scale(1.02);
    background: rgba(245, 123, 44, 0.08);
}

.logo-image {
    height: 46px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.05));
}

/* Text Logo */
.logo-text-wrapper {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.logo-main-text {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--ahda-orange), var(--ahda-maroon));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.logo-sub-text {
    font-size: 0.7rem;
    background: linear-gradient(135deg, var(--ahda-teal), var(--ahda-green));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 600;
}

/* Desktop Search */
.search-wrapper {
    flex: 1;
    max-width: 480px;
}

.search-container {
    display: flex;
    align-items: center;
    background: var(--ahda-peal);
    border-radius: 60px;
    padding: 0.55rem 1rem;
    border: 1px solid rgba(245, 123, 44, 0.15);
    transition: all 0.3s ease;
}

.search-container:focus-within {
    border-color: var(--ahda-orange);
    background: var(--ahda-white);
    box-shadow: 0 0 0 4px rgba(245, 123, 44, 0.1);
}

.search-icon {
    color: var(--ahda-orange);
    margin-right: 0.75rem;
    font-size: 1rem;
}

.search-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0.6rem 0;
    outline: none;
    font-size: 0.9rem;
    color: var(--ahda-ink);
}

.search-input::placeholder {
    color: var(--ahda-text-gray);
}

.search-clear-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--ahda-text-gray);
    padding: 0.25rem;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.search-clear-btn:hover {
    color: var(--ahda-orange);
}

/* Right Actions */
.right-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

/* Desktop Elements */
.mobile-search-toggle,
.mobile-menu-trigger {
    display: none;
}

.desktop-user-dropdown {
    display: block;
}

/* Notification Button */
.notif-btn {
    background: transparent;
    border: none;
    position: relative;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ahda-teal);
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

.notif-btn:hover {
    background: rgba(245, 123, 44, 0.1);
    color: var(--ahda-orange);
    transform: translateY(-2px);
}

.notif-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    background: linear-gradient(135deg, var(--ahda-orange), var(--ahda-maroon));
    color: white;
    font-size: 0.6rem;
    font-weight: bold;
    min-width: 20px;
    height: 20px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: badgePulse 2s ease infinite;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* User Button */
.user-btn {
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.3rem 0.8rem 0.3rem 0.3rem;
    border-radius: 60px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.user-btn:hover {
    background: rgba(245, 123, 44, 0.08);
    transform: translateY(-2px);
}

.user-btn:hover .user-avatar {
    background: linear-gradient(135deg, var(--ahda-orange), var(--ahda-maroon));
    transform: scale(1.05);
}

.user-btn:hover .user-name,
.user-btn:hover .user-role,
.user-btn:hover .chevron-icon {
    color: var(--ahda-orange);
}

.user-avatar {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--ahda-teal), var(--ahda-green));
    border-radius: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.3;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ahda-ink);
    transition: all 0.3s ease;
}

.user-role {
    font-size: 0.7rem;
    color: var(--ahda-text-gray);
    transition: all 0.3s ease;
}

.chevron-icon {
    color: var(--ahda-text-gray);
    font-size: 0.75rem;
    transition: all 0.3s ease;
}

/* ============================================
   SECTION 2: NAVIGATION BAR (DESKTOP ONLY)
   ============================================ */
.header-bottom {
    background: linear-gradient(135deg, 
        var(--ahda-teal) 0%,
        var(--ahda-green) 50%,
        var(--ahda-teal) 100%);
    padding: 0.5rem 0;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.header-bottom::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        transparent,
        rgba(245, 123, 44, 0.15),
        rgba(172, 26, 44, 0.15),
        transparent);
    pointer-events: none;
}

.header-bottom .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.nav-menu {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.7rem 1.6rem;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    border-radius: 60px;
    transition: all 0.3s ease;
    position: relative;
    background: transparent;
}

.nav-link i {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: var(--ahda-white);
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.nav-link:hover i {
    color: var(--ahda-white);
    transform: scale(1.05);
}

.nav-link.active {
    color: var(--ahda-orange);
    background: rgba(255, 255, 255, 0.2);
    font-weight: 600;
}

.nav-link.active i {
    color: var(--ahda-orange);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: var(--ahda-orange);
    border-radius: 3px;
    animation: underlinePulse 2s ease infinite;
}

@keyframes underlinePulse {
    0%, 100% { width: 40px; opacity: 1; }
    50% { width: 55px; opacity: 0.8; }
}

/* Dropdown Panels */
.dropdown-wrapper {
    position: relative;
}

.dropdown-panel {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--ahda-white);
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    min-width: 300px;
    margin-top: 12px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    border: 1px solid rgba(245, 123, 44, 0.2);
}

.dropdown-panel.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.notif-panel {
    width: 360px;
}

.notif-list {
    max-height: 400px;
    overflow-y: auto;
}

.notif-item {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: all 0.2s ease;
}

.notif-item:hover {
    background: rgba(245, 123, 44, 0.05);
}

.notif-item.unread {
    background: rgba(245, 123, 44, 0.08);
    border-left: 3px solid var(--ahda-orange);
}

.notif-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    background: rgba(245, 123, 44, 0.1);
    border-radius: 12px;
}

.notif-content {
    flex: 1;
}

.notif-title {
    margin-bottom: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--ahda-ink);
}

.notif-message {
    font-size: 0.8rem;
    color: var(--ahda-text-gray);
    margin-bottom: 6px;
}

.notif-time {
    font-size: 0.7rem;
    color: #888;
}

.dropdown-header {
    padding: 14px 18px;
    border-bottom: 1px solid rgba(245, 123, 44, 0.15);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: var(--ahda-teal);
}

.dropdown-header a {
    color: var(--ahda-orange);
    text-decoration: none;
    font-size: 0.75rem;
}

.user-panel {
    min-width: 260px;
    padding: 10px;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    color: var(--ahda-ink);
    text-decoration: none;
    border-radius: 12px;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.dropdown-item i {
    width: 22px;
    color: var(--ahda-green);
    font-size: 0.95rem;
}

.dropdown-item:hover {
    background: rgba(245, 123, 44, 0.1);
    color: var(--ahda-orange);
    transform: translateX(5px);
}

.dropdown-divider {
    height: 1px;
    background: #eee;
    margin: 8px 0;
}

.text-danger {
    color: var(--ahda-maroon) !important;
}

/* Main Content */
.private-main-content {
    padding: 1.5rem;
    min-height: calc(100vh - 125px);
    background: var(--ahda-bg);
}

/* ============================================
   MOBILE STYLES (Max 1023px)
   ============================================ */
@media (max-width: 1023px) {
    .private-header {
        background: linear-gradient(135deg, #FFFFFF 0%, #FFF9F5 50%, #FFFFFF 100%);
        box-shadow: 0 4px 20px rgba(245, 123, 44, 0.08);
    }
    
    .header-top {
        background: linear-gradient(135deg, rgba(255,255,255,0.98) 0%, rgba(245,123,44,0.03) 100%);
        border-bottom: 1px solid rgba(245, 123, 44, 0.12);
    }
    
    .header-top::before {
        content: '';
        position: absolute;
        bottom: -1px;
        left: 0;
        right: 0;
        height: 1px;
        background: linear-gradient(90deg, transparent, #F57B2C, #14776D, transparent);
    }
    
    .desktop-search {
        display: none;
    }
    
    .desktop-user-dropdown {
        display: none;
    }
    
    .mobile-search-toggle,
    .mobile-menu-trigger {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: linear-gradient(135deg, rgba(255,255,255,0.9), rgba(245,123,44,0.05));
        border: 1px solid rgba(245, 123, 44, 0.15);
        border-radius: 12px;
        cursor: pointer;
        color: #0B4F66;
        font-size: 1.1rem;
        transition: all 0.3s ease;
    }
    
    .mobile-search-toggle:active,
    .mobile-menu-trigger:active {
        background: linear-gradient(135deg, #F57B2C, #AC1A2C);
        color: white;
        transform: scale(0.95);
    }
    
    .notif-btn {
        background: linear-gradient(135deg, rgba(255,255,255,0.9), rgba(245,123,44,0.05));
        border: 1px solid rgba(245, 123, 44, 0.15);
        width: 40px;
        height: 40px;
        border-radius: 12px;
    }
    
    .notif-btn:active {
        background: linear-gradient(135deg, #F57B2C, #AC1A2C);
        color: white;
        transform: scale(0.95);
    }
    
    .user-btn {
        background: linear-gradient(135deg, #F3FAFA, rgba(245, 123, 44, 0.05));
        border: 1px solid rgba(245, 123, 44, 0.15);
    }
    
    /* Hide desktop navigation */
    .header-bottom {
        display: none;
    }
    
    .header-top .container {
        padding: 0 1rem;
        gap: 0.5rem;
    }
    
    .logo-image {
        height: 36px;
    }
    
    .private-main-content {
        padding: 1rem;
    }
    
    .notif-panel {
        position: fixed;
        top: 60px;
        right: 10px;
        left: 10px;
        width: auto;
        max-width: none;
        margin-top: 0;
    }
    
    .notif-list {
        max-height: 300px;
    }
}

/* Mobile Search Overlay */
.mobile-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(22, 44, 50, 0.95), rgba(11, 79, 102, 0.97));
    backdrop-filter: blur(12px);
    z-index: 1100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-search-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-search-container {
    padding: 1rem;
    margin-top: 70px;
}

.mobile-search-input-wrapper {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, white, #FFF9F5);
    border-radius: 60px;
    padding: 0.8rem 1rem;
    gap: 0.75rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.mobile-search-input-wrapper i {
    color: #F57B2C;
    font-size: 1.1rem;
}

.mobile-search-input-wrapper input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1rem;
    background: transparent;
    color: #162C32;
}

.mobile-search-input-wrapper input::placeholder {
    color: #999;
}

.mobile-search-close {
    background: rgba(245, 123, 44, 0.1);
    border: none;
    cursor: pointer;
    color: #465256;
    font-size: 1.2rem;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.mobile-search-close:active {
    background: #F57B2C;
    color: white;
}

/* Mobile Sidebar */
.mobile-sidebar {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 320px;
    height: 100vh;
    background: linear-gradient(135deg, #FFFFFF, #FFF9F5);
    z-index: 1200;
    transition: right 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.15);
    overflow-y: auto;
}

.mobile-sidebar.open {
    right: 0;
}

.mobile-sidebar-header {
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(245, 123, 44, 0.08), rgba(20, 119, 109, 0.04));
    border-bottom: 2px solid #F57B2C;
}

.mobile-logo-area {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mobile-logo-img {
    height: 32px;
    width: auto;
}

.mobile-sidebar-close {
    background: rgba(245, 123, 44, 0.1);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    cursor: pointer;
    color: #0B4F66;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.mobile-sidebar-close:active {
    background: linear-gradient(135deg, #F57B2C, #AC1A2C);
    color: white;
    transform: scale(0.95);
}

.mobile-user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(20, 119, 109, 0.08), rgba(245, 123, 44, 0.05));
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.mobile-user-avatar-large {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #0B4F66, #14776D);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.4rem;
}

.mobile-user-info-full {
    flex: 1;
}

.mobile-user-name-full {
    font-weight: 700;
    font-size: 1rem;
    color: #162C32;
    margin-bottom: 0.25rem;
}

.mobile-user-role-full {
    font-size: 0.75rem;
    color: #465256;
}

.mobile-sidebar-content {
    padding: 0.5rem 1rem 1.5rem;
}

.mobile-nav-section {
    margin-bottom: 1.5rem;
}

.mobile-nav-section-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #465256;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.25rem;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1rem;
    color: #162C32;
    text-decoration: none;
    border-radius: 14px;
    transition: all 0.2s ease;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.mobile-nav-link i {
    width: 24px;
    color: #14776D;
    font-size: 1rem;
}

.mobile-nav-link:active {
    background: linear-gradient(135deg, rgba(245, 123, 44, 0.1), rgba(20, 119, 109, 0.05));
    color: #F57B2C;
    transform: translateX(5px);
}

.mobile-nav-link.text-danger {
    color: #AC1A2C;
}

.mobile-nav-link.text-danger i {
    color: #AC1A2C;
}

.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(22, 44, 50, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1150;
    display: none;
}

.mobile-overlay.active {
    display: block;
}

/* Tablet Styles */
@media (min-width: 768px) and (max-width: 1023px) {
    .logo-image {
        height: 42px;
    }
    
    .private-main-content {
        padding: 1.2rem;
    }
}

/* Desktop Large */
@media (min-width: 1200px) {
    .search-wrapper {
        max-width: 550px;
    }
    
    .logo-image {
        height: 52px;
    }
    
    .nav-link {
        padding: 0.75rem 1.8rem;
        font-size: 0.95rem;
    }
}