﻿/* ==========================================================================
   MK-Industries® Slimme Energiemeter — Official Product Stylesheet
   Glassmorphism, High-Performance CSS3 & Responsive Architecture
   ========================================================================== */

:root {
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-heading: 'Outfit', sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;

    /* MK-Industries® Brand Palette */
    --vde-green: #3fa535;
    --vde-green-dark: #2e983c;
    --vde-green-light: rgba(63, 165, 53, 0.12);
    --vde-green-glow: rgba(63, 165, 53, 0.28);

    --flow-blue: #0284c7;
    --flow-blue-dark: #0369a1;
    --flow-blue-light: rgba(2, 132, 199, 0.12);
    --flow-blue-glow: rgba(2, 132, 199, 0.28);

    /* Energy Tariff Status Colors */
    --tariff-negative: #10b981;
    --tariff-negative-glow: rgba(16, 185, 129, 0.4);
    --tariff-cheap: #22c55e;
    --tariff-cheap-glow: rgba(34, 197, 94, 0.35);
    --tariff-expensive: #ef4444;
    --tariff-expensive-glow: rgba(239, 68, 68, 0.35);
    --tariff-moderate: #64748b;

    /* Base Theme & Surfaces */
    --bg-base: #f0f3f6;
    --glass-bg: rgba(255, 255, 255, 0.78);
    --glass-border: rgba(255, 255, 255, 0.9);
    --glass-card: rgba(255, 255, 255, 0.85);

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border-light: rgba(226, 232, 240, 0.8);

    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 18px 45px rgba(0, 0, 0, 0.09);
    --shadow-glow: 0 0 25px var(--vde-green-glow);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-base);
    background-image: 
        radial-gradient(circle at 10% 15%, rgba(63, 165, 53, 0.06), transparent 40%),
        radial-gradient(circle at 90% 65%, rgba(2, 132, 199, 0.06), transparent 40%),
        radial-gradient(circle at 50% 90%, rgba(34, 197, 94, 0.04), transparent 40%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

/* Glassmorphism Panel */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-soft);
    border-radius: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ==========================================================================
   Header
   ========================================================================== */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 28px;
    margin: 16px auto 0;
    max-width: 1240px;
    position: sticky;
    top: 16px;
    z-index: 100;
}

.logo-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-badge {
    background: linear-gradient(135deg, var(--vde-green), var(--vde-green-dark));
    color: white;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px var(--vde-green-glow);
}

.logo-text {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 2px;
}

.trademark {
    font-size: 0.75rem;
    color: var(--vde-green);
    margin-left: 2px;
}

.sub-badge {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 500;
    display: block;
    line-height: 1;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-link {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: var(--vde-green);
}

.nav-btn {
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.nav-btn-outline {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
}

.nav-btn-outline:hover {
    background: white;
    border-color: var(--vde-green);
    color: var(--vde-green);
}

.nav-btn-primary {
    background: linear-gradient(135deg, var(--vde-green), var(--vde-green-dark));
    color: white;
    box-shadow: 0 4px 12px var(--vde-green-glow);
}

.nav-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px var(--vde-green-glow);
}

.mobile-menu-btn {
    display: none;
    padding: 8px;
    color: var(--text-primary);
}

.mobile-nav {
    display: none;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero-section {
    padding: 60px 0 40px;
    text-align: center;
    position: relative;
}

.badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: var(--vde-green-light);
    color: var(--vde-green-dark);
    border: 1px solid rgba(63, 165, 53, 0.25);
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.hero-title {
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    font-weight: 800;
    line-height: 1.15;
    max-width: 900px;
    margin: 0 auto 20px;
    letter-spacing: -0.03em;
}

.hero-title span {
    background: linear-gradient(135deg, var(--vde-green), #16a34a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: clamp(1.05rem, 2vw, 1.25rem);
    color: var(--text-secondary);
    max-width: 720px;
    margin: 0 auto 32px;
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.btn-hero {
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.25s ease;
}

.btn-hero-primary {
    background: linear-gradient(135deg, var(--vde-green), var(--vde-green-dark));
    color: white;
    box-shadow: 0 6px 20px var(--vde-green-glow);
}

.btn-hero-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px var(--vde-green-glow);
}

.btn-hero-secondary {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    box-shadow: var(--shadow-soft);
}

.btn-hero-secondary:hover {
    background: white;
    border-color: var(--vde-green);
    color: var(--vde-green);
    transform: translateY(-2px);
}

/* Live Tariff Ticker */
.live-ticker-wrap {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    background: white;
    border: 1px solid var(--border-light);
    border-radius: 999px;
    box-shadow: var(--shadow-soft);
}

.ticker-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--vde-green);
    box-shadow: 0 0 10px var(--vde-green);
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.6; }
}

.ticker-text {
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.ticker-price {
    font-weight: 700;
    color: var(--text-primary);
}

.ticker-tag {
    font-size: 0.78rem;
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 600;
    background: var(--vde-green-light);
    color: var(--vde-green-dark);
}

/* ==========================================================================
   Interactive 16x2 Pico W Simulator Section
   ========================================================================== */
.simulator-section {
    padding: 40px 0 80px;
}

.simulator-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 36px;
}

.section-header {
    text-align: center;
    margin-bottom: 36px;
}

.section-title {
    font-size: 2.2rem;
    margin-bottom: 10px;
}

.section-desc {
    color: var(--text-secondary);
    font-size: 1.05rem;
}

/* The Physical Chassis */
.chassis {
    background: linear-gradient(145deg, #1e293b, #0f172a);
    border: 3px solid #334155;
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35), inset 0 2px 4px rgba(255, 255, 255, 0.1);
    position: relative;
    max-width: 680px;
    margin: 0 auto 30px;
}

.chassis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.chassis-brand {
    font-family: var(--font-heading);
    font-weight: 800;
    color: #e2e8f0;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chassis-brand svg {
    color: var(--vde-green);
}

.chassis-model {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.06);
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* 16x2 LCD Screen Display */
.lcd-bezel {
    background: #022013;
    border: 4px solid #111827;
    border-radius: 12px;
    padding: 18px 24px;
    box-shadow: inset 0 4px 12px rgba(0, 0, 0, 0.8), 0 0 20px rgba(34, 197, 94, 0.15);
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.lcd-screen {
    font-family: var(--font-mono);
    font-size: 1.65rem;
    font-weight: 700;
    color: #22c55e;
    text-shadow: 0 0 8px rgba(34, 197, 94, 0.7);
    line-height: 1.4;
    letter-spacing: 2px;
    user-select: none;
}

.lcd-line {
    white-space: pre;
    min-height: 2.2rem;
    display: block;
}

/* Controls & Indicators Row */
.chassis-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.led-group {
    display: flex;
    gap: 20px;
    align-items: center;
}

.led-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.led-dome {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #334155;
    border: 2px solid #1e293b;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
    transition: all 0.2s ease;
}

.led-green.led-on {
    background: #22c55e;
    box-shadow: 0 0 16px #22c55e, 0 0 30px #22c55e;
}

.led-red.led-on {
    background: #ef4444;
    box-shadow: 0 0 16px #ef4444, 0 0 30px #ef4444;
}

.led-label {
    font-size: 0.7rem;
    color: #94a3b8;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Hardware Push Button */
.button-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.push-btn {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #475569, #1e293b);
    border: 3px solid #0f172a;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5), inset 0 2px 4px rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cbd5e1;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
    user-select: none;
}

.push-btn:hover {
    transform: translateY(-2px);
    color: white;
}

.push-btn.pressed {
    transform: translateY(3px) scale(0.96);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.7), inset 0 3px 6px rgba(0, 0, 0, 0.6);
    background: radial-gradient(circle at 50% 50%, #334155, #0f172a);
}

.btn-label {
    font-size: 0.7rem;
    color: #94a3b8;
    font-weight: 600;
}

/* Test Preset Scenarios Panel */
.simulator-presets {
    background: white;
    border-radius: 16px;
    padding: 20px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-soft);
}

.presets-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.presets-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.presets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
}

.preset-btn {
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    background: #f8fafc;
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    transition: all 0.2s ease;
    text-align: center;
}

.preset-btn:hover {
    border-color: var(--vde-green);
    color: var(--vde-green);
}

.preset-btn.active {
    background: var(--vde-green-light);
    border-color: var(--vde-green);
    color: var(--vde-green-dark);
}

.sim-help-bar {
    margin-top: 14px;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
}

/* ==========================================================================
   Features Section
   ========================================================================== */
.features-section {
    padding: 60px 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

.feature-card {
    padding: 32px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.feature-icon-wrap {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    background: var(--vde-green-light);
    color: var(--vde-green);
}

.feature-icon-wrap.blue {
    background: var(--flow-blue-light);
    color: var(--flow-blue);
}

.feature-title {
    font-size: 1.3rem;
    margin-bottom: 12px;
}

.feature-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ==========================================================================
   Hardware & Pinout Section
   ========================================================================== */
.hardware-section {
    padding: 60px 0;
}

.hardware-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
}

.pinout-card, .bom-card {
    padding: 32px;
}

.pinout-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 18px;
    font-size: 0.9rem;
}

.pinout-table th, .pinout-table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.pinout-table th {
    font-weight: 700;
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.02);
}

.pin-badge {
    font-family: var(--font-mono);
    font-weight: 700;
    background: #e2e8f0;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
}

/* ==========================================================================
   Installation & Setup Section
   ========================================================================== */
.setup-section {
    padding: 60px 0;
}

.setup-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.step-card {
    padding: 28px;
    position: relative;
}

.step-number {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--vde-green);
    opacity: 0.4;
    margin-bottom: 8px;
    font-family: var(--font-heading);
}

.step-title {
    font-size: 1.15rem;
    margin-bottom: 10px;
}

.step-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ==========================================================================
   Firmware & Markdown Viewer Section
   ========================================================================== */
.firmware-section {
    padding: 60px 0;
}

.code-box {
    background: #0f172a;
    border-radius: 16px;
    padding: 20px;
    color: #e2e8f0;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    position: relative;
    overflow-x: auto;
    margin-top: 18px;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.copy-code-btn {
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    border-radius: 6px;
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
}

.copy-code-btn:hover {
    background: var(--vde-green);
    color: white;
}

/* ==========================================================================
   FAQ Section
   ========================================================================== */
.faq-section {
    padding: 60px 0;
}

.faq-list {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.faq-item {
    background: white;
    border: 1px solid var(--border-light);
    border-radius: 14px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.faq-question {
    padding: 18px 24px;
    font-weight: 600;
    font-size: 1.05rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.faq-question svg {
    transition: transform 0.25s ease;
}

.faq-item.active .faq-question svg {
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0 24px 18px;
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    display: none;
}

.faq-item.active .faq-answer {
    display: block;
}

/* ==========================================================================
   Modal (Pre-order / DIY)
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    padding: 20px;
}

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

.modal-card {
    background: white;
    border-radius: 20px;
    padding: 36px;
    max-width: 520px;
    width: 100%;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    position: relative;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: var(--text-muted);
    font-size: 1.2rem;
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid var(--border-light);
    font-family: inherit;
    font-size: 0.95rem;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--vde-green);
    box-shadow: 0 0 0 3px var(--vde-green-light);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.main-footer {
    margin-top: 80px;
    padding: 50px 0 30px;
    border-top: 1px solid var(--border-light);
    background: rgba(255, 255, 255, 0.6);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-brand h3 {
    font-size: 1.25rem;
    margin-bottom: 10px;
}

.footer-brand p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    max-width: 320px;
}

.footer-col h4 {
    font-size: 0.95rem;
    margin-bottom: 14px;
    color: var(--text-primary);
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.88rem;
    color: var(--text-secondary);
}

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

.footer-bottom {
    padding-top: 24px;
    border-top: 1px solid var(--border-light);
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 900px) {
    .hardware-layout {
        grid-template-columns: 1fr;
    }
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
    .main-nav {
        display: none;
    }
    .mobile-menu-btn {
        display: block;
    }
}

@media (max-width: 600px) {
    .lcd-screen {
        font-size: 1.15rem;
    }
    .chassis {
        padding: 20px;
    }
    .footer-grid {
        grid-template-columns: 1fr;
    }
    .hero-title {
        font-size: 2rem;
    }
}
