﻿/* ============================================
   E-MAZADE MODERN NAVIGATION SYSTEM
   ============================================ */

:root {
    --nav-primary: #2563eb;
    --nav-primary-dark: #1d4ed8;
    --nav-primary-light: #3b82f6;
    --nav-bg: #ffffff;
    --nav-bg-scrolled: rgba(255, 255, 255, 0.95);
    --nav-text: #1e293b;
    --nav-text-muted: #64748b;
    --nav-border: #e2e8f0;
    --nav-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --nav-radius: 12px;
    --nav-transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --topbar-bg: #0f172a;
    --topbar-text: #94a3b8;
    --topbar-hover: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #f8fafc;
    color: var(--nav-text);
    line-height: 1.5;
    overflow-x: hidden;
}

/* ============================================
   TOP BAR
   ============================================ */

.top-bar {
    background-color: var(--topbar-bg);
    color: var(--topbar-text);
    font-size: 0.8125rem;
    position: relative;
    z-index: 1001;
}

.top-bar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 40px;
    padding: 0 1.5rem;
}

.top-bar-left,
.top-bar-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.top-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--topbar-text);
    text-decoration: none;
    transition: color 0.2s ease;
    font-weight: 400;
}

    .top-link:hover {
        color: var(--topbar-hover);
    }

    .top-link i {
        font-size: 0.75rem;
        opacity: 0.7;
    }

.social-mini {
    display: flex;
    gap: 0.75rem;
}

    .social-mini a {
        color: var(--topbar-text);
        text-decoration: none;
        font-size: 0.875rem;
        transition: all 0.2s ease;
        opacity: 0.7;
    }

        .social-mini a:hover {
            color: var(--topbar-hover);
            opacity: 1;
            transform: translateY(-1px);
        }

.divider-v {
    width: 1px;
    height: 20px;
    background-color: rgba(148, 163, 184, 0.2);
}

/* ============================================
   TOPBAR DROPDOWNS (Language / Currency)
   ============================================ */

.dropdown-custom {
    position: relative;
}

.dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    color: var(--topbar-text);
    font-family: inherit;
    font-size: 0.8125rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

    .dropdown-trigger:hover {
        color: var(--topbar-hover);
        background-color: rgba(255, 255, 255, 0.05);
    }

    .dropdown-trigger .fi {
        font-size: 1rem;
        border-radius: 2px;
    }

    .dropdown-trigger .fa-chevron-down {
        font-size: 0.625rem;
        transition: transform 0.2s ease;
    }

.dropdown-custom.open .dropdown-trigger .fa-chevron-down {
    transform: rotate(180deg);
}

.dropdown-menu-custom {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border-radius: var(--nav-radius);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    padding: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
    z-index: 1002;
    border: 1px solid var(--nav-border);
}

.dropdown-custom.open .dropdown-menu-custom {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item-custom {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: none;
    background: none;
    font-family: inherit;
    font-size: 0.875rem;
    color: var(--nav-text);
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.15s ease;
    text-decoration: none;
}

    .dropdown-item-custom:hover {
        background-color: #f1f5f9;
    }

    .dropdown-item-custom.active {
        background-color: #eff6ff;
        color: var(--nav-primary);
        font-weight: 500;
    }

    .dropdown-item-custom .fi {
        font-size: 1.125rem;
        border-radius: 2px;
    }

.currency-native-select {
    width: 100%;
    padding: 0.625rem;
    border: 1px solid var(--nav-border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.875rem;
    background-color: white;
    cursor: pointer;
}

.dropdown-menu-currency {
    min-width: 260px;
    padding: 0.75rem;
}

/* ============================================
   MAIN HEADER
   ============================================ */

.main-header {
    background-color: var(--nav-bg);
    border-bottom: 1px solid var(--nav-border);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all var(--nav-transition);
}

    .main-header.scrolled {
        background-color: var(--nav-bg-scrolled);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        box-shadow: var(--nav-shadow);
        border-bottom-color: transparent;
    }

    .main-header .nav-container {
        margin: 0 auto;
        padding: 0 1.5rem;
    }

    .main-header .header-content {
        display: flex;
        align-items: center;
        height: 72px;
        gap: 1rem;
    }

    /* ============================================
   LOGO
   ============================================ */

    .main-header .brand-logo {
        display: flex;
        align-items: center;
        flex-shrink: 0;
        text-decoration: none;
    }

        .main-header .brand-logo img {
            height: 32px;
            width: auto;
            transition: transform 0.2s ease;
        }

        .main-header .brand-logo:hover img {
            transform: scale(1.02);
        }

/* ============================================
   SEARCH BOX
   ============================================ */

.header-search {
    flex: 0 1 380px;
}

    .header-search form {
        width: 100%;
    }

.search-box {
    display: flex;
    align-items: center;
    width: 100%;
    background-color: #f1f5f9;
    border: 2px solid transparent;
    border-radius: 100px;
    padding: 0 2px 0 1rem;
    transition: all 0.2s ease;
}

    .search-box:focus-within {
        background-color: white;
        border-color: var(--nav-primary-light);
        box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    }

.search-icon {
    color: var(--nav-text-muted);
    font-size: 0.875rem;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.search-input {
    flex: 1;
    border: none;
    background: none;
    padding: 0.625rem 0;
    font-family: inherit;
    font-size: 0.9375rem;
    color: var(--nav-text);
    outline: none;
    min-width: 0;
}

    .search-input::placeholder {
        color: var(--nav-text-muted);
    }

.search-btn {
    background: linear-gradient(135deg, var(--nav-primary) 0%, var(--nav-primary-dark) 100%);
    color: white;
    border: none;
    padding: 0.7rem 1.25rem;
    border-radius: 100px;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

    .search-btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    }

/* ============================================
   MAIN NAVIGATION
   ============================================ */

.main-header .main-nav {
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: flex-end;
}

.main-header .nav-menu {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 0.25rem;
}

.main-header .nav-item {
    position: relative;
}

.main-header .nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    color: var(--nav-text);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    border-radius: 10px;
    transition: all 0.2s ease;
    white-space: nowrap;
    background: none;
    border: none;
    font-family: inherit;
    cursor: pointer;
}

    .main-header .nav-link:hover {
        background-color: #f1f5f9;
        color: var(--nav-primary);
    }

    .main-header .nav-link i:first-child {
        font-size: 0.875rem;
        opacity: 0.8;
    }

.main-header .dropdown-arrow {
    font-size: 0.625rem;
    opacity: 0.5;
    transition: transform 0.2s ease;
}

.main-header .has-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

.main-header .user-avatar {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--nav-primary) 0%, #8b5cf6 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.main-header .nav-highlight {
    color: var(--nav-primary);
}

    .main-header .nav-highlight:hover {
        background-color: #eff6ff;
    }

.main-header .nav-cta {
    background: linear-gradient(135deg, var(--nav-primary) 0%, var(--nav-primary-dark) 100%);
    color: white !important;
    padding: 0.5rem 1.25rem;
    border-radius: 10px;
}

    .main-header .nav-cta:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
        background-color: transparent;
    }

/* ============================================
   SUBMENUS
   ============================================ */

.submenu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border-radius: var(--nav-radius);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
    min-width: 240px;
    padding: 0.5rem;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
    border: 1px solid var(--nav-border);
    z-index: 1001;
}

.has-dropdown.open .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.submenu li a,
.submenu li button {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.625rem 0.875rem;
    color: var(--nav-text);
    text-decoration: none;
    font-family: inherit;
    font-size: 0.9375rem;
    border: none;
    background: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
}

    .submenu li a:hover,
    .submenu li button:hover {
        background-color: #f1f5f9;
        color: var(--nav-primary);
    }

    .submenu li a i,
    .submenu li button i {
        font-size: 0.875rem;
        color: var(--nav-text-muted);
        width: 20px;
        text-align: center;
    }

.submenu-divider {
    height: 1px;
    background-color: var(--nav-border);
    margin: 0.5rem;
    list-style: none;
}

.logout-btn {
    color: #dc2626 !important;
}

    .logout-btn:hover {
        background-color: #fef2f2 !important;
        color: #dc2626 !important;
    }

/* ============================================
   MOBILE TOGGLE
   ============================================ */

.mobile-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    gap: 5px;
    padding: 0;
    position: relative;
    z-index: 1002;
}

    .mobile-toggle span {
        display: block;
        width: 24px;
        height: 2px;
        background-color: var(--nav-text);
        border-radius: 2px;
        transition: all 0.3s ease;
        transform-origin: center;
    }

    .mobile-toggle.active span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .mobile-toggle.active span:nth-child(2) {
        opacity: 0;
        transform: scaleX(0);
    }

    .mobile-toggle.active span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

/* ============================================
   MISC
   ============================================ */

.header-spacer {
    height: 0;
}

.main-content {
    min-height: calc(100vh - 112px);
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

.toast-container {
    position: fixed;
    top: 100px;
    right: 2rem;
    z-index: 9999;
    animation: slideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
    border-left: 4px solid;
    min-width: 320px;
    max-width: 480px;
}

.toast-success {
    border-left-color: #22c55e;
}

.toast-error {
    border-left-color: #dc2626;
}

.toast-warning {
    border-left-color: #f59e0b;
}

.toast-info {
    border-left-color: #3b82f6;
}

.toast-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.toast-success .toast-icon {
    color: #22c55e;
}

.toast-error .toast-icon {
    color: #dc2626;
}

.toast-warning .toast-icon {
    color: #f59e0b;
}

.toast-info .toast-icon {
    color: #3b82f6;
}

.toast-message {
    flex: 1;
    font-size: 0.9375rem;
    color: var(--nav-text);
    line-height: 1.5;
}

.toast-close {
    background: none;
    border: none;
    color: var(--nav-text-muted);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1rem;
    transition: color 0.2s;
}

    .toast-close:hover {
        color: var(--nav-text);
    }

.toast.hiding {
    animation: slideOutRight 0.3s ease forwards;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* ============================================
   RESPONSIVE
   ============================================ */

/* Large desktop */
@media (min-width: 1280px) {
    .header-search {
        flex: 0 1 480px;
    }
}

/* Tablet */
@media (max-width: 1024px) {
    .header-search {
        flex: 0 1 260px;
    }

    .search-btn {
        display: none;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .top-bar {
        display: none;
    }

    .main-header .header-content {
        height: 64px;
    }

    .header-search {
        display: none;
    }

    .mobile-toggle {
        display: flex;
    }

    .main-header .main-nav {
        flex: unset;
    }

    .main-header .nav-menu {
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        bottom: 0;
        background: white;
        flex-direction: column;
        align-items: stretch;
        padding: 1.5rem;
        gap: 0.5rem;
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        z-index: 999;
    }

        .main-header .nav-menu.open {
            transform: translateX(0);
        }

    body.menu-open {
        overflow: hidden;
    }

    .main-header .nav-link {
        padding: 1rem;
        font-size: 1rem;
        justify-content: flex-start;
    }

    .main-header .nav-cta {
        margin-top: 1rem;
        justify-content: center;
    }

    .has-dropdown .dropdown-arrow {
        margin-left: auto;
    }

    .submenu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        padding: 0 0 0 1rem;
        display: none;
        min-width: auto;
    }

    .has-dropdown.open .submenu {
        display: block;
    }

    .submenu li a,
    .submenu li button {
        padding: 0.75rem 1rem;
    }

    .header-spacer {
        height: 64px;
    }

    .toast-container {
        left: 1rem;
        right: 1rem;
        top: 80px;
    }

    .toast {
        min-width: auto;
        max-width: none;
    }
}

@media (min-width: 769px) {
    .header-spacer {
        display: none;
    }
}

/* ============================================
   RTL SUPPORT
   ============================================ */

[dir="rtl"] .dropdown-menu-custom,
[dir="rtl"] .submenu {
    right: auto;
    left: 0;
}

[dir="rtl"] .search-box {
    padding: 0 1rem 0 4px;
}

[dir="rtl"] .search-icon {
    margin-right: 0;
    margin-left: 0.75rem;
}

[dir="rtl"] .toast-container {
    right: auto;
    left: 2rem;
}

[dir="rtl"] .toast {
    border-left: none;
    border-right: 4px solid;
}

/* ============================================
   REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
