/**
 * WisdomAI Real Estate - Shared Navigation Styles
 * Version: 2.0.0 - Midnight Black & Gold Professional Theme
 * Common styles for both landing page and authenticated navigation
 */

/* ==================== CUSTOM PROPERTIES ==================== */
:root {
    --nav-primary: #d97706;
    --nav-secondary: #f59e0b;
    --nav-accent: #fbbf24;
    --nav-text: #f3f4f6;
    --nav-text-hover: #fbbf24;
    --nav-bg: rgba(10, 10, 10, 0.95);
    --nav-bg-solid: #0a0a0a;
    --dropdown-bg: #1e293b;
    --dropdown-shadow: 0 25px 70px rgba(0, 0, 0, 0.6);
    --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Light mode variables */
body:not(.dark-mode) {
    --nav-text: #374151;
    --nav-text-hover: #d97706;
    --nav-bg: rgba(255, 255, 255, 0.95);
    --dropdown-bg: #ffffff;
    --dropdown-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

/* ==================== GRADIENT TEXT ==================== */
.gradient-text {
    background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
    background-size: 200% 200%;
}

/* ==================== NAVIGATION CONTAINER ==================== */
nav, .wisdomai-nav {
    background: var(--nav-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: all 0.3s var(--transition-smooth);
    border-bottom: 1px solid rgba(217, 119, 6, 0.1);
}

nav.scrolled, .wisdomai-nav.scrolled {
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2), 0 0 20px rgba(217, 119, 6, 0.1);
    border-bottom-color: rgba(217, 119, 6, 0.2);
}

/* ==================== LOGO ANIMATION ==================== */
.logo-container {
    position: relative;
    text-decoration: none;
}

.logo-icon {
    transition: all 0.4s var(--transition-bounce);
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
}

.logo-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s ease;
}

.logo-container:hover .logo-icon {
    transform: rotate(12deg) scale(1.1);
    box-shadow: 0 10px 30px rgba(217, 119, 6, 0.4);
}

.logo-container:hover .logo-icon::before {
    left: 100%;
}

.logo-container:active .logo-icon {
    transform: rotate(12deg) scale(0.95);
}

/* ==================== NAVIGATION LINKS ==================== */
.nav-link {
    position: relative;
    transition: all 0.3s var(--transition-smooth);
    color: var(--nav-text);
    text-decoration: none;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: linear-gradient(135deg, var(--nav-primary) 0%, var(--nav-secondary) 100%);
    transition: width 0.3s var(--transition-smooth);
    border-radius: 2px;
    box-shadow: 0 2px 10px rgba(217, 119, 6, 0.3);
}

.nav-link:hover {
    color: var(--nav-text-hover);
    transform: translateY(-2px);
}

.nav-link:hover::before {
    width: 80%;
}

.nav-link.active {
    color: var(--nav-primary);
    font-weight: 700;
}

.nav-link.active::before {
    width: 80%;
}

/* Icon animation in nav links */
.nav-link i {
    transition: transform 0.3s var(--transition-smooth);
}

.nav-link:hover i {
    transform: scale(1.15) rotate(5deg);
}

/* ==================== DROPDOWN MENUS ==================== */
.dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    background: var(--dropdown-bg);
    border-radius: 20px;
    box-shadow: var(--dropdown-shadow);
    min-width: 320px;
    z-index: 1000;
    border: 1px solid rgba(217, 119, 6, 0.2);
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s var(--transition-smooth),
                transform 0.3s var(--transition-smooth);
    overflow: hidden;
    pointer-events: none;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.dropdown-trigger.active .dropdown {
    display: block !important;
    opacity: 1 !important;
    transform: translateY(0) !important;
    pointer-events: auto !important;
}

.dropdown-trigger.active .fa-chevron-down {
    transform: rotate(180deg);
}

/* ==================== DROPDOWN HEADER ==================== */
.dropdown-header {
    padding: 14px 18px;
    border-bottom: 1px solid rgba(217, 119, 6, 0.15);
    background: linear-gradient(135deg, rgba(217, 119, 6, 0.1) 0%, rgba(245, 158, 11, 0.1) 100%);
}

body:not(.dark-mode) .dropdown-header {
    background: linear-gradient(135deg, #fdf2f8 0%, #fff7ed 100%);
}

/* ==================== DROPDOWN ITEMS ==================== */
.dropdown-item {
    display: block;
    padding: 14px 18px;
    color: var(--nav-text);
    transition: all 0.3s var(--transition-smooth);
    border-radius: 12px;
    margin: 6px 10px;
    text-decoration: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    font-weight: 500;
}

.dropdown-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(217, 119, 6, 0.1), transparent);
    transition: left 0.5s ease;
}

.dropdown-item:hover {
    background: linear-gradient(135deg, rgba(217, 119, 6, 0.15) 0%, rgba(245, 158, 11, 0.1) 100%);
    color: var(--nav-primary);
    transform: translateX(6px);
}

.dropdown-item:hover::before {
    left: 100%;
}

body:not(.dark-mode) .dropdown-item:hover {
    background: linear-gradient(135deg, #fdf2f8 0%, #fff7ed 100%);
}

/* Icon containers in dropdown items */
.dropdown-item .w-10 {
    transition: all 0.3s var(--transition-bounce);
}

.dropdown-item:hover .w-10 {
    transform: scale(1.15) rotate(8deg);
    box-shadow: 0 4px 15px rgba(217, 119, 6, 0.2);
}

/* ==================== DROPDOWN DIVIDER ==================== */
.dropdown-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(217, 119, 6, 0.3), transparent);
    margin: 10px 12px;
}

/* ==================== MOBILE MENU ==================== */
.mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s var(--transition-smooth);
    border-top: 1px solid rgba(217, 119, 6, 0.1);
}

.mobile-menu.active {
    max-height: 3000px;
}

/* Mobile navigation sections */
.mobile-nav-section {
    padding: 12px 0;
    margin: 8px 0;
}

.mobile-nav-header {
    padding: 12px 18px;
    font-size: 11px;
    font-weight: 700;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: linear-gradient(135deg, rgba(217, 119, 6, 0.1) 0%, rgba(245, 158, 11, 0.05) 100%);
    border-radius: 12px;
    margin: 8px 0;
    display: flex;
    align-items: center;
    border: 1px solid rgba(217, 119, 6, 0.15);
}

body:not(.dark-mode) .mobile-nav-header {
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    color: #6b7280;
}

/* Mobile menu items */
.mobile-menu a {
    transition: all 0.3s var(--transition-smooth);
    font-weight: 500;
}

.mobile-menu a:hover {
    transform: translateX(6px);
}

/* ==================== SETTINGS POPOVER ==================== */
#settingsPopover {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s var(--transition-smooth);
}

#settingsPopover.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ==================== THEME BUTTONS ==================== */
.theme-btn {
    position: relative;
    cursor: pointer;
    border: none;
    transition: all 0.3s var(--transition-smooth);
}

.theme-btn .check-indicator {
    transition: all 0.3s var(--transition-smooth);
}

.theme-btn.active .check-indicator {
    display: flex !important;
    animation: scaleIn 0.3s var(--transition-bounce);
}

@keyframes scaleIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ==================== NOTIFICATION BADGE ==================== */
.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    font-size: 11px;
    font-weight: 700;
    border-radius: 11px;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.5), 0 0 0 3px rgba(10, 10, 10, 0.5);
    animation: pulse-badge 2s infinite;
    z-index: 10;
}

.notification-badge.show {
    display: flex !important;
}

@keyframes pulse-badge {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.9;
        transform: scale(1.15);
    }
}

/* ==================== DARK MODE SPECIFIC STYLES ==================== */
body.dark-mode nav,
body.dark-mode .wisdomai-nav {
    background: var(--nav-bg);
}

body.dark-mode .dropdown {
    background: #1e293b;
}

body.dark-mode .mobile-menu {
    background: rgba(10, 10, 10, 0.98);
}

body.dark-mode #settingsPopover {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(30, 41, 59, 0.98) 100%) !important;
    border-color: rgba(217, 119, 6, 0.3);
}

body.dark-mode .theme-btn {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(217, 119, 6, 0.2);
}

body.dark-mode .theme-btn:hover {
    background: rgba(217, 119, 6, 0.15);
    border-color: rgba(217, 119, 6, 0.4);
}

body.dark-mode .text-gray-600 {
    color: #d1d5db !important;
}

body.dark-mode .text-gray-700 {
    color: #e5e7eb !important;
}

body.dark-mode .text-gray-900 {
    color: #f9fafb !important;
}

/* ==================== RESPONSIVE DESIGN ==================== */
@media (max-width: 1024px) {
    .dropdown {
        min-width: 280px;
    }
}

@media (max-width: 768px) {
    .dropdown {
        position: fixed;
        left: 50%;
        transform: translateX(-50%) translateY(-10px);
        width: 90%;
        max-width: 400px;
    }

    .dropdown-trigger.active .dropdown {
        transform: translateX(-50%) translateY(0);
    }

    .mobile-menu {
        background: var(--nav-bg);
    }
}

@media (max-width: 640px) {
    .logo-container h2 {
        font-size: 1rem;
    }

    .logo-container p {
        font-size: 0.65rem;
    }

    .logo-icon {
        width: 2.5rem;
        height: 2.5rem;
    }
}

/* ==================== ACCESSIBILITY ==================== */
.nav-link:focus,
.dropdown-item:focus,
button:focus {
    outline: 2px solid var(--nav-primary);
    outline-offset: 3px;
    border-radius: 4px;
}

/* ==================== SMOOTH SCROLLBAR ==================== */
.dropdown::-webkit-scrollbar {
    width: 6px;
}

.dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.dropdown::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
    border-radius: 3px;
}

.dropdown::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
}

/* ==================== ANIMATIONS ==================== */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDropdown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes glow-pulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(217, 119, 6, 0.2);
    }
    50% {
        box-shadow: 0 0 40px rgba(217, 119, 6, 0.4);
    }
}

/* ==================== REDUCED MOTION ==================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}