/* ============================================
   PREMIUM SAAS MARKETPLACE HEADER - COMPACT
   ============================================ */

:root {
    --saas-bg: #ffffff;
    --saas-border: #e5e7eb;
    --saas-accent: #C29A74;
    --saas-accent-hover: #D4AB84;
    --saas-accent-dark: #A97A5E;
    --saas-text-primary: #1f2937;
    --saas-text-secondary: #6b7280;
    --saas-text-muted: #9ca3af;
    --saas-icon: #6b7280;
    --saas-icon-hover: #1f2937;
    --saas-height: 56px;
    --saas-padding: 0 1.5rem;
}

/* Fix scrollbar causing layout shift */
html {
    overflow-y: scroll;
}

/* Main Navbar Container */
.navbar-saas {
    background: var(--saas-bg);
    border-bottom: 1px solid var(--saas-border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: relative;
    z-index: 999;
    backdrop-filter: blur(10px);
    height: var(--saas-height);
}

.navbar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--saas-height);
    padding: var(--saas-padding);
    max-width: 1320px;
    width: 100%;
    margin: 0 auto;
    gap: 1.5rem;
}

/* ============================================
   LEFT ZONE: Brand
   ============================================ */

.navbar-zone-left {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.navbar-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    text-decoration: none;
    transition: all 0.3s ease;
    margin: 0;
    padding: 0.25rem;
    border-radius: 0.5rem;
    height: auto;
}

.navbar-brand:hover {
    background: transparent;
    opacity: 0.9;
}

.navbar-brand-logo {
    height: 50px;
    width: auto;
    object-fit: contain;
    max-width: 200px;
    transition: all 0.3s ease;
    display: block;
}

.navbar-brand:hover .navbar-brand-logo {
    transform: scale(1.02);
}

/* ============================================
   RIGHT ZONE: Primary Actions
   ============================================ */

.navbar-zone-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

/* Ensure right zone is visible on desktop */
.navbar-zone-right.collapse {
    display: flex !important;
}

/* Primary Action Button - Compact */
.btn-primary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, var(--saas-accent) 0%, var(--saas-accent-dark) 100%);
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.2px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(194, 154, 116, 0.2);
    white-space: nowrap;
    flex-shrink: 0;
    height: 36px;
}

.btn-primary-action:hover {
    background: linear-gradient(135deg, var(--saas-accent-hover) 0%, #BD8E6E 100%);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(194, 154, 116, 0.3);
    text-decoration: none;
}

.btn-primary-action:active {
    transform: translateY(0);
}

.btn-primary-action i {
    font-size: 0.9rem;
    transition: transform 0.2s ease;
}

.btn-primary-action:hover i {
    transform: scale(1.1) rotate(90deg);
}

/* Spacer */
.navbar-spacer {
    height: 20px;
    width: 1px;
    background: var(--saas-border);
    margin: 0 0.25rem;
    flex-shrink: 0;
}

/* Navigation Actions - Compact */
.nav-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.5rem 0.625rem;
    color: var(--saas-text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.85rem;
    border-radius: 0.5rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    height: 36px;
    min-width: 36px;
}

.nav-action:hover {
    color: var(--saas-accent);
    background: rgba(194, 154, 116, 0.08);
}

.nav-action i {
    font-size: 1.1rem;
    color: var(--saas-icon);
    transition: all 0.2s ease;
}

.nav-action:hover i {
    color: var(--saas-accent);
    transform: scale(1.05);
}

/* ============================================
   NOTIFICATION BELL - COMPACT
   ============================================ */

.notification-bell-item {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
}

.notification-bell-btn,
.message-bell-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    color: var(--saas-icon);
    font-size: 1.15rem;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    border-radius: 0.5rem;
    padding: 0;
    flex-shrink: 0;
    text-decoration: none;
}

.notification-bell-btn:hover,
.message-bell-btn:hover {
    color: var(--saas-accent);
    background: rgba(194, 154, 116, 0.08);
}

.notification-badge,
.message-badge,
.mobile-bottom-nav__badge {
    position: absolute;
    top: 0px;
    right: 0px;
    background: linear-gradient(135deg, #EF4444, #DC2626);
    color: white;
    font-size: 0.55rem;
    padding: 0.15rem 0.3rem;
    border-radius: 10px;
    min-width: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: all 0.15s ease;
}

.notification-dropdown {
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.1);
    /* Static positioning — no Popper, no jump */
    position: absolute !important;
    top: 100% !important;
    right: 0 !important;
    left: auto !important;
    transform: none !important;
    margin-top: 6px !important;
    min-width: 340px !important;
    max-width: 400px;
    animation: slideDown 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: opacity, transform;
    overflow: hidden;
    z-index: 1050;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   USER ACCOUNT DROPDOWN - COMPACT
   ============================================ */

/* Anchor point for Bootstrap dropdown */
.nav-item.dropdown,
.notification-bell-item {
    position: relative;
    list-style: none;
    display: flex;
    align-items: center;
}

.user-dropdown-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.5rem 0.625rem;
    color: var(--saas-text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.85rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    border: none;
    background: transparent;
    flex-shrink: 0;
    height: 36px;
    min-width: 36px;
}

.user-dropdown-trigger:hover {
    color: var(--saas-accent);
    background: rgba(194, 154, 116, 0.08);
}

.user-dropdown-trigger i {
    font-size: 1.2rem;
    color: var(--saas-icon);
    transition: color 0.2s ease;
}

.user-dropdown-trigger:hover i {
    color: var(--saas-accent);
}

.user-dropdown-trigger .dropdown-arrow {
    font-size: 0.6rem;
    opacity: 0.5;
    transition: all 0.2s ease;
    margin-left: -0.25rem;
}

.user-dropdown-trigger:hover .dropdown-arrow {
    opacity: 1;
    transform: rotate(180deg);
}

.user-dropdown-menu {
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.1);
    /* Static positioning — no Popper, no jump */
    position: absolute !important;
    top: 100% !important;
    right: 0 !important;
    left: auto !important;
    transform: none !important;
    margin-top: 6px !important;
    min-width: 220px !important;
    animation: slideDown 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    will-change: opacity, transform;
    z-index: 1050;
}

.user-dropdown-menu .dropdown-item {
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    color: var(--saas-text-primary);
    transition: all 0.15s ease;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-dropdown-menu .dropdown-item:hover {
    background-color: #f9fafb;
    color: var(--saas-accent);
}

.user-dropdown-menu .dropdown-item i {
    color: var(--saas-icon);
    transition: all 0.15s ease;
    font-size: 0.95rem;
    width: 18px;
}

.user-dropdown-menu .dropdown-item:hover i {
    color: var(--saas-accent);
}

.user-dropdown-menu .dropdown-item.text-danger {
    border-bottom: none;
}

.user-dropdown-menu .dropdown-item.text-danger:hover {
    background-color: #fef2f2;
    color: #EF4444;
}

.user-dropdown-menu .dropdown-item.text-danger:hover i {
    color: #EF4444;
}

/* ============================================
   AUTH LINKS (LOGIN / REGISTER)
   ============================================ */

.nav-auth-links {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    flex-shrink: 0;
}

.nav-link-auth {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.5rem 0.625rem;
    color: var(--saas-text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.85rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    height: 36px;
    min-width: 36px;
}

.nav-link-auth:hover {
    color: var(--saas-accent);
    background: rgba(194, 154, 116, 0.08);
}

.nav-link-auth i {
    font-size: 1.1rem;
    color: var(--saas-icon);
}

/* ============================================
   MOBILE MENU TOGGLE
   ============================================ */

.navbar-mobile-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    color: var(--saas-icon);
    font-size: 1.35rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 0.5rem;
    padding: 0;
    flex-shrink: 0;
}

.navbar-mobile-toggle:hover {
    color: var(--saas-accent);
    background: rgba(194, 154, 116, 0.08);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Desktop: 1200px+ */
@media (min-width: 1200px) {
    .navbar-zone-right {
        display: flex !important;
    }
}

/* Tablet: 768px - 1199px */
@media (max-width: 1199px) {
    :root {
        --saas-height: 54px;
        --saas-padding: 0 1rem;
    }

    .navbar-zone-right {
        display: flex !important;
        gap: 0.5rem;
    }

    .navbar-spacer {
        margin: 0 0.125rem;
    }

    .btn-primary-action {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
        height: 32px;
    }

    .btn-primary-action span {
        display: none;
    }

    .btn-primary-action i {
        font-size: 0.85rem;
    }

    .nav-action {
        padding: 0.4rem 0.5rem;
        height: 32px;
        min-width: 32px;
    }

    .nav-action span {
        display: none;
    }

    .nav-link-auth {
        padding: 0.4rem 0.5rem;
        height: 32px;
        min-width: 32px;
    }

    .nav-link-auth span {
        display: none;
    }

    .navbar-brand {
        padding: 0.25rem 0.5rem;
    }

    .navbar-brand span {
        display: none;
    }

    .notification-bell-btn {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }

    .user-dropdown-trigger {
        padding: 0.4rem 0.5rem;
        height: 32px;
        min-width: 32px;
    }

    .user-dropdown-trigger i {
        font-size: 1.1rem;
    }

    .user-dropdown-trigger span {
        display: none;
    }

    .notification-dropdown {
        min-width: 300px !important;
        max-width: 340px;
    }

    .user-dropdown-menu {
        min-width: 180px !important;
    }
}

/* Mobile: < 992px */
@media (max-width: 991px) {
    :root {
        --saas-height: 50px;
        --saas-padding: 0 0.75rem;
    }

    .navbar-mobile-toggle {
        display: flex;
    }

    .navbar-container {
        gap: 0.5rem;
    }

    .navbar-brand {
        padding: 0.25rem 0.375rem;
    }

    .navbar-brand-mark {
        width: 32px;
        height: 32px;
        font-size: 1.55rem;
    }

    .btn-primary-action {
        padding: 0.375rem 0.625rem;
        height: 30px;
    }

    .btn-primary-action i {
        font-size: 0.8rem;
    }

    .notification-bell-btn,
    .user-dropdown-trigger,
    .nav-action {
        width: 30px;
        height: 30px;
    }

    .notification-dropdown {
        min-width: 280px !important;
        max-width: 320px;
    }

    .user-dropdown-menu {
        min-width: 160px !important;
    }
}

/* Mobile: < 768px */
@media (max-width: 767px) {
    :root {
        --saas-height: 46px;
        --saas-padding: 0 0.5rem;
    }

    .navbar-brand i {
        font-size: 1.2rem;
    }

    .btn-primary-action {
        padding: 0.25rem 0.625rem;
        height: 28px;
    }

    .btn-primary-action i {
        font-size: 0.75rem;
    }

    .navbar-mobile-toggle {
        right: 0;
    }
}

/* Extra Small Mobile: < 480px */
@media (max-width: 479px) {
    :root {
        --saas-height: 40px;
    }

    .navbar-brand span {
        display: none;
    }

    .navbar-brand-mark {
        width: 30px;
        height: 30px;
        font-size: 1.2rem;
        font-style: italic;
        font-weight: 900;
        line-height: 1;
        padding-top: 0.08rem;
        transform: skew(-8deg);
        border-radius: 9px;
        box-shadow: 0 2px 6px rgba(169, 120, 79, 0.16);
    }

    .btn-primary-action i {
        font-size: 0.7rem;
    }
}

/* ============================================
   UTILITIES & ACCESSIBILITY
   ============================================ */

.sticky-top {
    top: 0;
    z-index: 999;
}

.dropdown-divider {
    margin: 0.5rem 0;
    opacity: 0.1;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* Focus states */
.navbar-brand:focus-visible,
.btn-primary-action:focus-visible,
.nav-action:focus-visible,
.notification-bell-btn:focus-visible,
.user-dropdown-trigger:focus-visible,
.nav-link-auth:focus-visible {
    outline: 2px solid var(--saas-accent);
    outline-offset: 2px;
}

/* Prevent text selection */
.btn-primary-action,
.notification-bell-btn,
.user-dropdown-trigger,
.navbar-mobile-toggle {
    user-select: none;
    -webkit-user-select: none;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* ============================================
   MOBILE HEADER ENHANCEMENTS (≤ 768px)
   ============================================ */

@media (max-width: 768px) {
    /* Adjust navbar height for compact mobile */
    :root {
        --saas-height: 48px;
        --saas-padding: 0 0.75rem;
    }

    /* Mobile filter button wrapper - below header */
    .mobile-filter-button-wrapper {
        display: flex;
        justify-content: flex-end;
        align-items: center;
        padding: 0.75rem 1rem;
        background: var(--saas-bg);
        border-bottom: 1px solid var(--saas-border);
    }

    /* Mobile filter button styling */
    .mobile-filter-button {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: #F5EFE6;
        border: none;
        color: var(--saas-accent);
        font-size: 1.1rem;
        cursor: pointer;
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        border-radius: 50%;
        padding: 0;
        flex-shrink: 0;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    }

    .mobile-filter-button:hover {
        background: #EDE2D4;
        box-shadow: 0 3px 10px rgba(194, 154, 116, 0.15);
        transform: scale(1.05);
    }

    .mobile-filter-button:active {
        transform: scale(0.98);
    }

    .navbar-saas {
        background: var(--saas-bg);
        border-bottom: 1px solid #EEE1D5;
        box-shadow: 0 2px 8px rgba(28, 25, 23, 0.06);
        height: 60px;
    }

    .navbar-container {
        padding: 0 0.8rem;
        gap: 0.65rem;
        height: 60px;
    }

    .navbar-zone-left {
        min-width: 0;
    }

    /* Brand: visible and readable on mobile */
    .navbar-brand {
        padding: 0.2rem;
        gap: 0;
    }

    .navbar-brand-logo {
        height: 40px;
        width: auto;
        object-fit: contain;
        max-width: 150px;
    }

    /* Mobile menu toggle: always visible */
    .navbar-mobile-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        background: transparent;
        border: none;
        color: var(--saas-icon);
        font-size: 1.1rem;
        cursor: pointer;
        transition: all 0.2s ease;
        border-radius: 0.4rem;
        padding: 0;
        flex-shrink: 0;
    }

    .navbar-mobile-toggle:hover {
        color: var(--saas-accent);
        background: rgba(194, 154, 116, 0.08);
    }

    /* Mobile filter button: circular, beige */
    .navbar-mobile-filter {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: #F5EFE6;
        border: none;
        color: var(--saas-accent);
        font-size: 1.1rem;
        cursor: pointer;
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        border-radius: 50%;
        padding: 0;
        flex-shrink: 0;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    }

    .navbar-mobile-filter:hover {
        background: #EDE2D4;
        box-shadow: 0 3px 10px rgba(194, 154, 116, 0.15);
        transform: scale(1.05);
    }

    .navbar-mobile-filter:active {
        transform: scale(0.98);
    }

    /* Mobile menu button: hamburger icon on left side */
    .navbar-mobile-menu {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        background: transparent;
        border: none;
        color: var(--saas-icon);
        font-size: 1.2rem;
        cursor: pointer;
        padding: 0;
        flex-shrink: 0;
        transition: all 0.2s ease;
        margin-right: 0.5rem;
    }

    .navbar-mobile-menu:hover {
        color: var(--saas-accent);
        background: rgba(194, 154, 116, 0.08);
        border-radius: 6px;
    }

    .navbar-mobile-menu:active {
        transform: scale(0.95);
    }

    /* Keep right zone visible on mobile */
    .navbar-zone-right {
        display: flex !important;
        align-items: center;
        justify-content: flex-end;
        gap: 0.4rem;
        flex: 0 0 auto;
    }

    .navbar-spacer {
        display: none;
    }

    .btn-primary-action {
        width: 42px;
        height: 42px;
        min-width: 42px;
        padding: 0;
        border-radius: 10px;
        box-shadow: 0 2px 8px rgba(194, 154, 116, 0.22);
    }

    .btn-primary-action span {
        display: none;
    }

    .btn-primary-action i {
        font-size: 1.25rem;
    }

    .notification-bell-btn,
    .nav-action {
        width: 42px;
        height: 42px;
        min-width: 42px;
        border-radius: 10px;
    }

    .notification-bell-btn i,
    .nav-action i {
        font-size: 1.24rem;
    }

    .nav-action span,
    .nav-link-auth span {
        display: none;
    }

    /* Hide account dropdown/login icon from mobile header but keep notification bell */
    .nav-item.dropdown:not(.notification-bell-item),
    .nav-auth-links {
        display: none !important;
    }

    /* Collapse is only for desktop menu */
    .navbar-mobile-toggle.d-none {
        display: none;
    }

    /* Mobile search input (center of navbar) */
    .navbar-mobile-search {
        display: flex !important;
        align-items: center;
        justify-content: center;
        flex: 1;
        min-width: 0;
        margin: 0 0.5rem;
    }

    .navbar-search-input-wrap {
        display: flex;
        align-items: center;
        gap: 0.4rem;
        background: rgba(255, 255, 255, 0.12);
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 6px;
        padding: 0.4rem 0.65rem;
        width: 100%;
        max-width: 100%;
        height: 32px;
    }

    .navbar-search-input-wrap i {
        color: var(--saas-icon);
        font-size: 0.9rem;
        flex-shrink: 0;
    }

    .navbar-search-input {
        border: none;
        box-shadow: none;
        background: transparent;
        padding: 0;
        font-size: 0.85rem;
        color: var(--saas-text-primary);
        height: auto;
        flex: 1;
    }

    .navbar-search-input::placeholder {
        color: rgba(194, 154, 116, 0.5);
    }

    .navbar-search-input:focus {
        border: none;
        box-shadow: none;
        background: transparent;
        outline: none;
    }
}


