@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

/* Color & Styling Variables */
:root {
    --bg-base: #0a0d16;
    --bg-surface: rgba(16, 22, 38, 0.65);
    --bg-surface-solid: #101626;
    --bg-card: rgba(22, 30, 53, 0.45);
    --border-light: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    
    --accent-solar: #f59e0b; /* Amber */
    --accent-solar-gradient: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --accent-solar-glow: rgba(245, 158, 11, 0.15);

    --accent-battery: #10b981; /* Emerald Green */
    --accent-battery-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --accent-battery-glow: rgba(16, 185, 129, 0.15);

    --accent-cyan: #06b6d4; /* Cyan for ROI/Savings */
    --accent-cyan-gradient: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    --accent-cyan-glow: rgba(6, 182, 212, 0.15);

    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --text-white: #ffffff;
    
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius-lg: 20px;
    --border-radius-md: 12px;
    --border-radius-sm: 8px;
    --max-width: 1280px;
}

/* Base resets & styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Background grid / glow elements */
body::before {
    content: '';
    position: absolute;
    top: -200px;
    left: 20%;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.08) 0%, rgba(0,0,0,0) 70%);
    z-index: -1;
    pointer-events: none;
}

body::after {
    content: '';
    position: absolute;
    top: 400px;
    right: 15%;
    width: 650px;
    height: 650px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.06) 0%, rgba(0,0,0,0) 70%);
    z-index: -1;
    pointer-events: none;
}

/* Structure */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

header {
    padding: 24px 0;
    border-bottom: 1px solid var(--border-light);
    background: rgba(10, 13, 22, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-weight: 700;
    font-size: 22px;
    color: var(--text-primary);
}

.logo span.logo-gold {
    color: var(--accent-solar);
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: var(--accent-solar-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg-base);
    box-shadow: 0 0 15px var(--accent-solar-glow);
}

/* Language selector */
.lang-selector {
    position: relative;
    display: inline-block;
}

.lang-select-btn {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition-smooth);
}

.lang-select-btn:hover {
    border-color: var(--border-hover);
    background: rgba(22, 30, 53, 0.7);
}

.lang-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: var(--bg-surface-solid);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-sm);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    display: none;
    flex-direction: column;
    min-width: 150px;
    z-index: 110;
    overflow: hidden;
}

.lang-dropdown.show {
    display: flex;
}

.lang-dropdown a {
    color: var(--text-secondary);
    padding: 10px 16px;
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 10px;
}

.lang-dropdown a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.lang-dropdown a.active {
    background: var(--accent-solar-glow);
    color: var(--accent-solar);
    font-weight: 600;
}

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

.hero h1 {
    font-size: 42px;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--text-white) 30%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}

.hero h1 span.solar-gradient {
    background: linear-gradient(135deg, var(--accent-solar) 0%, var(--accent-battery) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto;
}

/* Main Calculator Grid Layout */
.calculator-grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 32px;
    margin-bottom: 60px;
    align-items: start;
}

@media (max-width: 1024px) {
    .calculator-grid {
        grid-template-columns: 1fr;
    }
}

/* Glassmorphism Panel card styling */
.panel {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--border-radius-lg);
    padding: 32px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    transition: var(--transition-smooth);
}

.panel:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

/* Section Titles inside panel */
.section-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 12px;
}

.section-title i {
    font-size: 18px;
}

.title-solar {
    color: var(--accent-solar);
}

.title-battery {
    color: var(--accent-battery);
}

.title-cyan {
    color: var(--accent-cyan);
}

/* Toggles & Options */
.toggle-group {
    display: flex;
    background: rgba(10, 13, 22, 0.5);
    padding: 4px;
    border-radius: var(--border-radius-md);
    margin-bottom: 24px;
    border: 1px solid var(--border-light);
}

.toggle-option {
    flex: 1;
    text-align: center;
    padding: 12px;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition-smooth);
    color: var(--text-secondary);
    user-select: none;
}

.toggle-option.active {
    background: var(--bg-surface-solid);
    color: var(--text-white);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* Specific styling for On/Off grid active state */
#onGridToggle.active {
    border-left: 2px solid var(--accent-cyan);
    color: var(--accent-cyan);
}
#offGridToggle.active {
    border-left: 2px solid var(--accent-solar);
    color: var(--accent-solar);
}

/* Grid parameters */
.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

@media (max-width: 580px) {
    .input-row {
        grid-template-columns: 1fr;
    }
}

.input-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
}

.input-field label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.input-field label span.val-display {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-white);
}

.input-field label span.val-display.solar {
    color: var(--accent-solar);
}

.input-field label span.val-display.battery {
    color: var(--accent-battery);
}

.input-field input[type="text"],
.input-field input[type="number"],
.input-field select {
    background: rgba(10, 13, 22, 0.6);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: var(--border-radius-md);
    font-family: var(--font-sans);
    font-size: 16px;
    font-weight: 500;
    transition: var(--transition-smooth);
    width: 100%;
    outline: none;
}

.input-field input:focus,
.input-field select:focus {
    border-color: var(--text-secondary);
    background: rgba(10, 13, 22, 0.8);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.03);
}

/* Range Sliders */
.input-field input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    margin: 12px 0;
}

/* Slider Thumbs */
.input-field input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.input-field input[type="range"].slider-solar::-webkit-slider-thumb {
    background: var(--accent-solar);
    box-shadow: 0 0 8px var(--accent-solar-glow);
}

.input-field input[type="range"].slider-solar::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    background: #fbbf24;
}

.input-field input[type="range"].slider-battery::-webkit-slider-thumb {
    background: var(--accent-battery);
    box-shadow: 0 0 8px var(--accent-battery-glow);
}

.input-field input[type="range"].slider-battery::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    background: #34d399;
}

/* Custom visual helpers */
.unit-suffix {
    position: absolute;
    right: 16px;
    bottom: 12px;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    pointer-events: none;
}

.input-with-suffix input {
    padding-right: 50px !important;
}

/* Advanced settings details accordion */
.advanced-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    user-select: none;
    transition: var(--transition-smooth);
}

.advanced-trigger:hover {
    color: var(--text-primary);
}

.advanced-trigger i {
    transition: transform 0.3s;
}

.advanced-trigger.open i {
    transform: rotate(180deg);
}

.advanced-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
}

.advanced-content.show {
    max-height: 1000px;
    margin-top: 20px;
}

/* Output Dashboard styling */
.output-header {
    text-align: center;
    margin-bottom: 28px;
}

.output-header h2 {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 6px;
}

.output-main-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 28px;
}

@media (max-width: 580px) {
    .output-main-cards {
        grid-template-columns: 1fr;
    }
}

.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-md);
    padding: 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 130px;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
}

.card-solar::before {
    background: var(--accent-solar-gradient);
}

.card-battery::before {
    background: var(--accent-battery-gradient);
}

.metric-card span.label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.metric-card span.value {
    font-size: 28px;
    font-weight: 800;
    line-height: 1.1;
    color: var(--text-white);
}

.card-solar span.value {
    color: #f59e0b;
}

.card-battery span.value {
    color: #10b981;
}

.metric-card span.subval {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
    font-weight: 500;
}

/* Visualization Widget */
.visualization-widget {
    background: rgba(10, 13, 22, 0.4);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-md);
    padding: 24px;
    margin-bottom: 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    min-height: 220px;
}

.widget-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    width: 100%;
    text-align: center;
}

/* Custom SVGs and visuals */
.visuals-container {
    display: flex;
    justify-content: space-around;
    width: 100%;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.roof-visual, .battery-visual {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 120px;
}

.roof-svg-wrap, .battery-svg-wrap {
    width: 90px;
    height: 90px;
    position: relative;
}

.visual-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Detailed table/metrics */
.detail-metrics-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 28px;
}

.metric-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
    font-size: 14px;
}

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

.metric-row span.m-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.metric-row span.m-val {
    color: var(--text-white);
    font-weight: 700;
}

/* Financial Highlights Banner */
.financial-banner {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.1) 0%, rgba(10, 13, 22, 0.4) 100%);
    border: 1px solid rgba(6, 182, 212, 0.2);
    border-radius: var(--border-radius-md);
    padding: 20px;
    margin-bottom: 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.fin-item {
    display: flex;
    flex-direction: column;
}

.fin-item span.fin-lbl {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 4px;
}

.fin-item span.fin-val {
    font-size: 20px;
    font-weight: 800;
    color: var(--accent-cyan);
}

/* Export CTA Button */
.cta-button {
    width: 100%;
    padding: 16px;
    border-radius: var(--border-radius-md);
    border: none;
    font-family: var(--font-sans);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: var(--transition-smooth);
    background: var(--accent-solar-gradient);
    color: var(--bg-base);
    box-shadow: 0 8px 24px var(--accent-solar-glow);
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(245, 158, 11, 0.25);
    filter: brightness(1.1);
}

.cta-button:active {
    transform: translateY(0);
}

/* SEO Educational Section */
.seo-content-section {
    padding: 60px 0;
    border-top: 1px solid var(--border-light);
}

.seo-content-grid {
    display: grid;
    grid-template-columns: 1.8fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

@media (max-width: 1024px) {
    .seo-content-grid {
        grid-template-columns: 1fr;
    }
}

.seo-text h2 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 20px;
    color: var(--text-white);
}

.seo-text h3 {
    font-size: 20px;
    font-weight: 700;
    margin-top: 24px;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.seo-text p {
    color: var(--text-secondary);
    margin-bottom: 16px;
    font-size: 15px;
}

.seo-text ul {
    margin-left: 20px;
    margin-bottom: 16px;
    color: var(--text-secondary);
}

.seo-text li {
    margin-bottom: 8px;
    font-size: 15px;
}

/* Countries reference table widget for SEO */
.reference-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-md);
    padding: 24px;
    align-self: start;
}

.reference-card h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 10px;
}

.reference-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}

.reference-table th {
    color: var(--text-primary);
    font-weight: 600;
    padding: 10px 8px;
    border-bottom: 1px solid var(--border-light);
}

.reference-table td {
    color: var(--text-secondary);
    padding: 10px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.reference-table tr:last-child td {
    border-bottom: none;
}

/* FAQ Accordion Styling for SEO markup */
.faq-section {
    margin-top: 40px;
}

.faq-section h2 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 24px;
    text-align: center;
}

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

.faq-item {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    transition: var(--transition-smooth);
}

.faq-item:hover {
    border-color: var(--border-hover);
}

.faq-question {
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    user-select: none;
    color: var(--text-white);
}

.faq-question i {
    transition: transform 0.3s;
    color: var(--accent-solar);
}

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

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: rgba(10, 13, 22, 0.3);
}

.faq-answer p {
    padding: 20px 24px;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Footer Section */
footer {
    border-top: 1px solid var(--border-light);
    background: rgba(10, 13, 22, 0.9);
    padding: 40px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

footer a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition-smooth);
}

footer a:hover {
    color: var(--accent-solar);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 16px;
}

/* Interactive feedback elements */
.pulse {
    animation: pulse-animation 2s infinite;
}

@keyframes pulse-animation {
    0% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(245, 158, 11, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
    }
}

/* Hidden elements helper */
.hidden {
    display: none !important;
}

.opacity-half {
    opacity: 0.5;
    pointer-events: none;
}

/* Print / PDF Export Styles */
@media print {
    body {
        background: #ffffff;
        color: #000000;
        font-size: 12pt;
    }
    
    header, 
    .lang-selector,
    .toggle-group,
    .input-row,
    .advanced-trigger,
    .advanced-content,
    .cta-button,
    .seo-content-section,
    footer,
    body::before,
    body::after {
        display: none !important;
    }
    
    .container {
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .calculator-grid {
        grid-template-columns: 1fr !important;
        gap: 0 !important;
    }
    
    .panel {
        background: none !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
    }
    
    .output-panel {
        display: block !important;
    }
    
    .output-header h2 {
        color: #000000 !important;
        font-size: 24pt !important;
        margin-top: 0;
    }
    
    .metric-card {
        background: #f3f4f6 !important;
        border: 1px solid #d1d5db !important;
        color: #000000 !important;
        box-shadow: none !important;
        page-break-inside: avoid;
    }
    
    .card-solar span.value {
        color: #d97706 !important;
    }
    
    .card-battery span.value {
        color: #059669 !important;
    }
    
    .metric-row {
        border-bottom: 1px dashed #d1d5db !important;
    }
    
    .metric-row span.m-label,
    .metric-row span.m-val {
        color: #000000 !important;
    }
    
    .financial-banner {
        background: #e0f2fe !important;
        border: 1px solid #bae6fd !important;
        color: #000000 !important;
    }
    
    .fin-item span.fin-val {
        color: #0369a1 !important;
    }
    
    .visualization-widget {
        border: 1px solid #d1d5db !important;
        background: none !important;
        page-break-inside: avoid;
    }
    
    /* Show details of inputs in printed report */
    .print-report-header {
        display: block !important;
        margin-bottom: 30px;
        border-bottom: 2px solid #000000;
        padding-bottom: 10px;
    }
    
    .print-input-summary {
        display: block !important;
        margin-bottom: 30px;
        background: #f9fafb;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        padding: 15px;
    }
    
    .print-input-summary h3 {
        margin-bottom: 10px;
        font-size: 14pt;
        border-bottom: 1px solid #e5e7eb;
        padding-bottom: 5px;
    }
    
    .print-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        font-size: 10pt;
    }
}

/* Screen defaults for print report sections */
.print-report-header,
.print-input-summary {
    display: none;
}

