/* --- GLOBAL VARIABLES & BASE STYLES --- */
:root {
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --secondary: #06b6d4;
    --secondary-light: #22d3ee;
    --dark: #0f172a;
    --dark-light: #1e293b;
    --dark-lighter: #334155;
    --light: #f8fafc;
    --gray: #94a3b8;
    --gray-light: #cbd5e1;
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.2), 0 8px 10px -6px rgb(0 0 0 / 0.2);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--dark);
    color: var(--light);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- DYNAMIC TECH BACKGROUND --- */
#tech-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

/* --- CUSTOM SCROLLBAR --- */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--dark);
}

::-webkit-scrollbar-thumb {
    background: var(--dark-lighter);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* --- HEADER & NAVIGATION --- */
header {
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease-in-out;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo img {
    border-radius: 12px;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.logo img:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 0 20px var(--primary-light);
}

.logo-text {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--light);
    text-shadow: 0 0 5px rgba(129, 140, 248, 0.8), 0 0 10px rgba(79, 70, 229, 0.6);
    letter-spacing: 1px;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--light);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background 0.3s ease;
}

nav ul {
    display: flex;
    gap: 2rem;
    list-style: none;
}

nav a {
    color: var(--gray);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    padding: 0.75rem 0;
    font-size: 0.95rem;
}

nav a:hover {
    color: var(--light);
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    transition: width 0.3s ease;
}

nav a:hover::after {
    width: 100%;
}

/* --- HERO SECTION --- */
.hero {
    padding: 5rem 1.5rem 7rem;
    text-align: center;
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background-color: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: var(--primary-light);
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    animation: slide-in-fwd 0.8s cubic-bezier(0.250, 0.460, 0.450, 0.940) both;
}

.hero-badge .pulse-dot {
    width: 8px;
    height: 8px;
    background-color: var(--secondary-light);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--secondary-light), 0 0 20px var(--secondary);
    animation: pulse-dot-animation 1.5s infinite ease-in-out;
}

@keyframes pulse-dot-animation {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.5);
        opacity: 0.7;
    }
}

.hero h1 {
    font-size: clamp(2.8rem, 8vw, 4.5rem);
    font-weight: 800;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--light) 0%, var(--gray-light) 50%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.1;
    text-shadow: 0 0 40px rgba(99, 102, 241, 0.5);
    animation: slide-in-fwd 0.8s cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.2s both;
}

.hero p {
    font-size: clamp(1rem, 3vw, 1.25rem);
    color: var(--gray);
    margin-bottom: 3rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    animation: slide-in-fwd 0.8s cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.4s both;
}

/* --- BUTTONS & TERMINAL --- */
.btn-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 4rem;
    flex-wrap: wrap;
    animation: slide-in-fwd 0.8s cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.6s both;
}

.btn {
    padding: 0.875rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    position: relative;
    overflow: hidden;
    border: 1px solid transparent;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3), inset 0 2px 0 rgba(255, 255, 255, 0.1);
}

.btn-primary:hover {
    transform: translateY(-3px);
    background: var(--primary-light);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5);
}

.btn-secondary {
    background: rgba(30, 41, 59, 0.5);
    color: var(--light);
    border: 1px solid var(--dark-lighter);
}

.btn-secondary:hover {
    background: var(--dark-light);
    border-color: var(--primary);
    transform: translateY(-3px);
}

.terminal {
    background: rgba(30, 41, 59, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    margin: 2rem auto 0;
    max-width: min(800px, 100%);
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: slide-in-fwd 0.8s cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.8s both;
    position: relative;
    transition: transform 0.3s ease;
}

.terminal:hover {
    transform: scale(1.02);
}

.terminal-header {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.terminal-dots {
    display: flex;
    gap: 0.5rem;
}

.terminal-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.terminal-title {
    margin-left: auto;
    font-size: 0.85rem;
    color: var(--gray);
    font-family: 'JetBrains Mono', monospace;
}

.terminal-content {
    padding: 1.5rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(0.8rem, 2.5vw, 0.9rem);
    text-align: left;
}

.terminal-content .prompt {
    color: var(--gray);
    margin-right: 0.5rem;
}

.terminal-content .command {
    color: var(--secondary-light);
}

.terminal-content .comment {
    color: var(--gray);
    font-style: italic;
}

/* --- FEATURES SECTION --- */
.features {
    padding: 7rem 1.5rem;
}

.section-title {
    text-align: center;
    margin-bottom: 4rem;
    font-size: clamp(2rem, 5vw, 2.8rem);
    font-weight: 800;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -0.75rem;
    left: 50%;
    transform: translateX(-50%);
    width: 70px;
    height: 4px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 2px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.feature-card {
    background: rgba(30, 41, 59, 0.5);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 20px;
    padding: 2.5rem 2rem;
    transition: all 0.4s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(50px);
}

.feature-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-xl);
    border-color: rgba(99, 102, 241, 0.5);
}

.feature-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    transition: transform 0.3s ease;
    box-shadow: 0 0 15px -5px currentColor;
}

.feature-icon.ai {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.15), rgba(34, 211, 238, 0.25));
    color: var(--secondary);
}

.feature-icon.web3 {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(129, 140, 248, 0.25));
    color: var(--primary-light);
}

.feature-icon.opensource {
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.15), rgba(203, 213, 225, 0.25));
    color: var(--light);
}

.feature-card h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.feature-card p {
    color: var(--gray);
}

/* --- CHARTS SECTION --- */
.charts {
    padding: 6rem 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.search-container {
    max-width: 800px;
    margin: 0 auto 3rem;
    position: relative;
}

.search-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--gray);
    pointer-events: none;
}

#chart-search {
    width: 100%;
    padding: 1rem 1.5rem 1rem 3.25rem;
    background-color: var(--dark-light);
    border: 1px solid var(--dark-lighter);
    border-radius: 12px;
    color: var(--light);
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
}

#chart-search:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.3);
}

#charts-list-container {
    display: grid;
    gap: 1.5rem;
}

.chart-item {
    background: linear-gradient(145deg, var(--dark-light) 0%, var(--dark-lighter) 100%);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    overflow: hidden;
    opacity: 0;
    transform: scale(0.95);
}

.chart-item.visible {
    opacity: 1;
    transform: scale(1);
}

.chart-item-header {
    padding: 1.5rem;
    cursor: pointer;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 1rem;
}

.chart-item.active .chart-item-header {
    background-color: rgba(99, 102, 241, 0.08);
}

.chart-version-badge {
    font-family: 'JetBrains Mono', monospace;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.3rem 0.6rem;
    border-radius: 8px;
}

/* --- CUSTOM VERSION DROPDOWN --- */
.details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.custom-select-wrapper {
    position: relative;
    width: 200px;
}

.custom-select-trigger {
    background-color: var(--dark-lighter);
    color: var(--light);
    border: 1px solid var(--dark-lighter);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.custom-select-trigger:hover,
.custom-select-wrapper.open .custom-select-trigger {
    border-color: var(--primary);
}

.custom-select-trigger::after {
    content: '▾';
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.custom-select-wrapper.open .custom-select-trigger::after {
    transform: rotate(180deg);
}

.custom-select-options {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background: var(--dark-light);
    border: 1px solid var(--dark-lighter);
    border-radius: 8px;
    z-index: 10;
    max-height: 200px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}

.custom-select-wrapper.open .custom-select-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.custom-select-option {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.custom-select-option:hover {
    background-color: rgba(99, 102, 241, 0.1);
}

.custom-select-option.selected {
    background-color: rgba(99, 102, 241, 0.2);
    font-weight: 600;
}

/* --- CHART DETAILS LAYOUT --- */
.details-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.details-grid-3-col {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.detail-card {
    background: rgba(15, 23, 42, 0.7);
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid var(--dark-lighter);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.detail-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--gray);
}

.detail-card-icon svg {
    width: 16px;
    height: 16px;
}

.detail-card-header strong {
    font-weight: 500;
    font-size: 0.9rem;
}

.detail-card-content {
    color: var(--light);
    word-break: break-all;
    font-size: 0.95rem;
    padding-left: 1.75rem;
}

.detail-card-content a {
    color: var(--secondary-light);
    text-decoration: none;
    transition: color 0.2s;
}

.detail-card-content a:hover {
    color: var(--light);
    text-decoration: underline;
}

.keywords-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
}

.keywords-list li {
    background: var(--dark-lighter);
    color: var(--gray-light);
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-family: 'JetBrains Mono', monospace;
}

.chart-details {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.5s ease-in-out;
}

.chart-item.active .chart-details {
    grid-template-rows: 1fr;
}

.chart-details>div {
    overflow: hidden;
}

.details-content {
    padding: 2rem 1.5rem;
    border-top: 1px solid rgba(99, 102, 241, 0.2);
}

/* --- HELM INSTALL BLOCK FIXES --- */
.helm-install-block {
    margin-top: 2rem;
    background: #0a1122;
    border-radius: 16px;
    border: 1px solid var(--dark-lighter);
    overflow: hidden;
}

.helm-install-block .terminal-header {
    padding: 0.5rem 1rem;
    margin-bottom: 0;
    position: relative;
}

.helm-install-block .terminal-content {
    padding: 1.25rem;
}

.helm-install-block code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.8;
}

.copy-btn {
    position: absolute;
    top: 50%;
    right: 0.75rem;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--light);
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.copy-btn svg {
    width: 14px;
    height: 14px;
}

.copy-btn:hover {
    background: var(--primary);
}

#charts-list-container.no-results {
    text-align: center;
    color: var(--gray);
    padding: 3rem;
    font-size: 1.2rem;
}

.loader {
    width: 50px;
    aspect-ratio: 1;
    border-radius: 50%;
    border: 8px solid var(--dark-lighter);
    border-right-color: var(--primary);
    animation: l2 1s infinite linear;
    margin: 4rem auto;
}

@keyframes l2 {
    to {
        transform: rotate(1turn)
    }
}

/* --- FOOTER & MEDIA QUERIES --- */
footer {
    background: var(--dark-light);
    padding: 4rem 1.5rem 2rem;
    text-align: center;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-logo {
    margin-bottom: 2rem;
    opacity: 0.8;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--gray);
    text-decoration: none;
    transition: all 0.3s ease;
}

.footer-links a:hover {
    color: var(--light);
}

.copyright {
    color: var(--gray);
    font-size: 0.9rem;
}

@keyframes slide-in-fwd {
    0% {
        transform: translateZ(-1400px) translateY(100px);
        opacity: 0;
    }

    100% {
        transform: translateZ(0) translateY(0);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }

    nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(15, 23, 42, 0.98);
        padding: 1rem;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    nav.active {
        display: block;
    }

    nav ul {
        flex-direction: column;
        gap: 1rem;
    }

    nav a {
        display: block;
        padding: 1rem;
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.05);
    }

    .details-grid-3-col {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}