/* =========================================
   NAVBAR.CSS - TravellingFox Navigation
   ========================================= */

/* --- BASE NAVBAR STYLES --- */
.navbar {
    background-color: #1e3a8a; /* blue-900 */
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    position: sticky;
    top: 0;
    z-index: 50;
    transition: all 0.3s ease;
}

.navbar-container {
    max-width: 80rem; /* max-w-7xl */
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (min-width: 640px) {
    .navbar-container {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .navbar-container {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

.navbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 4rem; /* h-16 */
}

/* --- LOGO SECTION --- */
.logo-section {
    display: flex;
    align-items: center;
    space-gap: 0.75rem; /* space-x-3 */
}

.logo-section > * + * {
    margin-left: 0.75rem;
}

.logo-container {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.logo-img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
    transition: opacity 0.3s ease;
}

.logo-text h1 {
    font-size: 1.25rem; /* text-xl */
    line-height: 1.75rem;
    font-weight: 600; /* font-semibold */
    color: #ffffff;
    letter-spacing: 0.025em; /* tracking-wide */
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.logo-text p {
    font-size: 0.75rem; /* text-xs */
    line-height: 1rem;
    color: #dbeafe; /* text-blue-200 */
    font-weight: 500;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

@media (max-width: 639px) {
    .logo-text p {
        display: none;
    }
}

/* --- DESKTOP MENU --- */
.desktop-menu {
    display: none;
    align-items: center;
    gap: 1.5rem; /* space-x-6 */
}

@media (min-width: 768px) {
    .desktop-menu {
        display: flex;
    }
}

.nav-link {
    color: #ffffff;
    font-weight: 500; /* font-medium */
    font-family: 'Plus Jakarta Sans', sans-serif;
    text-decoration: none;
    transition: color 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0.5rem 0;
}

.nav-link:hover {
    color: #fed7aa; /* orange-200 */
}

.nav-link.active {
    color: #ff6b35; /* fox-orange */
    font-weight: 600;
}

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

.dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 0.25rem; /* space-x-1 */
    color: #ffffff;
    font-weight: 500;
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem 0;
    transition: color 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.dropdown-trigger:hover {
    color: #fed7aa; /* orange-200 */
}

.dropdown-trigger.featured {
    color: #ff6b35; /* fox-orange */
    font-weight: 600;
}

.dropdown-arrow {
    width: 1rem;
    height: 1rem;
    transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.dropdown-wrapper:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    left: 0;
    top: 100%;
    margin-top: 0;
    width: 20rem; /* w-80 */
    background-color: #ffffff;
    border-radius: 0.5rem; /* rounded-lg */
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25); /* shadow-xl */
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 50;
    border: 1px solid #f3f4f6; /* border-gray-100 */
}

.dropdown-wrapper:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
}

/* Triangolino di connessione */
.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 1rem;
    width: 1rem;
    height: 1rem;
    background-color: #ffffff;
    border-left: 1px solid #f3f4f6;
    border-top: 1px solid #f3f4f6;
    transform: rotate(45deg);
}

.dropdown-content {
    padding: 0.75rem 0; /* py-3 */
}

.dropdown-header {
    padding: 0.5rem 1rem; /* px-4 py-2 */
    border-bottom: 1px solid #f3f4f6; /* border-gray-100 */
}

.dropdown-header h3 {
    font-weight: 600;
    color: #1f2937; /* text-gray-800 */
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.dropdown-header p {
    font-size: 0.875rem;
    color: #4b5563; /* text-gray-600 */
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.dropdown-item {
    display: block;
    padding: 0.75rem 1rem; /* px-4 py-3 */
    color: #374151; /* text-gray-700 */
    text-decoration: none;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.dropdown-item:hover {
    background-color: #fff7ed; /* orange-50 */
    color: #ff6b35; /* fox-orange */
}

.dropdown-item-content {
    display: flex;
    align-items: center;
    gap: 0.75rem; /* space-x-3 */
}

.dropdown-icon {
    font-size: 1.5rem;
}

.dropdown-text .title {
    font-weight: 500;
}

.dropdown-text .subtitle {
    font-size: 0.875rem;
    color: #6b7280; /* text-gray-500 */
}

.dropdown-footer {
    padding: 0.75rem 1rem; /* px-4 py-3 */
    background-color: #f9fafb; /* bg-gray-50 */
    border-bottom-left-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
}

.dropdown-cta {
    width: 100%;
    background-color: #ff6b35; /* fox-orange */
    color: #ffffff;
    padding: 0.5rem 1rem; /* py-2 px-4 */
    border-radius: 0.375rem; /* rounded-md */
    font-size: 0.875rem;
    font-weight: 600;
    font-family: 'Plus Jakarta Sans', sans-serif;
    border: none;
    cursor: pointer;
    transition: background-color 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.dropdown-cta:hover {
    background-color: #ea580c; /* orange-600 */
}

/* Dropdown menu per Vacanze Studio */
.dropdown-menu.vacanze-studio {
    width: 18rem; /* w-72 */
}

.dropdown-menu.vacanze-studio .dropdown-item {
    font-weight: 400;
}

/* --- AREA PERSONALE BUTTON --- */
.area-personale-btn {
    background-color: #ffffff;
    color: #2d3748; /* fox-dark */
    padding: 0.5rem 1rem; /* px-4 py-2 */
    border-radius: 0.375rem; /* rounded-md */
    font-weight: 600;
    font-family: 'Plus Jakarta Sans', sans-serif;
    border: none;
    cursor: pointer;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); /* shadow-sm */
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.area-personale-btn:hover {
    background-color: #fff7ed; /* orange-50 */
    color: #ff6b35; /* fox-orange */
}

.area-personale-btn svg {
    width: 1rem;
    height: 1rem;
}

/* --- MOBILE MENU BUTTON --- */
.mobile-menu-btn {
    display: flex;
    color: #ffffff;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
}

@media (min-width: 768px) {
    .mobile-menu-btn {
        display: none;
    }
}

.mobile-menu-btn svg {
    width: 1.5rem;
    height: 1.5rem;
}

/* --- MOBILE MENU --- */
.mobile-menu {
    display: none;
    background-color: #1e40af; /* blue-800 */
    border-top: 1px solid #1d4ed8; /* border-blue-700 */
}

@media (max-width: 767px) {
    .mobile-menu.show {
        display: block;
    }
}

.mobile-menu-content {
    padding: 0.5rem 0.75rem; /* px-2 py-3 */
    display: flex;
    flex-direction: column;
    gap: 0.25rem; /* space-y-1 */
}

.mobile-menu-link {
    display: block;
    padding: 0.5rem 0.75rem; /* px-3 py-2 */
    color: #ffffff;
    text-decoration: none;
    border-radius: 0.25rem;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.mobile-menu-link:hover {
    color: #fed7aa; /* orange-200 */
    background-color: #1d4ed8; /* blue-700 */
}

/* --- MOBILE DROPDOWN --- */
.mobile-dropdown-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.5rem 0.75rem; /* px-3 py-2 */
    color: #ffffff;
    background: none;
    border: none;
    cursor: pointer;
    font-family: 'Plus Jakarta Sans', sans-serif;
    text-align: left;
}

.mobile-dropdown-trigger.featured {
    color: #ff6b35; /* fox-orange */
    font-weight: 600;
}

.mobile-dropdown-arrow {
    width: 1rem;
    height: 1rem;
    transform: rotate(0deg);
    transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-dropdown-arrow.rotated {
    transform: rotate(180deg);
}

.mobile-dropdown-content {
    display: none;
    margin-top: 0.5rem;
    margin-left: 1rem;
    flex-direction: column;
    gap: 0.25rem; /* space-y-1 */
}

.mobile-dropdown-content.show {
    display: flex;
}

.mobile-dropdown-item {
    display: block;
    padding: 0.5rem 0.75rem; /* px-3 py-2 */
    color: rgba(255, 255, 255, 0.9); /* text-white/90 */
    text-decoration: none;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.mobile-dropdown-item:hover {
    color: #fed7aa; /* orange-200 */
    background-color: #1d4ed8; /* blue-700 */
}

.mobile-area-personale {
    padding: 0.75rem; /* px-3 py-2 */
}

.mobile-area-personale-btn {
    width: 100%;
    background-color: #ffffff;
    color: #1e3a8a; /* blue-900 */
    padding: 0.5rem 1rem; /* px-4 py-2 */
    border-radius: 0.375rem; /* rounded-md */
    font-weight: 500;
    font-family: 'Plus Jakarta Sans', sans-serif;
    border: none;
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.mobile-area-personale-btn:hover {
    background-color: #fff7ed; /* orange-50 */
    color: #ff6b35; /* fox-orange */
}

.mobile-area-personale-btn svg {
    width: 1rem;
    height: 1rem;
}

/* --- RESPONSIVE ADJUSTMENTS --- */
@media (max-width: 480px) {
    .navbar-container {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .logo-container {
        width: 1.75rem;
        height: 1.75rem;
    }

    .logo-text h1 {
        font-size: 1.125rem; /* text-lg */
    }
}

/* --- ACCESSIBILITY --- */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus states per accessibilità */
.nav-link:focus,
.dropdown-trigger:focus,
.dropdown-item:focus,
.area-personale-btn:focus,
.mobile-menu-btn:focus {
    outline: 2px solid #ff6b35;
    outline-offset: 2px;
}

/* --- PERFORMANCE OPTIMIZATIONS --- */
.dropdown-wrapper,
.mobile-dropdown-trigger {
    contain: layout style;
}

.dropdown-menu {
    will-change: opacity, visibility;
}

.dropdown-arrow,
.mobile-dropdown-arrow {
    will-change: transform;
}

/* --- PRINT STYLES --- */
@media print {
    .navbar {
        display: none;
    }
}
