/*=============================================
=            1. FOUNDATIONAL STYLES           =
=============================================*/

/* --- Root Variables & Base Styles --- */
:root {
    --primary-color: #8B5CF6;
    --accent-color: #06B6D4;
    --secondary-color: #3B82F6;
    --bg-dark: #0F0F23;
    --bg-card: rgba(255, 255, 255, 0.05);
    --text-primary: #FFFFFF;
    --text-secondary: #A0A0B0;
    --gradient: linear-gradient(135deg, var(--primary-color), var(--accent-color), var(--secondary-color));
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    overflow-x: hidden;
    font-display: swap;
}

/* --- Browser & Accessibility --- */
::selection {
    background: var(--accent-color);
    color: white;
}
::-moz-selection {
    background: var(--accent-color);
    color: white;
}

button:focus, a:focus, input:focus, select:focus, textarea:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/*=============================================
=            2. LAYOUT & STRUCTURE            =
=============================================*/

/* --- Navbar --- */
.navbar {
    position: absolute;
    top: 0;
    width: 100%;
    transition: transform 0.3s ease-in-out;
    padding: 20px 0;
    background: rgba(15, 15, 35, 0.8);
    backdrop-filter: blur(10px);
    z-index: 10;
}
.navbar-hidden {
    transform: translateY(-100%);
}
.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

/* --- Hero Section --- */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    text-align: center;
    padding-top: 150px;
    overflow: hidden;
}
.hero-background, .gradient-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: -2;
}
.hero-background {
    background: url('../assets/images/hero-bg.jpg') center/cover;
}
.gradient-overlay {
    background: var(--gradient);
    opacity: 0.3;
    z-index: -1;
}
.hero-content {
    max-width: 800px;
    z-index: 1;
    padding: 0 20px;
}
.hero-bottom-content {
    width: 100%;
    z-index: 5;
}

/* --- Content Sections --- */
.carousel-section {
    padding-top: 30px;
    padding-bottom: 20px;
    margin-bottom: 20px;
    margin-top: 20px;
}
.content-section {
    padding: 20px 0px;
    max-width: 900px;
    margin: 0 auto;
}
.featured-section {
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    text-align: center;
}

/* Meme carousel background overlay */
#memeCarouselTrack {
    background: rgba(15, 15, 35, 0.3); /* 30% opacity dark overlay */
    border-radius: 15px; /* rounded edges */
    padding: 0 0; /* vertical spacing inside the wrapper */
}

.meme-carousel-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    padding: 0 20px;
}

/* --- Inner Page Layout --- */
.page-hero {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 40vh;
    min-height: 300px;
    z-index: 1;
}
.page-hero .hero-background, .page-hero .gradient-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
}
.page-main-content {
    padding-top: 110px;
    max-width: 900px;
    margin: 0 auto 50px auto;
    position: relative;
    z-index: 2;
}

/* --- Footer --- */
.footer {
    padding: 5px 20px 5px;
    text-align: center;
    background: #0F0F23;
}
.page-main-content + .footer {
    padding: 30px 20px 10px;
}

/*=============================================
=            3. COMPONENT STYLES              =
=============================================*/

/* --- Typography & Text --- */
.hero-title {
    font-size: clamp(2.2rem, 5vw + 1rem, 4rem);
    margin-bottom: 20px;
    font-weight: 800;
}
.hero-subtitle {
    font-size: clamp(1.1rem, 2vw + 0.5rem, 1.5rem);
    margin-bottom: 20px;
    color: var(--text-secondary);
}
.hero-description {
    font-size: 1.1rem;
    margin-bottom: 20px;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto 20px auto;
}
.page-title {
    font-size: clamp(2rem, 4vw + 1rem, 3rem);
    text-align: center;
    padding: 0 20px 20px;
}
.gradient-text {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.footer-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
}
#dynamic-text {
    transition: opacity 0.5s ease-in-out;
}
.section-title {
    font-size: 0.8re;
    text-align: center;
    margin-bottom: 30px;
}
.featured-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 25px;
}

/* --- Navigation & Links --- */
.nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-primary);
    text-decoration: none;
}
.nav-links a {
    color: var(--text-primary);
    text-decoration: none;
    margin-left: 30px;
    transition: color 0.3s;
}
.nav-links a:hover {
    color: var(--accent-color);
}
.social-links {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.social-links a {
    color: var(--text-primary);
    font-size: 1.8rem;
    transition: all 0.3s ease;
}
.social-links a:hover {
    color: var(--accent-color);
    transform: translateY(-2px);
}

/* --- Mobile Navigation --- */
.desktop-only { display: flex; }
.mobile-only { display: none; }
.mobile-drawer {
    position: fixed;
    top: 0; right: -100%;
    width: 70%; height: 100%;
    background: #111; color: #fff;
    transition: right 0.3s ease;
    padding: 2rem;
    z-index: 999;
}
.mobile-drawer.open { right: 0; }
.drawer-close { background: none; border: none; font-size: 1.5rem; color: #fff; }
.mobile-drawer .drawer-links {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 2rem;
}
.mobile-drawer .drawer-links a {
    display: block;
    padding: 18px 25px;
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    transition: background-color 0.2s ease, transform 0.2s ease;
}
.mobile-drawer .drawer-links a:active {
    background-color: rgba(255, 255, 255, 0.15);
    transform: scale(0.98);
}

/* --- Buttons --- */
.cta-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}
.btn-primary, .btn-secondary {
    padding: 15px 30px;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 200px;
}
.btn-primary {
    background: var(--gradient);
    color: white;
}
.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.btn-primary:hover, .btn-secondary:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4);
}

/* --- Cards & Content Blocks --- */
.token-stats {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin: 25px auto 35px auto;
    width: 100%;
    max-width: 650px;
    padding: 15px;
    border-radius: 20px;
    background: var(--bg-card);
    backdrop-filter: blur(10px);
}
.stats-group {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
}
.stat-card {
    background: var(--bg-card);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease;
    flex-grow: 1;
    text-align: center;
}
.stat-card:hover {
    transform: translateY(-2px);
}
.stat-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 600;
    text-transform: uppercase;
}
.stat-value {
    font-size: 1.3rem;
    font-weight: bold;
    font-family: 'Courier New', monospace;
}
.price-up { color: #10B981 !important; }
.price-down { color: #EF4444 !important; }

.page-content-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    line-height: 1.7;
}

.page-content-card h1, 
.page-content-card h2, 
.page-content-card h3,
.page-content-card b,
.page-content-card strong {
    color: var(--text-primary);
}
.page-content-card h1, .page-content-card h2, .page-content-card h3 { margin-bottom: 15px; }
.page-content-card ul, .page-content-card ol { margin-left: 20px; margin-bottom: 15px; }
.page-content-card a { color: var(--accent-color); text-decoration: none; }
.page-content-card a:hover { text-decoration: underline; }

/* --- Images & Logos --- */
.nav-logo-img, .footer-logo img {
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.1);
}
.nav-logo-img {
    height: 35px;
    display: none;
}
.footer-logo {
    margin-bottom: 25px;
}
.footer-logo img {
    max-height: 50px;
}
.featured-logos {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 40px;
}
.featured-logos img {
    max-height: 40px;
    max-width: 150px;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}
.featured-logos img:hover {
    opacity: 1;
}

/* --- Carousels --- */
@keyframes infiniteScroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}
.scrolling {
    animation: infiniteScroll var(--scroll-duration, 60s) linear infinite;
}
.hero-carousel-wrapper {
    width: 100%;
    overflow-x: scroll;
    cursor: grab;
    padding: 0 20px;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.hero-carousel-wrapper::-webkit-scrollbar {
    display: none;
}
.hero-carousel-track {
    display: flex;
    gap: 20px;
    width: fit-content;
}
.carousel-item {
    width: 250px;
    height: 200px;
    flex-shrink: 0;
    background: var(--bg-card);
    border-radius: 25px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.meme-carousel-track {
    display: flex;
    gap: 20px;
    width: 100%;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scrollbar-width: none; /* For Firefox */
    -ms-overflow-style: none; /* For Internet Explorer and Edge */
}

.meme-carousel-track::-webkit-scrollbar {
    display: none; /* For Chrome, Safari, and Opera */
}

.meme-item {
    width: 220px;
    height: 200px;
    flex-shrink: 0;
    background: var(--bg-card);
    border-radius: 25px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    scroll-snap-align: start; /* Keep this for swipe snapping */
}

.meme-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}


/*=============================================
=            4. RESPONSIVE STYLES             =
=============================================*/

@media (max-width: 1199px) {
    .desktop-only { display: none; }
    .mobile-only { display: block; }
}

@media (min-width: 767px) {
    .hero {
        padding-top: 100px;
    }
    .hero-description {
        font-size: 0.9rem;
    }
    .cta-buttons {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    .btn-primary, .btn-secondary {
        width: 100%;
        max-width: 300px;
    }
    .carousel-item {
        width: 250px;
        height: 200px;
    }
}

@media (max-width: 767px) {
    .hero {
        padding-top: 100px;
    }
    .hero-description {
        font-size: 0.9rem;
    }
    .cta-buttons {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    .btn-primary, .btn-secondary {
        width: 100%;
        max-width: 300px;
    }
    .carousel-item {
        width: 250px;
        height: 200px;
    }
}

@media (max-width: 479px) {
    .carousel-item {
        width: 250px;
        height: 200px;
    }
    .stat-value {
        font-size: 1.1rem;
    }
}

/* Replace your old #memes rule with this one */
#memes {
    position: relative; /* This is the anchor for our new background layer */
    background: transparent;
    padding: 0 0px;
    padding-bottom: 20px;
    z-index: 1; /* Keeps the carousel content on top */
}

#memes::before {
    content: '';
    position: absolute;
    z-index: -1; /* Puts this layer behind the carousel content */
    top: 50%;    /* Starts the background halfway down the #memes section */
    left: 0;
    width: 100%;
    height: 150vh; /* Makes the background extra tall to cover the page */
    background: var(--bg-dark);
}

#memes .container {
    max-width: 100%;
    padding: 0;
    margin: 0;
}

#description {
    width: 100%;           /* full width of the screen */
    max-width: 100%;       /* remove the 900px max-width */
    margin: 0;             /* remove auto centering */
    padding: 20px;         /* 20px space on left and right */
    box-sizing: border-box;
    background-color: #0a0a18;
    color: var(--text-primary);
}

/* Optional: if you want the inner text elements to also respect padding */
#description > * {
    padding: 15px;
    width: 100%;
    box-sizing: border-box;
}

#memeCarouselWrapper {
    position: relative; /* needed for z-index */
    z-index: 0;         /* sits above background but below hero content */
}

/* --- Carousel Buttons --- */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.carousel-btn:hover {
    background: var(--accent-color);
    transform: translateY(-50%) scale(1.1);
}

.carousel-btn.prev {
    left: -10px;
    margin-left: 5px;
    padding-left: 5px;
}

.carousel-btn.next {
    right: -10px;
    margin-right: 5px;
    padding-left: 5px;
}

@media (max-width: 767px) {
    .carousel-btn.prev {
        left: 5px;
    }
    .carousel-btn.next {
        right: 5px;
    }
}

.heroCarouselTrack {
    background-color: rgba(255, 255, 255, 0);
}

@keyframes infiniteScroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

.scrolling {
    animation: infiniteScroll var(--scroll-duration, 60s) linear infinite;
}

.hero-carousel-track {
    display: flex;
    gap: 20px;
    width: fit-content;
}

.carousel-item {
    width: 250px;
    height: 200px;
    flex-shrink: 0;
    background: var(--bg-card);
    border-radius: 25px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- NEW: Reversing Carousel Animation --- */
@keyframes reverseScroll {
    0% {
        transform: translateX(0);
    }
    100% {
        /* Use a variable for the dynamic scroll distance */
        transform: translateX(var(--scroll-distance));
    }
}

.scrolling-alt {
    /* - alternate: reverses the animation direction on each cycle (forward, then back)
      - infinite: repeats the animation forever
      - ease-in-out: makes the start and end of the scroll smoother
    */
    animation: reverseScroll var(--scroll-duration-alt, 30s) ease-in-out infinite alternate;
}