/* ═══════════════════════════════════════════════════════════
   AlpaRodh (अल्परोध) — Dashboard Design System
   AI-Driven Variable Resistance Reduction
   ═══════════════════════════════════════════════════════════ */

/* ─── Design Tokens ────────────────────────────────────────── */
:root {
    /* Colors */
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-card: rgba(17, 24, 39, 0.7);
    --bg-glass: rgba(255, 255, 255, 0.04);
    --border-glass: rgba(255, 255, 255, 0.08);
    
    --cyan: #00f5d4;
    --cyan-glow: rgba(0, 245, 212, 0.15);
    --amber: #ffd166;
    --amber-glow: rgba(255, 209, 102, 0.15);
    --coral: #ef476f;
    --coral-glow: rgba(239, 71, 111, 0.15);
    --emerald: #06d6a0;
    --purple: #a78bfa;
    
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* Typography */
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-heading: 'Outfit', 'Inter', sans-serif;
    
    /* Spacing */
    --section-padding: 6rem 2rem;
    --card-padding: 2rem;
    --border-radius: 16px;
    --border-radius-sm: 10px;
    
    /* Effects */
    --glass-blur: blur(20px);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.4);
    --shadow-glow-cyan: 0 0 30px rgba(0, 245, 212, 0.1);
}

/* ─── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ─── HERO SECTION ─────────────────────────────────────────── */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    text-align: center;
    padding: 2rem;
    background: url('supercomputer_bg.png') no-repeat center center;
    background-size: cover;
}

.hero-bg-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0, 245, 212, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 245, 212, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    animation: gridPulse 8s ease-in-out infinite;
    z-index: 1;
}

.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(10, 14, 26, 0.8), rgba(10, 14, 26, 1));
    z-index: 0;
}

@keyframes gridPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        ellipse at 30% 50%,
        rgba(0, 245, 212, 0.08) 0%,
        transparent 50%
    ),
    radial-gradient(
        ellipse at 70% 50%,
        rgba(239, 71, 111, 0.06) 0%,
        transparent 50%
    );
    animation: heroGradient 12s ease-in-out infinite alternate;
}

@keyframes heroGradient {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(-5%, 5%) rotate(3deg); }
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-badge {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    border: 1px solid var(--cyan);
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 3px;
    color: var(--cyan);
    text-transform: uppercase;
    margin-bottom: 2rem;
    animation: fadeInUp 0.8s ease-out;
}

.hero-title {
    font-family: var(--font-heading);
    margin-bottom: 0.5rem;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.hindi-text {
    display: block;
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 800;
    background: linear-gradient(135deg, var(--cyan), var(--amber));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
}

.latin-text {
    display: block;
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 400;
    color: var(--text-secondary);
    letter-spacing: 6px;
    text-transform: uppercase;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--amber);
    font-weight: 300;
    font-style: italic;
    margin-bottom: 1rem;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.hero-tagline {
    font-size: 1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 2rem;
    animation: fadeInUp 0.8s ease-out 0.5s both;
}

.hero-chips {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

.chip {
    padding: 0.4rem 1rem;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 500;
}

.chip-cyan { background: var(--cyan-glow); color: var(--cyan); border: 1px solid rgba(0, 245, 212, 0.3); }
.chip-amber { background: var(--amber-glow); color: var(--amber); border: 1px solid rgba(255, 209, 102, 0.3); }
.chip-coral { background: var(--coral-glow); color: var(--coral); border: 1px solid rgba(239, 71, 111, 0.3); }

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    animation: bounce 2s infinite;
}

.scroll-arrow {
    width: 20px;
    height: 20px;
    border-right: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted);
    transform: rotate(45deg);
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(10px); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ─── SECTIONS ─────────────────────────────────────────────── */
.section {
    padding: var(--section-padding);
    max-width: 1300px;
    margin: 0 auto;
}

.section-dark {
    background: var(--bg-secondary);
    max-width: 100%;
    padding-left: 2rem;
    padding-right: 2rem;
}

.section-dark > * {
    max-width: 1300px;
    margin-left: auto;
    margin-right: auto;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--text-primary), var(--cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-desc {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 3rem;
    max-width: 650px;
}

/* ─── GLASS CARDS ──────────────────────────────────────────── */
.glass-card {
    background: var(--bg-glass);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-glass);
    border-radius: var(--border-radius);
    padding: var(--card-padding);
    transition: var(--transition);
}

.glass-card:hover {
    border-color: rgba(0, 245, 212, 0.2);
    box-shadow: var(--shadow-glow-cyan);
    transform: translateY(-4px);
}

/* ─── OVERVIEW CARDS ───────────────────────────────────────── */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.card {
    text-align: center;
}

.card-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.card-value {
    font-family: var(--font-heading);
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--cyan);
    line-height: 1;
}

.card-unit {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.3rem;
}

.card-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 0.75rem;
    font-weight: 500;
}

/* ─── ENERGY CHART ─────────────────────────────────────────── */
.chart-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    align-items: start;
}

.chart-wrapper {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--border-radius);
    padding: 2rem;
    min-height: 350px;
}

.chart-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.strategy-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--border-radius-sm);
    padding: 1.25rem;
    transition: var(--transition);
}

.strategy-card:hover {
    border-color: rgba(0, 245, 212, 0.2);
}

.strategy-card h3 {
    font-family: var(--font-heading);
    font-size: 1rem;
    margin-bottom: 0.4rem;
}

.strategy-card p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.strategy-stat {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--emerald);
}

/* ─── AI SECTION ───────────────────────────────────────────── */
.ai-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.ai-card h3 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    margin-bottom: 0.25rem;
}

.ai-model-type {
    font-size: 0.85rem;
    color: var(--purple);
    font-weight: 500;
    margin-bottom: 1.5rem;
}

.ai-metrics {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ai-metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border-glass);
}

.ai-metric:last-child {
    border-bottom: none;
}

.ai-metric-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.ai-metric-value {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--cyan);
}

.chart-wrapper-sm {
    min-height: 220px;
    position: relative;
}

/* ─── PARAM MAPPING ────────────────────────────────────────── */
.param-grid {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.param-card {
    flex: 1;
    min-width: 280px;
    max-width: 400px;
    text-align: center;
}

.param-card h3 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.param-spec {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.3rem;
}

.param-energy {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--amber);
    margin-top: 1rem;
}

.param-target {
    border-color: rgba(0, 245, 212, 0.3);
    box-shadow: var(--shadow-glow-cyan);
}

.param-target .param-energy {
    color: var(--cyan);
}

.param-arrow {
    font-size: 2.5rem;
    color: var(--text-muted);
    animation: arrowPulse 2s ease-in-out infinite;
}

@keyframes arrowPulse {
    0%, 100% { opacity: 0.4; transform: translateX(0); }
    50% { opacity: 1; transform: translateX(8px); }
}

.india-impact-box {
    text-align: center;
    padding: 2rem;
    border-color: rgba(239, 71, 111, 0.3);
    max-width: 700px;
    margin: 0 auto;
}

.india-impact-box h3 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.india-impact-box p {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.india-impact-box strong {
    color: var(--coral);
    font-family: var(--font-heading);
    font-size: 1.2rem;
}

/* ─── CARBON SECTION ───────────────────────────────────────── */
.carbon-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1.5rem;
}

.carbon-chart-card h3,
.carbon-equiv-card h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.equiv-items {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.equiv-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.equiv-icon {
    font-size: 2rem;
}

.equiv-value {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--emerald);
}

.equiv-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* ─── MULTILINGUAL ─────────────────────────────────────────── */
.lang-selector {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.lang-btn {
    padding: 0.6rem 1.5rem;
    border: 1px solid var(--border-glass);
    border-radius: 100px;
    background: var(--bg-glass);
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.lang-btn:hover {
    border-color: var(--cyan);
    color: var(--cyan);
}

.lang-btn.active {
    background: var(--cyan);
    color: var(--bg-primary);
    font-weight: 600;
    border-color: var(--cyan);
}

.explain-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.25rem;
}

.explain-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--border-radius-sm);
    padding: 1.5rem;
    transition: var(--transition);
}

.explain-card:hover {
    border-color: rgba(0, 245, 212, 0.2);
}

.explain-card-title {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    color: var(--amber);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.75rem;
}

.explain-card-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ─── FOOTER ───────────────────────────────────────────────── */
.footer {
    background: var(--bg-primary);
    border-top: 1px solid var(--border-glass);
    padding: 3rem 2rem;
    text-align: center;
}

.footer-brand {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
}

.footer-hindi {
    color: var(--cyan);
    font-size: 1.4rem;
}

.footer-info {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.footer-theme {
    font-size: 0.8rem;
    color: var(--amber);
    font-weight: 500;
}

/* ─── ANIMATIONS ───────────────────────────────────────────── */
[data-animate] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

[data-animate].visible {
    opacity: 1;
    transform: translateY(0);
}

/* ─── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 900px) {
    .chart-container {
        grid-template-columns: 1fr;
    }
    
    .carbon-grid {
        grid-template-columns: 1fr;
    }
    
    .param-grid {
        flex-direction: column;
    }
    
    .param-arrow {
        transform: rotate(90deg);
    }
    
    .ai-grid {
        grid-template-columns: 1fr;
    }
    
    .explain-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    :root {
        --section-padding: 3rem 1.25rem;
        --card-padding: 1.5rem;
    }
    
    .cards-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .hero-chips {
        flex-direction: column;
        align-items: center;
    }
}

/* ─── LIVE PREDICTOR ────────────────────────────────────────── */
.predictor-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.form-group input {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-glass);
    border-radius: var(--border-radius-sm);
    padding: 0.75rem;
    color: var(--text-primary);
    font-family: var(--font-body);
}

.form-group input:focus {
    outline: none;
    border-color: var(--cyan);
}

.predictor-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.btn-predict {
    background: var(--cyan);
    color: var(--bg-primary);
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 100px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-heading);
    transition: var(--transition);
}

.btn-predict:hover {
    box-shadow: var(--shadow-glow-cyan);
    transform: translateY(-2px);
}

.btn-download {
    background: transparent;
    color: var(--cyan);
    border: 1px solid var(--cyan);
    padding: 0.8rem 2rem;
    border-radius: 100px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-heading);
    transition: var(--transition);
}

.btn-download:hover {
    background: var(--cyan-glow);
}

.predictor-result {
    text-align: center;
    padding: 2rem;
    border: 1px dashed var(--border-glass);
    border-radius: var(--border-radius);
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* ─── PRINT STYLES ─────────────────────────────────────────── */
@media print {
    body {
        background: white !important;
        color: black !important;
    }
    
    .glass-card, .section-dark, .explain-card {
        background: transparent !important;
        border: 1px solid #ccc !important;
        box-shadow: none !important;
        color: black !important;
        break-inside: avoid;
    }
    
    .section-title, .card-value, .strategy-stat, .ai-metric-value, .param-energy, .equiv-value {
        color: black !important;
        -webkit-text-fill-color: black !important;
    }

    .text-secondary, .text-muted, p, label {
        color: #333 !important;
    }
    
    .hero {
        min-height: auto;
        padding: 2rem 0;
        background: none !important;
    }
    
    .hero::after, .hero::before, .hero-bg-grid, .scroll-indicator, .lang-selector, .predictor-actions {
        display: none !important;
    }
    
    canvas {
        max-height: 300px;
        page-break-inside: avoid;
    }
    
    .chip {
        border: 1px solid #333 !important;
        color: black !important;
        background: transparent !important;
    }
}
