@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* =========================================
   1. GLOBAL RESET & BASE
   ========================================= */
:root {
    /* Define safe areas for modern mobile devices (notches/home bars) */
    --safe-area-inset-bottom: env(safe-area-inset-bottom, 20px);
}

html {
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent;
    /* Remove blue highlight on tap */
}

body {
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
    /* Critical for mobile to prevent horizontal sway */
    width: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Images should never overflow their containers */
img,
video {
    max-width: 100%;
    height: auto;
    display: block;
}

/* =========================================
   2. CUSTOM SCROLLBAR (Desktop & Mobile)
   ========================================= */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
    /* For horizontal scroll areas */
}

::-webkit-scrollbar-track {
    background: #0f0f0f;
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
    border: 2px solid #0f0f0f;
    /* Adds breathing room */
}

::-webkit-scrollbar-thumb:hover {
    background: #ff6a00;
}

/* Hide scrollbar for horizontal scrolling containers (Pricing Cards on Mobile) */
.hide-scroll {
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

.hide-scroll::-webkit-scrollbar {
    display: none;
}

/* =========================================
   3. RESPONSIVE MASONRY GRID (Gallery)
   ========================================= */
.masonry-grid {
    column-count: 1;
    /* Default: Mobile */
    column-gap: 1.5rem;
    width: 100%;
}

/* Tablet Portrait */
@media (min-width: 640px) {
    .masonry-grid {
        column-count: 2;
    }
}

/* Desktop */
@media (min-width: 1024px) {
    .masonry-grid {
        column-count: 3;
    }
}

/* Prevent items from splitting across columns */
.break-inside-avoid {
    break-inside: avoid;
    page-break-inside: avoid;
    margin-bottom: 1.5rem;
    display: inline-block;
    /* Fixes some Firefox column rendering issues */
    width: 100%;
}

/* =========================================
   4. ANIMATIONS & TRANSITIONS
   ========================================= */
/* Global Smooth Theme Transition */
*,
*::before,
*::after {
    transition-property: background-color, border-color, color, fill, stroke, opacity, box-shadow, transform;
    transition-duration: 0.3s;
    transition-timing-function: ease;
}

/* Performance optimization: Don't transition layout properties */
.no-transition {
    transition: none !important;
}

/* Fade Up Animation */
.fade-up {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
    /* GPU Acceleration */
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
    will-change: auto;
}

/* Reduce motion preference for accessibility */
@media (prefers-reduced-motion: reduce) {
    .fade-up {
        transition: none;
        opacity: 1;
        transform: none;
    }

    *,
    *::before,
    *::after {
        transition-duration: 0.01s !important;
    }
}

/* Hover Lift Effect (Disable on touch devices to prevent sticky hover states) */
@media (hover: hover) {
    .hover-lift {
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }

    .hover-lift:hover {
        transform: translateY(-8px);
        box-shadow: 0 15px 30px -10px rgba(255, 106, 0, 0.2);
    }
}

/* Hamburger Menu Animation */
.hamburger-line {
    transform-origin: center;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* =========================================
   5. UI COMPONENTS
   ========================================= */

/* Toast Notification - Mobile Optimized */
#toast {
    visibility: hidden;
    min-width: 280px;
    /* Slightly wider for mobile readability */
    max-width: 90vw;
    background-color: #171717;
    color: #fff;
    text-align: center;
    border-radius: 12px;
    /* Softer corners */
    padding: 16px 24px;
    position: fixed;
    z-index: 100;
    left: 50%;
    /* Position initially off-screen or lower */
    bottom: calc(20px + var(--safe-area-inset-bottom));
    transform: translateX(-50%) translateY(20px);
    opacity: 0;
    border-left: 4px solid #ff6a00;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    /* Bouncy enter */
}

#toast.show {
    visibility: visible;
    opacity: 1;
    /* Slide up to visible position */
    transform: translateX(-50%) translateY(0);
    bottom: calc(40px + var(--safe-area-inset-bottom));
}

/* Mobile Menu Overlay - Ensure it covers notches */
#mobile-menu {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}

/* =========================================
   6. HELPER CLASSES
   ========================================= */
/* Force full height on mobile views */
.min-h-screen-ios {
    min-height: 100vh;
    min-height: -webkit-fill-available;
}

.hover-rise{
    background: rgb(255, 81, 0);
    transform: translateX(2px) translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12) inset;
    transition: background 0.3s ease, transform 0.3s ease;
}

/* =========================================
   DIAMOND 3D CAROUSEL & ACTIVE STATES
   ========================================= */
.carousel-container {
    position: relative;
    height: 600px;
    width: 100%;
    max-width: 1000px;
    /* Constrain width for better diamond shape */
    margin: 0 auto;
    overflow: hidden;
    perspective: 1000px;
}

.carousel-card {
    position: absolute;
    width: 100%;
    max-width: 340px;
    background: #fff;
    border-radius: 1.5rem;
    padding: 2rem;
    transition: all 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);

    /* DEFAULT STATE (Inactive) */
    opacity: 0.5;
    z-index: 10;
    top: 5%;
    left: 50%;
    /* Start centered, JS moves them */
    transform: translateX(-50%) scale(0.8);

    border: 1px solid rgba(128, 128, 128, 0.2);
    box-shadow: none;
    filter: blur(1px);
    pointer-events: none;
    /* Prevent clicks on side cards */
}

/* Dark Mode Support */
.dark .carousel-card {
    background: #171717;
    border-color: rgba(255, 255, 255, 0.1);
}

/* ================= BUTTON STYLING (Crucial) ================= */

/* 1. Default Button (Inactive) - Gray/Hollow */
.carousel-card .card-btn {
    width: 100%;
    padding: 1rem;
    border-radius: 0.75rem;
    font-weight: 700;
    transition: all 0.3s ease;

    /* Dull Look */
    background: transparent;
    border: 2px solid #525252;
    color: #525252;
    box-shadow: none;
}

/* 2. Active Button (Inside .pos-0) - Orange/Solid */
.carousel-card.pos-0 .card-btn {
    background: #ff6a00;
    border-color: #ff6a00;
    color: white;
    box-shadow: 0 10px 20px rgba(255, 106, 0, 0.3);
}

/* Hover effect only for the active button */
.carousel-card.pos-0 .card-btn:hover {
    background: #e65f00;
    transform: translateY(-2px);
}

/* ================= POSITION LOGIC (Diamond) ================= */

/* POS 0: ACTIVE (Front Center) */
.carousel-card.pos-0 {
    transform: translateX(-50%) translateY(0) scale(1);
    opacity: 1;
    z-index: 50;
    filter: blur(0);
    pointer-events: auto;

    /* Active Card Glow */
    border: 2px solid #ff6a00;
    box-shadow: 0 25px 50px -12px rgba(255, 106, 0, 0.25);
}

/* POS 1: RIGHT */
.carousel-card.pos-1 {
    transform: translateX(40%) translateY(10%) scale(0.85);
    z-index: 40;
    opacity: 0.6;
}

/* POS 2: BOTTOM (Back) */
.carousel-card.pos-2 {
    transform: translateX(-50%) translateY(30%) scale(0.7);
    z-index: 30;
    opacity: 0.3;
}

/* POS 3: LEFT */
.carousel-card.pos-3 {
    transform: translateX(-140%) translateY(10%) scale(0.85);
    z-index: 40;
    opacity: 0.6;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .carousel-container {
        height: 500px;
    }

    .carousel-card {
        max-width: 280px;
        padding: 1.5rem;
    }

    .carousel-card.pos-1 {
        transform: translateX(10%) translateY(10%) scale(0.85);
    }

    .carousel-card.pos-3 {
        transform: translateX(-110%) translateY(10%) scale(0.85);
    }
}

/* === ANIMATED MAP BACKGROUND === */
@keyframes continuousPan {
    from {
        transform: translateX(-50%);
    }

    to {
        transform: translateX(0%);
    }
}

.map-track {
    animation: continuousPan 40s linear infinite;
    will-change: transform;
}

/* The trick: double-wide div with the map repeated, then slide it left by 50% */
.map-track {
    position: absolute;
    top: -15%;
    left: 0;
    /* Two map widths side by side */
    width: 200%;
    height: 130%;
    display: flex;
}

.map-tile {
    flex: 0 0 50%;
    height: 100%;
    background-image: url('https://upload.wikimedia.org/wikipedia/commons/e/ec/World_map_blank_without_borders.svg');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.9;
}

/* === GLASSMORPHISM CARDS === */
.glass-card {
    background: rgba(255, 255, 255, 0.55) !important;
    backdrop-filter: blur(18px) saturate(180%);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.7) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 1px 0 rgba(255, 255, 255, 0.6) inset;
}

.dark .glass-card {
    background: rgba(23, 23, 23, 0.5) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}

.glass-input {
    background: rgba(255, 255, 255, 0.4) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.6) !important;
}

.glass-input:hover {
    background: rgba(255, 255, 255, 0.55);
    transform: translateX(2px) translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12) inset;
    transition: background 0.3s ease, transform 0.3s ease;
}

.dark .glass-input {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.glass-info-item {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 1.25rem;
    padding: 1.25rem 1.5rem;
    transition: background 0.3s ease, transform 0.3s ease;
}

.dark .glass-info-item {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
}

.glass-info-item:hover {
    background: rgba(255, 255, 255, 0.55);
    transform: translateX(4px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 1px 0 rgba(255, 255, 255, 0.6) inset;
}

.dark .glass-info-item:hover {
    background: rgba(255, 255, 255, 0.08);
}