/* ==========================================================================
   NAVBAR STYLES - Puggle Navigation Component
   ==========================================================================

   Theme-aware navbar styles using CSS custom properties from theme-variables.css
   Includes animated gradient accent bar and gradient effects.

   ========================================================================== */

/* ==========================================================================
   ANIMATED ACCENT BAR
   ========================================================================== */
@keyframes gradient-move {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.modern-nav-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1100;
}

.nav-accent-bar {
    height: var(--theme-nav-accent-height, 3px);
    background: var(--theme-nav-accent-gradient);
    background-size: 200% 200%;
    animation: gradient-move 3s ease infinite;
}

/* Hide accent bar when height is 0 (warm-dark theme) */
[data-theme="warm-dark"] .nav-accent-bar {
    display: none;
}

/* ==========================================================================
   MAIN NAVIGATION
   ========================================================================== */
.modern-nav {
    background: var(--theme-nav-bg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.nav-container {
    max-width: 1370px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    min-height: 64px;
}

/* ==========================================================================
   BRAND / LOGO
   ========================================================================== */
.nav-brand {
    margin-right: 2rem;
}

.brand-link {
    text-decoration: none;
    display: flex;
    align-items: center;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.brand-link:hover .brand-logo {
    background: var(--theme-menu-hover-bg);
    transform: translateY(-1px);
}

/* Logo Icon Box - visibility controlled by theme */
.logo-icon {
    width: 34px;
    height: 34px;
    background: var(--theme-logo-icon-bg);
    border-radius: 8px;
    display: var(--theme-logo-icon-display, flex);
    align-items: center;
    justify-content: center;
    font-family: 'Doto', sans-serif;
    font-size: 1.1rem;
    color: var(--theme-logo-icon-color);
    font-weight: 700;
}

/* Logo Text - Gradient Effect, font controlled by theme */
.logo-text {
    font-family: var(--theme-logo-font, 'Outfit', sans-serif);
    font-size: var(--theme-logo-font-size, 1.4rem);
    font-weight: var(--theme-logo-font-weight, 600);
    letter-spacing: 0;
    color: var(--theme-logo-text-color);
}

/* Gradient text styling */
.logo-text.gradient-text {
    background: var(--theme-logo-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Fallback for warm-dark theme (solid color) */
[data-theme="warm-dark"] .logo-text {
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: var(--theme-logo-text-color);
    background-clip: unset;
    color: var(--theme-logo-text-color);
}

/* ==========================================================================
   MOBILE TOGGLE
   ========================================================================== */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    margin-left: auto;
}

.nav-toggle-bar {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--theme-menu-text);
    margin: 5px 0;
    transition: 0.3s;
    border-radius: 2px;
}

/* ==========================================================================
   NAVIGATION MENU
   ========================================================================== */
.nav-menu {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 1rem;
}

.nav-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-main {
    flex: 1;
}

/* ==========================================================================
   NAVIGATION LINKS & DROPDOWN TOGGLES
   ========================================================================== */
.nav-link, .nav-dropdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    color: var(--theme-menu-text);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
}

.nav-link:hover, .nav-dropdown-toggle:hover {
    background: var(--theme-menu-hover-bg);
    color: var(--theme-menu-text-hover);
}

/* Navigation Icons - Circle Background Style */
.nav-link > i:first-child,
.nav-dropdown-toggle > i:first-child {
    width: 28px;
    height: 28px;
    background: var(--theme-menu-icon-bg);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: var(--theme-menu-icon-color);
    flex-shrink: 0;
}

.nav-link:hover > i:first-child,
.nav-dropdown-toggle:hover > i:first-child {
    background: var(--theme-menu-icon-hover-bg);
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.nav-btn-primary {
    background: var(--theme-btn-primary-bg);
    color: var(--theme-btn-primary-text);
}

.nav-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 0, 255, 0.3);
}

.nav-btn-outline {
    background: var(--theme-btn-secondary-bg);
    color: var(--theme-btn-secondary-text);
    border: 2px solid var(--theme-btn-secondary-border);
}

.nav-btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--theme-menu-text-hover);
}

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

.dropdown-arrow {
    font-size: 0.75rem;
    transition: transform 0.3s ease;
}

.nav-dropdown.active .dropdown-arrow {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 300px;
    max-width: 320px;
    background: var(--theme-dropdown-bg);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--theme-dropdown-border);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    margin-top: 0.5rem;
    z-index: 1100;
    padding: 0.75rem 0;
    overflow: hidden;
}

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

.dropdown-menu-right {
    right: 0;
    left: auto;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: var(--theme-dropdown-text);
    text-decoration: none;
    transition: all 0.2s ease;
    border-radius: 0;
    margin: 0;
}

.dropdown-item:hover {
    background: var(--theme-dropdown-hover-bg);
    color: var(--theme-dropdown-hover-color);
}

.dropdown-item.featured {
    /* No special styling - treat as regular dropdown item */
}

.dropdown-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.dropdown-item i {
    width: 20px;
    text-align: center;
    color: var(--theme-dropdown-icon-color);
}

.dropdown-item .item-title {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
}

.dropdown-item .item-desc {
    display: block;
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 0.25rem;
    line-height: 1.3;
}

.dropdown-divider {
    height: 1px;
    background: var(--theme-dropdown-border);
    margin: 0.5rem 1.5rem;
}

.dropdown-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--theme-dropdown-border);
}

.dropdown-header strong {
    display: block;
    color: var(--theme-dropdown-text);
}

.dropdown-header small {
    color: #6c757d;
}

.dropdown-section-header {
    padding: 0.5rem 1.5rem 0.25rem 1.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--theme-dropdown-section-header);
    margin-bottom: 0.25rem;
}

/* ==========================================================================
   USER SECTION
   ========================================================================== */
.user-toggle {
    padding-right: 0.75rem;
}

.user-avatar {
    position: relative;
    width: 32px;
    height: 32px;
    background: var(--theme-avatar-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--theme-avatar-color);
}

/* User avatar image */
.user-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

/* Notification badge on user avatar */
.user-avatar .notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 10px;
    background: var(--theme-badge-bg);
    color: var(--theme-badge-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==========================================================================
   NAVIGATION SEPARATOR
   ========================================================================== */
.nav-separator {
    color: rgba(255, 255, 255, 0.3);
    font-size: 20px;
    margin: 0 15px;
    user-select: none;
}

/* ==========================================================================
   BACK LINK
   ========================================================================== */
.back-link {
    color: var(--theme-menu-text);
    transition: all 0.3s ease;
}

.back-link:hover {
    color: var(--theme-menu-text-hover);
    transform: translateX(-3px);
}

/* ==========================================================================
   THEME SELECTOR (In User Dropdown)
   ========================================================================== */
.theme-selector {
    padding: 0.75rem 1.5rem;
    border-top: 1px solid var(--theme-dropdown-border);
    margin-top: 0.5rem;
}

.theme-selector-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--theme-dropdown-section-header);
    margin-bottom: 0.5rem;
    display: block;
}

.theme-options {
    display: flex;
    gap: 0.5rem;
}

.theme-option {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    position: relative;
}

.theme-option:hover {
    transform: scale(1.1);
}

.theme-option.active {
    border-color: var(--theme-brand-primary);
}

.theme-option.active::after {
    content: '\f00c';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.65rem;
    color: white;
}

.theme-option[data-theme="puggle-dark"] {
    background: linear-gradient(135deg, #ff00ff, #00ffff);
}

.theme-option[data-theme="warm-dark"] {
    background: linear-gradient(135deg, #f97316, #ea580c);
}

.theme-option[data-theme="light"] {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
}

/* Theme selector preview for puggle-classic - dashed border to indicate text-only logo */
.theme-option[data-theme="puggle-classic"] {
    background: linear-gradient(135deg, #ff00ff, #00ffff);
    border: 2px dashed rgba(255, 255, 255, 0.5);
}

/* ==========================================================================
   RESPONSIVE - MOBILE
   ========================================================================== */
@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }

    .nav-menu {
        position: fixed;
        top: calc(var(--theme-nav-accent-height, 3px) + 64px);
        left: -100%;
        width: 100%;
        height: calc(100vh - 64px - var(--theme-nav-accent-height, 3px));
        background: var(--theme-mobile-bg);
        flex-direction: column;
        padding: 2rem;
        transition: left 0.3s ease;
        overflow-y: auto;
        align-items: stretch;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-section {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .nav-dropdown-menu {
        position: static;
        transform: none;
        opacity: 1;
        visibility: visible;
        margin-top: 0.5rem;
        box-shadow: none;
        background: var(--theme-mobile-dropdown-bg);
    }

    .nav-dropdown.active .nav-dropdown-menu {
        display: block;
    }

    .nav-dropdown-menu {
        display: none;
    }

    .dropdown-item {
        color: var(--theme-mobile-text);
    }

    .dropdown-item:hover {
        background: rgba(255, 255, 255, 0.2);
        color: var(--theme-mobile-text);
    }

    .dropdown-item i {
        color: var(--theme-mobile-text);
    }

    .nav-separator {
        display: none;
    }

    .back-link {
        width: 100%;
        justify-content: flex-start;
    }

    /* Remove gap between nav sections on mobile */
    .nav-menu {
        gap: 0;
    }

    .nav-section {
        gap: 0;
    }

    /* Remove flex expansion so nav-main doesn't push nav-user down */
    .nav-main {
        flex: none;
    }

    /* Remove margin/padding that creates gaps */
    .nav-user {
        margin-top: 0;
        padding-top: 0;
    }
}
