/* ============================================
   MAIN.CSS - COMPLETELY FIXED
   Harmony Backpacker Safaris Theme
   Version: 2.0
   ============================================ */

/* ============================================
   IMPORT EXTERNAL CSS
   ============================================ */
@import url('https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css');

/* ============================================
   RESET & BASE STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: #fafaf9;
    color: #1c1917;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(2deg); }
}

@keyframes pulse-slow {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 0.3; }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* Animation Classes */
.animate-fadeInUp {
    animation: fadeInUp 0.8s ease-out forwards;
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

.animate-float-delay {
    animation: float 6s ease-in-out infinite;
    animation-delay: 2s;
}

/* Parallax effect */
.parallax-bg {
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .parallax-bg {
        background-attachment: scroll; /* Better performance on mobile */
    }
}

/* Animation for reveals */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

.animate-pulse-slow {
    animation: pulse-slow 4s ease-in-out infinite;
}

.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }

/* ============================================
   MAIN NAVIGATION - COMPLETELY FIXED
   ============================================ */

/* Glass Navigation */
.glass-nav {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    position: sticky;
    top: 0;
    z-index: 50;
}

.glass-nav.scrolled {
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.98);
}

/* ============================================
   DROPDOWN & SUBMENU SYSTEM - COMPLETELY FIXED
   Supports up to 4 levels deep
   ============================================ */

/* Base Menu Item Positioning */
.menu-item-has-children {
    position: relative;
}

/* Remove default list styles */
.sub-menu {
    list-style: none;
    margin: 0;
    padding: 0.5rem 0;
    background: white;
    border-radius: 12px;
    border: 1px solid #e7e5e4;
}

/* ============================================
   LEVEL 1 - TOP LEVEL DROPDOWNS
   ============================================ */
.nav-item > .sub-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 240px;
    box-shadow: 0 20px 35px -10px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    z-index: 9999;
}

.nav-item:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ============================================
   LEVEL 2, 3, 4 - NESTED FLYOUT SUBMENUS
   ============================================ */
.sub-menu .sub-menu {
    position: absolute;
    top: -8px;
    left: 100%;
    min-width: 240px;
    margin-left: 8px;
    box-shadow: 0 20px 35px -10px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateX(-8px);
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    z-index: 10000;
}

/* Show nested submenu on hover */
.sub-menu li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* Right-aligned nested submenu (prevents off-screen) */
.sub-menu .sub-menu.right-aligned {
    left: auto;
    right: 100%;
    margin-left: 0;
    margin-right: 8px;
    transform: translateX(8px);
}

.sub-menu li:hover > .sub-menu.right-aligned {
    transform: translateX(0);
}

/* ============================================
   SUBMENU ITEM STYLES
   ============================================ */
.sub-menu li {
    position: relative;
    margin: 0;
    padding: 0;
}

.sub-menu li a,
.sub-menu li button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.625rem 1.25rem;
    color: #57534e;
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.4;
    transition: all 0.2s ease;
    white-space: nowrap;
}

/* Allow text wrap on smaller screens */
@media (max-width: 1280px) {
    .sub-menu li a,
    .sub-menu li button {
        white-space: normal;
    }
}

.sub-menu li a:hover,
.sub-menu li button:hover {
    background: #fef3c7;
    color: #b45309;
    padding-left: 1.75rem;
    padding-right: 1rem;
}

/* Remove extra padding for buttons with right arrow */
.sub-menu li button span:first-child {
    flex: 1;
}

.sub-menu li button .iconify {
    opacity: 0.6;
    transition: all 0.2s ease;
}

.sub-menu li button:hover .iconify {
    opacity: 1;
    transform: translateX(3px);
}

/* ============================================
   TOP LEVEL NAV LINKS
   ============================================ */
.nav-link {
    position: relative;
    transition: color 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    text-decoration: none;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #b45309, #d97706);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.nav-link:hover {
    color: #b45309;
}

/* Dropdown arrow rotation */
.nav-item:hover .iconify[data-icon="lucide:chevron-down"] {
    transform: rotate(180deg);
}

/* Active menu item */
.current-menu-item > a,
.current-page-ancestor > a,
.current-menu-parent > a {
    color: #b45309 !important;
    font-weight: 600;
}

.current-menu-item > a::after,
.current-page-ancestor > a::after {
    width: 100% !important;
}

/* ============================================
   MEGA MENU STYLES
   ============================================ */
.mega-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    z-index: 9999;
}

.nav-item:hover .mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.mega-menu > div {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid #e7e5e4;
    overflow: hidden;
}

/* Mega Menu Grid Layouts */
.mega-menu .grid-cols-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
}

.mega-menu .grid-cols-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
}

.mega-menu .grid-cols-4 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.5rem;
}

/* ============================================
   ICONIFY TRANSITIONS
   ============================================ */
.iconify {
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
}

/* ============================================
   MOBILE MENU STYLES
   ============================================ */
#mobile-menu {
    background: white;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 9998;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 400px;
    overflow-y: auto;
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.1);
}

#mobile-menu.active {
    transform: translateX(0);
}

#mobile-menu .menu-item {
    list-style: none;
    margin: 0;
    padding: 0;
}

#mobile-menu .menu-item a,
#mobile-menu .menu-item > button {
    display: block;
    padding: 0.875rem 1rem;
    color: #44403c;
    font-weight: 500;
    border-radius: 0.75rem;
    transition: all 0.2s ease;
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    cursor: pointer;
}

#mobile-menu .menu-item a:hover,
#mobile-menu .menu-item > button:hover {
    background: #fef3c7;
    color: #b45309;
}

/* Mobile Submenu - Hidden by default */
#mobile-menu .sub-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    background: #fafaf9;
    margin-top: 0;
    margin-left: 1rem;
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    border-radius: 0.75rem;
    display: none;
    width: auto;
    min-width: auto;
}

#mobile-menu .sub-menu.active {
    display: block;
}

#mobile-menu .sub-menu li a {
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
}

#mobile-menu .sub-menu li a:hover {
    padding-left: 1.5rem;
}

/* Mobile Menu Close Button */
#close-menu {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background: #f5f5f4;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
}

#close-menu:hover {
    background: #fef3c7;
    transform: scale(1.05);
}

/* ============================================
   TOP BAR STYLES
   ============================================ */
.top-bar-animation {
    background: linear-gradient(90deg, #1c1917 0%, #292524 50%, #1c1917 100%);
    background-size: 200% 100%;
    animation: shimmer 3s ease-in-out infinite;
}

/* ============================================
   BUTTON STYLES
   ============================================ */
.btn-primary {
    background: linear-gradient(135deg, #b45309 0%, #d97706 100%);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border-radius: 60px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

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

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px -5px rgba(180, 83, 9, 0.5);
}

/* ============================================
   CARD STYLES
   ============================================ */
.card-3d {
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    border-radius: 1rem;
    overflow: hidden;
}

.card-3d:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.card-3d img {
    transition: transform 0.6s ease;
}

.card-3d:hover img {
    transform: scale(1.05);
}

/* Feature Cards */
.feature-card {
    transition: all 0.3s ease;
    border-radius: 1rem;
}

.feature-card:hover {
    background: white;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.1);
}

.feature-card:hover .icon-box {
    background: #b45309;
    color: white;
    transform: rotateY(180deg);
}

.icon-box {
    transition: all 0.6s ease;
    transform-style: preserve-3d;
}

/* Destination Cards */
.destination-card {
    transition: all 0.4s ease;
    border-radius: 1rem;
    overflow: hidden;
}

.destination-card:hover {
    transform: scale(1.02);
}

/* ============================================
   BACKGROUND SHAPES
   ============================================ */
.floating-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    pointer-events: none;
}

/* ============================================
   SLIDER & SWIPER STYLES
   ============================================ */
.slider-nav-container {
    position: absolute;
    bottom: 140px;
    right: 0;
    z-index: 20;
    display: flex;
    gap: 8px;
}

.swiper-custom-btn {
    width: 48px;
    height: 48px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid #e7e5e4;
    color: #b45309;
}

.swiper-custom-btn:hover {
    background: #b45309;
    color: white;
    border-color: #b45309;
    transform: scale(1.1);
}

.swiper-custom-btn.swiper-button-disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.swiper-pagination-bullet {
    background: #d97706 !important;
    opacity: 0.3 !important;
}

.swiper-pagination-bullet-active {
    opacity: 1 !important;
    background: #b45309 !important;
}

/* Hero Slider Animations */
.hero-swiper .swiper-slide h1,
.hero-swiper .swiper-slide p,
.hero-swiper .swiper-slide div.flex {
    opacity: 0;
}

.hero-swiper .swiper-slide-active h1 {
    animation: fadeInUp 0.8s ease forwards 0.2s;
}

.hero-swiper .swiper-slide-active p {
    animation: fadeInUp 0.8s ease forwards 0.4s;
}

.hero-swiper .swiper-slide-active .flex {
    animation: fadeInUp 0.8s ease forwards 0.6s;
}

/* Kenya Safaris Section Styles */
.swiper-custom-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.swiper-custom-btn:hover {
    background-color: #10b981;
    color: white !important;
    border-color: #10b981 !important;
}

.whatsapp-book-btn,
.whatsapp-quick-btn {
    cursor: pointer;
}

.whatsapp-book-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

/* Card hover effects */
.card-3d:hover {
    transform: translateY(-5px);
}

/* Swiper pagination customization */
.swiper-pagination-bullet-active {
    background-color: #10b981 !important;
}

/* ============================================
   SCROLL REVEAL
   ============================================ */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   TEXT & GRADIENT STYLES
   ============================================ */
.gradient-text {
    background: linear-gradient(135deg, #b45309 0%, #d97706 50%, #fbbf24 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-gradient {
    background: linear-gradient(135deg, rgba(28, 25, 23, 0.85) 0%, rgba(28, 25, 23, 0.4) 50%, rgba(180, 83, 9, 0.2) 100%);
}

/* ============================================
   TOUR FINDER
   ============================================ */
.tour-finder {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 1rem;
}

/* ============================================
   FOOTER STYLES
   ============================================ */
footer .custom-logo-wrapper img {
    max-height: 60px;
    width: auto;
    filter: brightness(0) invert(1);
    transition: transform 0.3s ease;
}

footer .custom-logo-wrapper img:hover {
    transform: scale(1.05);
}

footer ul li a {
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
}

footer ul li a:hover {
    transform: translateX(5px);
}

/* ============================================
   RESPONSIVE STYLES
   ============================================ */
@media (max-width: 1024px) {
    /* Hide desktop dropdowns on tablet/mobile */
    .nav-item > .sub-menu,
    .sub-menu .sub-menu,
    .mega-menu {
        display: none !important;
    }
    
    .slider-nav-container {
        bottom: 100px;
        right: 20px;
    }
}

@media (max-width: 768px) {
    .hero-gradient {
        background: linear-gradient(135deg, rgba(28, 25, 23, 0.9) 0%, rgba(28, 25, 23, 0.6) 100%);
    }
    
    .slider-nav-container {
        bottom: 60px;
    }
    
    .swiper-custom-btn {
        width: 40px;
        height: 40px;
    }
    
    .floating-shape {
        opacity: 0.2;
    }
    
    /* Responsive Footer */
    footer .grid {
        gap: 2rem;
    }
    
    footer .lg\:col-span-1 {
        text-align: center;
    }
    
    footer .flex.items-center.gap-2 {
        justify-content: center;
    }
    
    footer ul li a {
        justify-content: center;
    }
}

@media (min-width: 768px) {
    .md\:py-20 {
        padding-top: 0rem !important;
        padding-bottom: 0rem !important;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.overflow-x-hidden {
    overflow-x: hidden;
}

.antialiased {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .glass-nav,
    .mega-menu,
    .sub-menu,
    .slider-nav-container,
    .floating-shape,
    #mobile-menu,
    .top-bar-animation {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
}
