/* =========================================
   SNOOSS Modern Theme - Cleaned & Optimized
   ========================================= */

/* Fonts */
@font-face {
    font-family: 'Outfit';
    font-style: normal;
    font-weight: 300;
    font-display: swap;
    src: url('fonts/outfit-300.ttf') format('truetype');
}

@font-face {
    font-family: 'Outfit';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('fonts/outfit-400.ttf') format('truetype');
}

@font-face {
    font-family: 'Outfit';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('fonts/outfit-600.ttf') format('truetype');
}

@font-face {
    font-family: 'Outfit';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('fonts/outfit-700.ttf') format('truetype');
}

@font-face {
    font-family: 'Outfit';
    font-style: normal;
    font-weight: 900;
    font-display: swap;
    src: url('fonts/outfit-900.ttf') format('truetype');
}

:root {
    --primary-color: #3b82f6;
    /* A brighter blue */
    --primary-gradient: linear-gradient(135deg, #3b82f6 0%, #0ea5e9 100%);
    --secondary-gradient: linear-gradient(135deg, #10b981 0%, #3b82f6 100%);
    --bg-dark: #0f172a;
    --bg-darker: #020617;
    --bg-card: rgba(30, 41, 59, 0.7);
    --text-white: #f8fafc;
    --text-gray: #94a3b8;
    --glass-border: 1px solid rgba(255, 255, 255, 0.1);
}

/* =========================================
   Base & Typography
   ========================================= */
body.modern-theme {
    font-family: 'Outfit', sans-serif !important;
    background-color: var(--bg-darker) !important;
    color: var(--text-white);
    padding-top: 130px;
    /* Approx 80px logo + 3rem padding */
    overflow-x: hidden;
    max-width: 100vw;
}

html {
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    letter-spacing: -0.02em;
}

.text-gradient {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-highlight {
    color: #60a5fa !important;
}

/* =========================================
   Components
   ========================================= */

/* Overrides */
.bg-black {
    background-color: var(--bg-darker) !important;
}

.bg-modern-alt {
    background: #0f172a !important;
    /* Slightly lighter dark */
}

/* Hero Section */
.hero-glow {
    position: relative;
}

.hero-glow::before {
    content: '';
    position: absolute;
    top: -100vw;
    left: -50vw;
    width: 200vw;
    height: 200vw;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, rgba(0, 0, 0, 0) 60%);
    z-index: 0;
    pointer-events: none;
}

/* Glassmorphism Cards */
.glossy-card {
    background: var(--bg-card) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: var(--glass-border);
    border-radius: 16px !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.glossy-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
    border-color: rgba(59, 130, 246, 0.3);
}

/* Feature Icons */
.feature-icon-box {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(14, 165, 233, 0.2) 100%) !important;
    color: #60a5fa !important;
}

/* Buttons */
.btn-modern {
    background: var(--primary-gradient) !important;
    border: none;
    border-radius: 9999px !important;
    /* Pill shape */
    color: white !important;
    font-weight: 600;
    padding: 12px 32px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
    box-shadow: 0 4px 14px 0 rgba(59, 130, 246, 0.39);
}

.btn-modern:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.23);
    opacity: 1 !important;
}

.btn-inline {
    padding: 0.5rem 1.5rem !important;
    font-size: 0.7em !important;
    vertical-align: middle;
    margin-left: 0.5rem;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3) !important;
}

.btn-modern-outline {
    background: transparent !important;
    border: 1px solid rgba(255, 255, 255, 0.8) !important;
    border-radius: 9999px !important;
    color: white !important;
    font-weight: 600;
    padding: 12px 32px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.btn-modern-outline:hover {
    background: white !important;
    color: var(--bg-darker) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.2);
    border-color: white !important;
    text-decoration: none !important;
}

/* =========================================
   Navigation
   ========================================= */
nav {
    background: rgba(2, 6, 23, 0.8) !important;
    backdrop-filter: blur(10px);
    border-bottom: var(--glass-border);
    position: fixed !important;
    /* Fixed positioning to prevent scroll jitter */
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
    transition: all 0.3s ease;
}

nav.nav-scrolled {
    padding-top: 0.4rem !important;
    padding-bottom: 0.4rem !important;
    background: rgba(2, 6, 23, 0.95) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

/* Logo Sizing */
nav img {
    max-height: 80px !important;
    width: auto;
    transition: all 0.3s ease;
}

nav.nav-scrolled img {
    max-height: 52px !important;
}

nav.nav-scrolled>div>a {
    padding: 0 !important;
}

/* Language Switcher */
.lang-switcher a {
    transition: color 0.3s ease;
}

.lang-switcher a:hover {
    color: #60a5fa !important;
    text-shadow: 0 0 8px rgba(96, 165, 250, 0.5);
}

/* =========================================
   Tool Badges & Modals
   ========================================= */
.tool-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    margin: 0.25rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-gray);
    transition: all 0.3s ease;
    cursor: default;
}

.tool-badge {
    position: relative;
}

.tool-badge:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.4);
    color: white;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
    transform: translateY(-2px);
    cursor: pointer;
}

/* Tooltip Styling */
.tool-badge .tooltip {
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: var(--bg-darker);
    color: var(--text-white);
    padding: 1rem 1.25rem;
    border-radius: 12px;
    border: var(--glass-border);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    font-size: 0.875rem;
    line-height: 1.5;
    white-space: normal;
    max-width: 280px;
    min-width: 200px;
    width: max-content;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.tool-badge .tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: var(--bg-darker);
}

.tool-badge:hover .tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Modal Styling */
.modern-modal-backdrop {
    position: fixed;
    /* Fixed relative to viewport */
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    /* Mobile-friendly height */
    background: transparent;
    backdrop-filter: none;
    z-index: 9999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 1rem;
}

.modern-modal-backdrop.active {
    display: flex;
    opacity: 1;
}

.modern-modal-content {
    background: var(--bg-darker);
    border: var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    /* Prevent overflow on small screens */
    overflow-y: auto;
    /* Allow scrolling if content is tall */
    position: relative;
    box-sizing: border-box;
    /* Ensures padding included in width */
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.modern-modal-backdrop.active .modern-modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    color: var(--text-gray);
    cursor: pointer;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: white;
}

/* =========================================
   Utilities
   ========================================= */
.py-32 {
    padding-top: 8rem !important;
    padding-bottom: 8rem !important;
}

/* Footer specific */
footer {
    background: #0f172a !important;
    border-top: var(--glass-border);
}


/* =========================================
   Mobile Optimization
   ========================================= */
@media (max-width: 768px) {

    /* --- Typography Scaling --- */
    h1,
    .fs-l3,
    .fs-xl2 {
        font-size: 2.5rem !important;
        line-height: 1.2 !important;
    }

    h2,
    .fs-l2,
    .fs-xl1 {
        font-size: 2rem !important;
        line-height: 1.3 !important;
    }

    h3,
    .fs-l1 {
        font-size: 1.75rem !important;
    }

    .fs-m3 {
        font-size: 1.5rem !important;
    }

    .fs-m2 {
        font-size: 1.1rem !important;
    }

    /* --- Spacing --- */
    .py-32 {
        padding-top: 4rem !important;
        padding-bottom: 4rem !important;
    }

    .p-10 {
        padding: 2rem !important;
    }

    .m-5 {
        margin: 1rem !important;
    }

    .mb-10 {
        margin-bottom: 2.5rem !important;
    }

    .glossy-card {
        margin-bottom: 1rem;
    }

    .hero-glow::before {
        top: -20%;
    }

    /* --- Navbar & Navigation --- */
    nav {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
        padding-left: 1.5rem !important;
        padding-right: 1.5rem !important;
        box-sizing: border-box;
    }

    nav img {
        max-height: 48px !important;
    }

    /* Mobile Menu Drawer */
    #nav-items.hidden {
        display: none !important;
    }

    #nav-items {
        display: flex !important;
        flex-direction: column;
        background: rgba(15, 23, 42, 0.98);
        backdrop-filter: blur(16px);
        position: fixed;
        /* Use fixed to be independent of nav padding/position */
        top: 80px;
        /* Approximate nav height */
        left: 0;
        width: 100%;
        height: auto;
        box-sizing: border-box;
        padding: 2rem 0;
        /* More spacing */
        border-bottom: var(--glass-border);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
        animation: slideDown 0.3s ease forwards;
        align-items: center !important;
        /* Center items horizontally */
    }

    #nav-items a {
        text-align: center;
        padding: 1rem 2rem !important;
        /* Wider target */
        margin: 0.5rem 0 !important;
        /* Vertical spacing */
        width: auto;
        /* Let content dictate width, or use 100% if preferred. Center align implies auto or full width text-center */
        min-width: 200px;
        border-bottom: none !important;
        /* Remove separator for cleaner look */
        border-radius: 8px;
    }

    #nav-items a:hover {
        background: rgba(255, 255, 255, 0.05);
    }

    .lang-switcher {
        text-align: center;
        padding: 1rem;
        margin: 1rem 0 !important;
        width: 100%;
    }

    /* --- Modal Adjustments for Mobile --- */
    .modern-modal-backdrop {
        /* Fix viewport sizing issue */
        height: 100vh !important;
        min-height: 100vh;
        max-height: 100vh;
        padding: 0;
        align-items: flex-start;
        justify-content: center;
        padding-top: 2rem;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .modern-modal-content {
        /* Natural positioning - no fixed/absolute tricks */
        position: relative;

        /* Adapt to screen like other elements */
        width: calc(100% - 2rem);
        max-width: none;
        max-height: none;
        margin: 1rem;

        /* Keep dark background consistent */
        background: var(--bg-darker);

        /* Responsive padding */
        padding: 1.5rem;

        /* Visual polish */
        border-radius: 12px;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    }

    .modal-close {
        /* Ensure close button is properly sized on mobile */
        width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Modal text sizing for mobile readability */
    .modern-modal-content h3 {
        font-size: 1.5rem !important;
    }

    .modern-modal-content p {
        font-size: 1rem !important;
        line-height: 1.6 !important;
    }

    /* --- Footer --- */
    footer .flex {
        flex-direction: column;
        text-align: center;
    }

    footer .md-w-25pc {
        width: 100% !important;
        margin-bottom: 2rem !important;
    }

    /* --- Tooltip Mobile Adjustments --- */
    .tool-badge .tooltip {
        max-width: 240px;
        font-size: 0.8rem;
        padding: 0.75rem 1rem;
    }

    /* Enable tooltips on tap for mobile */
    .tool-badge:active .tooltip {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* =========================================
   Distribution Slider Styling
   ========================================= */
.distribution-slider {
    position: relative;
    padding: 0 60px;
    /* Add padding to prevent cutoff */
}

.distribution-slider .swiper-pagination {
    bottom: -40px;
    left: 0;
    right: 0;
    text-align: center;
    padding: 0;
    margin: 0;
    width: 100%;
}

/* Scroll Offset for Fixed Header */
#flow,
#features,
#solution,
#distribution,
#subscribe {
    scroll-margin-top: 100px;
}

.distribution-slider .slick-dots li button:before {
    font-size: 12px;
    color: #60a5fa;
    opacity: 0.5;
}

.distribution-slider .slick-dots li.slick-active button:before {
    opacity: 1;
    color: #60a5fa;
}

.distribution-slider .swiper-button-prev,
.distribution-slider .swiper-button-next {
    width: 44px;
    height: 44px;
    z-index: 100;
    background: rgba(96, 165, 250, 0.15);
    border: 2px solid rgba(96, 165, 250, 0.4);
    border-radius: 50%;
    transition: all 0.3s ease;
    top: 50%;
    /* Swiper default is top: 50% */
    margin-top: -22px;
    /* Center it */
}

.distribution-slider .swiper-button-prev:hover,
.distribution-slider .swiper-button-next:hover {
    background: rgba(96, 165, 250, 0.3);
    border-color: #60a5fa;
}

.distribution-slider .swiper-button-prev:after,
.distribution-slider .swiper-button-next:after {
    font-size: 20px;
    color: #60a5fa;
    opacity: 1;
    line-height: 1;
    font-family: Arial, sans-serif;
}

.distribution-slider .swiper-button-prev:after {
    content: '<';
}

.distribution-slider .swiper-button-next:after {
    content: '>';
}

.distribution-slider .swiper-button-prev {
    left: 0;
}

.distribution-slider .swiper-button-next {
    right: 0;
}

@media (max-width: 768px) {
    .distribution-slider {
        padding: 0 50px;
        /* Reduce padding on mobile */
    }

    .distribution-slider .swiper-button-prev {
        left: 5px;
    }

    .distribution-slider .swiper-button-next {
        right: 5px;
    }

    .distribution-slider .swiper-button-prev,
    .distribution-slider .swiper-button-next {
        width: 36px;
        height: 36px;
    }

    .distribution-slider .swiper-button-prev:after,
    .distribution-slider .swiper-button-next:after {
        font-size: 16px;
    }
}

/* Disable hover transform for distribution slider cards */
.distribution-slider .glossy-card:hover {
    transform: none;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================
   Interactive Flow Diagram
   ========================================= */
#flow-trigger {
    position: relative;
    display: inline-block;
    transition: all 0.3s ease;
}

#flow-trigger:hover {
    color: #60a5fa;
    text-shadow: 0 0 10px rgba(96, 165, 250, 0.4);
}

#flow-info-panel {
    overflow: hidden;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

#flow-info-panel.visible {
    opacity: 1;
    max-width: 40%;
    margin-left: 2.5rem;
    padding: 1.5rem;
    transform: translateX(0);
}

#flow-info-panel.hidden-panel {
    opacity: 0;
    max-width: 0;
    margin-left: 0;
    padding: 0;
    transform: translateX(10px);
    pointer-events: none;
    border: none;
}

#flow-info-panel .glossy-card-content {
    min-width: 300px;
    opacity: 0;
    transition: opacity 0.4s ease;
}

#flow-info-panel.visible .glossy-card-content {
    opacity: 1;
    opacity: 1;
    transition-delay: 0.3s;
}

/* =========================================
   Feature Detail Hovers
   ========================================= */
.feature-expand-container {
    position: relative;
    display: inline-block;
    /* Or block depending on layout needs */
    width: 100%;
}

.feature-detail-box {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    margin-top: 0;
    transition: all 0.5s ease;
}

.feature-expand-container:hover .feature-detail-box {
    max-height: 200px;
    /* Adjust as needed */
    opacity: 1;
    margin-top: 1rem;
}

/* =========================================
   Tool Modal
   ========================================= */
.tool-badge {
    cursor: pointer;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(1px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

/* Flow Button Custom Style - Text Gradient */
.btn-flow {
    display: inline-block;
    padding: 0 0.25rem;
    margin-left: 0.25rem;
    font-size: 1em;
    font-weight: 700;
    line-height: 1;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent !important;
    border: none;
    border-radius: 0;
    vertical-align: baseline;
    transition: filter 0.3s ease;
    text-shadow: none;
    cursor: pointer;
}

.btn-flow:hover {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    border: none;
    box-shadow: none;
    transform: none;
    filter: brightness(1.2);
    text-decoration: underline;
    text-decoration-color: #60a5fa;
}

@media (max-width: 768px) {
    #flow-info-panel.visible {
        max-width: 100%;
        margin-left: 0;
        margin-top: 1.5rem;
        width: 100%;
    }
}