/* ========================================================================== */
/* FORCE LAYOUT V2 - CLEAN REWRITE                                            */
/* ========================================================================== */

/* -------------------------------------------------------------------------- */
/* 1. Legal Section (Preserved - Working)                                      */
/* -------------------------------------------------------------------------- */

.legals-container,
.legals-card,
.legals-card[style] {
    display: block !important;
    opacity: 1 !important;
    transform: none !important;
    scale: 1 !important;
    visibility: visible !important;
    position: relative !important;
    z-index: 10 !important;
}

/* Flex centering for the container */
.legals-container {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
}

/* Centered card with max-width */
.legals-card {
    margin-left: auto !important;
    margin-right: auto !important;
    max-width: 1200px !important;
    width: 100% !important;
}

.legals-light-position {
    display: block !important;
    opacity: 1 !important;
}


/* -------------------------------------------------------------------------- */
/* 3. Hero Section (Clean Adaptation)                                         */
/* -------------------------------------------------------------------------- */

.main-wrapper {
    display: block !important;
    width: 100% !important;
    position: relative !important;
    overflow: hidden !important;
}

.pin-spacer {
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    height: auto !important;
    display: block !important;
    position: relative !important;
}

.main-hero-container {
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
    min-height: 100vh !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
    transform: none !important;
    inset: auto !important;
}

.hero {
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding-top: 100px !important;
    padding-bottom: 100px !important;
}

.hero-wrapper {
    max-width: 1400px !important;
    width: 100% !important;
    margin: 0 auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    position: relative !important;
    z-index: 5 !important;
}

.hero-content {
    opacity: 1 !important;
    transform: none !important;
    margin-bottom: 40px !important;
}

.hero-platform {
    transform: scale(1) !important;
    width: 100% !important;
    max-width: 1200px !important;
    margin: 0 auto !important;
}

.left-mirror-position,
.right-mirror-position,
.light-position {
    position: absolute !important;
    pointer-events: none !important;
}

/* Ensure background mirrors stay in place but responsive */
.left-mirror-position {
    left: -10% !important;
    top: 20% !important;
    width: 40% !important;
    z-index: 1 !important;
}

.right-mirror-position {
    right: -10% !important;
    top: 40% !important;
    width: 40% !important;
    z-index: 1 !important;
}

.light-position {
    width: 100% !important;
    height: 100% !important;
    background: radial-gradient(circle at center, rgba(0, 255, 128, 0.1) 0%, transparent 70%) !important;
    z-index: -1 !important;
    top: 0 !important;
    left: 0 !important;
    transform: none !important;
}

/* -------------------------------------------------------------------------- */
/* 2. User-Friendly Interface Section (Grid Fix)                               */
/* Selector Specificity Boosted: html body ...                                */
/* -------------------------------------------------------------------------- */

html body .trusted-platforms-container {
    background-color: #ffffff !important;
    display: block !important;
    padding-top: 60px !important;
    padding-bottom: 60px !important;
    position: relative !important;
    overflow: hidden !important;
}

/* Desktop: Use Grid for robust 2-column layout */
html body .trusted-platforms-card {
    display: grid !important;
    grid-template-columns: 0.8fr 1.2fr !important;
    align-items: center !important;
    justify-content: center !important;
    max-width: 1400px !important;
    margin: 0 auto !important;
    padding: 0 20px !important;
    /* Unified side padding */
    gap: 40px !important;
    width: 100% !important;
    transform: none !important;
    scale: 1 !important;
    opacity: 1 !important;
    visibility: visible !important;
    flex-direction: row !important;
}

html body .trusted-platforms-bg {
    display: flex !important;
    justify-content: center !important;
    position: relative !important;
    width: 100% !important;
    order: 2 !important;
}

html body .trusted-platforms-content {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: center !important;
    padding-left: 0 !important;
    /* Removed 5% indent */
    width: 100% !important;
    order: 1 !important;
}

html body .trusted-platforms-bg img {
    max-height: 650px !important;
    width: auto !important;
    max-width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
}

/* Styling the 3 info cards grid */
/* Styling the 3 info cards grid - SPAN 2 COLUMNS */
html body .trusted-platforms-container .ecosystem-static-grid {
    grid-column: 1 / -1 !important;
    /* Span full width */
    display: grid !important;
    grid-template-columns: repeat(3, 350px) !important;
    /* Fixed width to prevent stretching */
    gap: 24px !important;
    margin: 60px auto 0 !important;
    /* Center grid block */
    max-width: 1400px !important;
    /* Match parent width logic */
    padding: 0 20px !important;
    /* Align with content padding */
    justify-content: space-between !important;
    /* Edge-to-edge alignment */
    align-items: stretch !important;
    width: 100% !important;
    order: 3 !important;
}

html body .trusted-platforms-container .ecosystem-item {
    width: auto !important;
    min-width: 0 !important;
    /* Allow shrinking if needed */
    flex: none !important;
    /* Disable flex overrides */
}

html body .trusted-carousel-item {
    background-color: #F8F9FA !important;
    border-radius: 20px !important;
    padding: 16px 24px !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 16px !important;
    min-height: 100px !important;
    min-width: 240px !important;
}

html body .trusted-carousel-item .iconify {
    width: 42px !important;
    height: 42px !important;
    flex-shrink: 0 !important;
}

/* Text alignment */
html body .trusted-platforms-title-wrapper {
    text-align: left !important;
    margin-bottom: 20px !important;
    padding: 0 !important;
    /* Kill xl:px-2 */
    margin-left: 0 !important;
    width: 100% !important;
}

html body .trusted-platforms-title-wrapper h4 {
    text-align: left !important;
    font-size: 48px !important;
    line-height: 1.1 !important;
    margin-bottom: 20px !important;
    padding: 0 !important;
    /* Kill xl:px-2 */
    margin-left: 0 !important;
    max-width: 100% !important;
    /* Override max-w-sm */
}

html body .trusted-platforms-title-wrapper .flex {
    justify-content: flex-start !important;
}

/* Heart Icon Color */
html body .trusted-platforms-title-wrapper .iconify {
    color: #FF4B55 !important;
}

/* Pill Styling */
html body .trusted-platforms-title-wrapper div[class*="rounded-[38px]"] {
    background-color: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03) !important;
}

/* Mobile Responsiveness */
@media (max-width: 900px) {
    html body .trusted-platforms-card {
        display: flex !important;
        flex-direction: column-reverse !important;
        /* Stack: Content bottom, Image top? No, usually Image top is column. Wait, column-reverse puts last item first. Grid order 2 is image. So Image Top. */
        /* Let's be explicit with order */
        text-align: center !important;
        gap: 40px !important;
        grid-template-columns: 1fr !important;
    }

    html body .trusted-platforms-bg {
        order: 1 !important;
        /* Image on top */
        width: 100% !important;
    }

    html body .trusted-platforms-content {
        order: 2 !important;
        /* Content below */
        align-items: center !important;
        padding-left: 20px !important;
        padding-right: 20px !important;
        width: 100% !important;
    }

    html body .trusted-platforms-title-wrapper,
    html body .trusted-platforms-title-wrapper h4 {
        text-align: center !important;
    }

    html body .trusted-platforms-title-wrapper .flex {
        justify-content: center !important;
    }

    html body .trusted-platforms-container .ecosystem-static-grid {
        justify-content: center !important;
        grid-template-columns: 1fr !important;
        /* Stack vertically on mobile */
        padding: 0 20px !important;
    }
}


/* -------------------------------------------------------------------------- */
/* 3. Original Global Overrides (Restored cautiously)                          */
/* -------------------------------------------------------------------------- */

/* Force Full Width on Parents (ONLY Ecosystem and Knowledge) */
.ecosystem-container,
.ecosystem-card-timeline,
.ecosystem-content,
.ecosystem-mobile-window,
.knowledge-slider,
.knowledge-slider-content {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* -------------------------------------------------------------------------- */
/* 4. Ecosystem & Knowledge Carousel Restoration                              */
/* -------------------------------------------------------------------------- */

/* Force Horizontal Layout for Ecosystem Timeline */
html body .ecosystem-card-timeline,
html body .ecosystem-content {
    display: flex !important;
    flex-direction: row !important;
    overflow-x: auto !important;
    /* Allow scrolling if too wide */
    overflow-y: hidden !important;
    width: 100% !important;
}

/* Ensure the static grid (used in Ecosystem) is horizontal and centered/reset */
html body .ecosystem-mobile-window .ecosystem-static-grid {
    display: flex !important;
    flex-direction: row !important;
    gap: 24px !important;
    width: max-content !important;
    padding-bottom: 20px !important;
    margin-left: 0 !important;
    /* Fix the 580px shift */
    margin-right: 0 !important;
}

/* Hardcode missing background images for Ecosystem Timeline Cards */
.ecosystem-timeline-card {
    background-size: contain !important;
    /* Changed from cover to contain to fit image */
    background-position: center bottom !important;
    background-repeat: no-repeat !important;
    min-height: 280px !important;
    /* Reduced height */
    height: 100% !important;
    flex-shrink: 0 !important;
    width: 100% !important;
    /* Fixed: was 420px causing overlap */
    border-radius: 24px !important;
}

/* Specific images as they are not being compiled by Tailwind anymore */
.bg-\[url\(\.\/images\/png\/ecosystem-1\.png\)\],
div[style*="ecosystem-1.png"] {
    background-image: url("./images/png/ecosystem-1.png") !important;
}

.bg-\[url\(\.\/images\/png\/ecosystem-2\.png\)\],
div[style*="ecosystem-2.png"] {
    background-image: url("./images/png/ecosystem-2.png") !important;
}

.bg-\[url\(\.\/images\/png\/ecosystem-3\.png\)\],
div[style*="ecosystem-3.png"] {
    background-image: url("./images/png/ecosystem-3.png") !important;
}

.bg-\[url\(\.\/images\/png\/ecosystem-4\.png\)\],
div[style*="ecosystem-4.png"] {
    background-image: url("./images/png/ecosystem-4.png") !important;
}

/* Knowledge Carousel Restoration */
html body .knowledge-slider {
    width: 100% !important;
    overflow-x: hidden !important;
    position: relative !important;
}

html body .knowledge-slider-content {
    display: flex !important;
    flex-direction: row !important;
    width: 100% !important;
}

/* Ensure knowledge cards inside the slider are horizontal */
html body .knowledge-slider-content .ecosystem-static-grid {
    display: flex !important;
    flex-direction: row !important;
    gap: 16px !important;
    width: max-content !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Style for individual cards in timeline and slider */
html body .knowledge-container div[btn-text="Read"] {
    flex-shrink: 0 !important;
    width: 380px !important;
    max-width: 90vw !important;
    min-height: 264px !important;
}

/* Hide scrollbars for a cleaner look while maintaining functionality */
html body .ecosystem-content::-webkit-scrollbar {
    display: none !important;
}

html body .ecosystem-content {
    -ms-overflow-style: none !important;
    scrollbar-width: none !important;
}

/* Swiper Fixes */
swiper-container.ecosystem-static-grid {
    display: block !important;
    grid-template-columns: none !important;
}

swiper-slide.w-full {
    height: auto !important;
}

swiper-slide.ecosystem-item {
    width: auto !important;
}

/* FIX: Ensure Swiper Container takes full width (for Trusted and Knowledge) */
swiper-container {
    width: 100% !important;
    display: block !important;
}

/* Center the layout for Ecosystem static grid (Desktop: 'All Crypto' block) */
/* Center the layout for Ecosystem static grid (Desktop: 'All Crypto' block) */
html body .ecosystem-mobile-window .ecosystem-static-grid {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    align-items: stretch !important;
    gap: 24px !important;
    width: 100% !important;
    max-width: 1400px !important;
    margin: 0 auto !important;
    padding-bottom: 20px !important;
    transform: none !important;
}

/* Ensure individual cards respect the width percentages from index.php */
html body .ecosystem-mobile-window .ecosystem-static-grid>div {
    flex-shrink: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    /* Mobile default */
}

@media (min-width: 768px) {
    html body .ecosystem-mobile-window .ecosystem-static-grid>div {
        width: calc(50% - 12px) !important;
        /* 2 per row on tablet */
    }
}

@media (min-width: 1200px) {
    html body .ecosystem-mobile-window .ecosystem-static-grid>div {
        width: calc(25% - 18px) !important;
        /* 4 per row on desktop */
    }
}

html body .ecosystem-card-timeline,
html body .ecosystem-content-title {
    max-width: 1400px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
    width: 100% !important;
}

/* RESET ecosystem-content: Remove the horizontal scroll force that breaks the static grid */
html body .ecosystem-content {
    display: block !important;
    /* Allow normal block flow so grid can wrap */
    overflow-x: visible !important;
    /* No scroll */
    width: 100% !important;
}

/* Ensure the container itself allows this centering */
html body .ecosystem-container {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    width: 100% !important;
}

/* Fix Knowledge Base Swiper Container width in flex parent */
html body .knowledge-slider-content {
    display: block !important;
    width: 100% !important;
    max-width: 1400px !important;
    margin: 0 auto !important;
}

/* Ensure Knowledge Swiper sits correctly */
html body .knowledge-swiper {
    width: 100% !important;
    margin: 0 auto !important;
}

/* CRITICAL: Force Knowledge Slides to NOT overlap by preventing width: 100% */
html body .knowledge-swiper swiper-slide {
    width: auto !important;
    max-width: none !important;
}