/*
 * OTXAD - Dedicated Header & Navigation Stylesheet
 * Isolated from page-specific CSS to prevent style clashes.
 * Loaded globally via master.blade.php
 */

/* ============================================================
   SITE HEADER
   ============================================================ */
.site-header {
    background: var(--header-bg, #0057b7);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0;
    height: var(--header-height, 56px);
    display: flex;
    align-items: center;
}

.site-header .container {
    max-width: var(--container-max, 1200px);
    margin: 0 auto;
    padding: 0 16px;
    width: 100%;
}

.header-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 20px;
}

/* ============================================================
   LEFT & RIGHT ZONES
   ============================================================ */
.header-left {
    display: flex;
    align-items: center;
    gap: 18px;
    justify-content: flex-start;
    flex: 0 0 auto;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 18px;
    justify-content: flex-end;
    flex: 0 0 auto;
}

/* ============================================================
   LOGO
   ============================================================ */
.logo a {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.site-logo-img {
    max-height: 36px;
    width: auto;
    transition: transform 0.3s;
}

.site-logo-img:hover {
    transform: scale(1.05);
}

/* ============================================================
   DESKTOP NAVIGATION
   ============================================================ */
.desktop-nav {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex: 1 1 auto;
    gap: 14px;
    min-width: 0;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    min-width: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

.nav-link {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    color: white !important;
    font-size: 14px;
    padding: 8px 10px;
    border-radius: 0;
    transition: all 0.3s;
    font-weight: 500;
    text-decoration: none;
    background: transparent;
    border: none;
    cursor: pointer;
    white-space: nowrap;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    color: white !important;
}

.nav-link i {
    font-size: 16px;
}

/* ============================================================
   LOGIN BUTTON — Protected from page-specific overrides
   ============================================================ */
a.profile-toggle-btn,
button.profile-toggle-btn,
.profile-toggle-btn {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    color: white !important;
    font-weight: 700 !important;
    width: auto !important;
    padding: 0 10px !important;
    background: transparent !important;
    border: none !important;
    cursor: pointer;
    white-space: nowrap;
}

.profile-toggle-btn i {
    display: inline-flex !important;
    align-items: center;
    font-size: 16px;
}

.profile-toggle-btn span {
    display: inline !important;
    font-weight: 700;
}

/* ============================================================
   POST FREE AD BUTTON
   ============================================================ */
.btn-post {
    background: var(--accent, #ffc800) !important;
    color: var(--text-dark, #000) !important;
    font-weight: 800 !important;
    padding: 7px 16px !important;
    font-size: 12px !important;
    border-radius: 0 !important;
    text-transform: uppercase;
    white-space: nowrap;
    border: none !important;
    transition: all 0.2s;
    display: inline-flex !important;
    align-items: center !important;
    cursor: pointer;
}

.btn-post:hover {
    background: #e6b400 !important;
    transform: translateY(-1px);
}

/* ============================================================
   LANGUAGE & LOCATION BUTTONS
   ============================================================ */
.btn-language {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    background: transparent;
    border: none;
    color: white;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
}

.btn-language:hover {
    background: rgba(255, 255, 255, 0.15);
}

.btn-language .fa-chevron-down,
.btn-location .fa-chevron-down {
    font-size: 10px;
    transition: transform 0.3s;
}

.btn-language.active .fa-chevron-down,
.btn-location.active .fa-chevron-down {
    transform: rotate(180deg);
}

/* ============================================================
   NOTIFICATION ITEMS
   ============================================================ */
.header-notifications {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 12px;
}

.header-notif-item {
    position: relative;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.95);
    font-size: 19px;
    border-radius: 50%;
    transition: all 0.2s;
    text-decoration: none;
}

.header-notif-item:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.notif-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: #ef4444;
    color: white;
    font-size: 9px;
    font-weight: 800;
    min-width: 16px;
    height: 16px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid var(--primary, #0057b7);
}

/* ============================================================
   AVATAR (logged-in user)
   ============================================================ */
.header-avatar-container {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255,255,255,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.15);
    flex-shrink: 0;
}

.header-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ============================================================
   DROPDOWN MENUS
   ============================================================ */
.dropdown-wrapper {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: white;
    border-radius: 0;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    border: 1px solid #e5e7eb;
    min-width: 200px;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.profile-dropdown {
    min-width: 240px;
    padding: 12px 0;
    right: 0;
    left: auto;
}

.profile-dropdown .dropdown-header {
    padding: 8px 16px 12px;
    display: flex;
    flex-direction: column;
}

.profile-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    font-weight: 500;
    color: #1f2937;
    text-decoration: none;
    transition: background 0.2s;
}

.profile-dropdown .dropdown-item:hover {
    background: #f8fafc;
    color: var(--primary, #0057b7);
}

.profile-dropdown .dropdown-item i {
    width: 20px;
    text-align: center;
    color: #6b7280;
    font-size: 16px;
}

.profile-dropdown .dropdown-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 8px 0;
}

/* ============================================================
   MOBILE MENU TOGGLE
   ============================================================ */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    padding: 8px;
    color: white;
    order: -1;
    margin-right: 8px;
}

/* ============================================================
   MOBILE BOTTOM NAVIGATION
   ============================================================ */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 900;
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(10px);
    border-top: 1px solid #f1f5f9;
    box-shadow: 0 -4px 15px rgba(0,0,0,0.05);
    height: 60px;
    padding-bottom: env(safe-area-inset-bottom);
}

/* ============================================================
   MOBILE RESPONSIVE — max-width: 768px
   ============================================================ */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-bottom-nav {
        display: flex;
    }

    .site-header {
        height: 52px !important;
    }

    .site-logo-img {
        max-height: 26px;
    }

    /* Hide desktop-only elements on mobile */
    .hidden-mobile {
        display: none !important;
    }

    .visible-mobile {
        display: block !important;
    }

    /* Profile toggle button — mobile: icon-only circle */
    .profile-toggle-btn {
        width: 38px !important;
        height: 38px !important;
        padding: 0 !important;
        gap: 0 !important;
        justify-content: center !important;
    }

    .profile-toggle-btn i {
        font-size: 20px !important;
    }

    /* Profile dropdown on mobile — fixed position */
    .profile-dropdown {
        position: fixed !important;
        top: 56px !important;
        right: 10px !important;
        left: auto !important;
        width: calc(100% - 20px) !important;
        max-width: 280px !important;
        border-radius: 0 !important;
    }
}

/* ============================================================
   DESKTOP RESPONSIVE — min-width: 992px
   ============================================================ */
@media (min-width: 992px) {
    .desktop-nav {
        display: flex !important;
    }

    .mobile-bottom-nav {
        display: none !important;
    }

    .header-right {
        gap: 20px !important;
    }

    /* Ensure login button is always horizontal on desktop */
    a.profile-toggle-btn,
    button.profile-toggle-btn,
    .profile-toggle-btn,
    .profile-toggle-btn.hidden-mobile {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 6px !important;
        width: auto !important;
        padding: 0 10px !important;
    }

    .profile-toggle-btn span,
    .profile-toggle-btn .hidden-mobile {
        display: inline !important;
    }

    .profile-toggle-btn i {
        display: inline-flex !important;
    }

    .btn-post {
        height: 38px !important;
        display: flex !important;
        align-items: center !important;
    }
}
