/* ==========================================================================
   1. GLOBALE VARIABLEN & DESIGN-SYSTEM
   ========================================================================== */
:root {
    /* Farben */
    --sonnen-gelb: #F9A825;
    --sonnen-orange: #c83c0f;
    --himmel-blau: #56B4E9;
    --himmel-hell: #EAF6FC;
    --nachtblau: #16324A;
    --wolkenweiss: #FBFDFF;
    --grau-mittel: #6B7C8E;
    --grau-hell: #E5EAEF;
    
    /* Typografie */
    --schrift-haupt: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --schrift-headline: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    
    /* Abstände */
    --abstand-klein: 10px;
    --abstand-mittel: 20px;
    --abstand-gross: 60px;
}

/* ==========================================================================
   2. RESET & BASIS
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--schrift-haupt);
    background-color: var(--wolkenweiss);
    color: var(--nachtblau);
    line-height: 1.6;
    font-size: 17px;
}

/* ==========================================================================
   3. TYPOGRAFIE
   ========================================================================== */
h1, h2, h3, h4 {
    font-family: var(--schrift-headline);
    font-weight: 700;
    color: var(--nachtblau);
    margin-bottom: var(--abstand-klein);
}

h1 { font-size: 2.8rem; }
h2 { font-size: 2.2rem; margin-top: 30px; }
h3 { font-size: 1.5rem; }

p {
    margin-bottom: 15px;
    color: var(--nachtblau);
}

a {
    color: var(--himmel-blau);
    text-decoration: none;
    transition: color 0.2s ease;
}
a:hover {
    color: var(--sonnen-orange);
}

/* ==========================================================================
   4. NAVIGATION (1:1 aus index.html übernommen)
   ========================================================================== */
.nav-bar {
    background: var(--wolkenweiss);
    box-shadow: 0 2px 10px rgba(22, 50, 74, 0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 10px 15px;           /* ← Original: 10px 15px (NICHT 10px 30px) */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    max-height: 150px;            /* ← Original: 150px (NICHT 100px) */
    width: auto;
}

.nav-menu {
    list-style: none;
    display: flex;
    gap: 30px;
}

.nav-menu a {
    color: var(--nachtblau);
    font-weight: 500;
    padding: 8px 0;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s ease;
}

.nav-menu a:hover {
    border-bottom: 2px solid var(--sonnen-gelb);
    color: var(--nachtblau);
}

/* ==========================================================================
   5. HERO SECTION
   ========================================================================== */
.hero {
    background: linear-gradient(135deg, var(--himmel-hell) 0%, var(--wolkenweiss) 100%);
    padding: 80px 30px;
    text-align: center;
    border-bottom: 3px solid var(--sonnen-gelb);
}

.hero h1 {
    color: var(--nachtblau);
    margin-bottom: var(--abstand-mittel);
}

.hero p {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto var(--abstand-gross);
    color: var(--grau-mittel);
}

/* ==========================================================================
   6. BUTTONS
   ========================================================================== */
.btn {
    display: inline-block;
    padding: 14px 32px;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    margin: 5px;
}

.btn-primary {
    background-color: var(--sonnen-gelb);
    color: var(--nachtblau);
}
.btn-primary:hover {
    background-color: var(--sonnen-orange);
    color: white;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: transparent;
    color: var(--nachtblau);
    border: 2px solid var(--nachtblau);
}
.btn-secondary:hover {
    background-color: var(--nachtblau);
    color: var(--wolkenweiss);
}

/* ==========================================================================
   7. SEKTIONEN & LAYOUT
   ========================================================================== */
.section {
    padding: var(--abstand-gross) 30px;
    max-width: 1100px;
    margin: 0 auto;
}

.section-alt {
    background-color: var(--himmel-hell);
    max-width: 100%;
    padding: var(--abstand-gross) 30px;
}

.section-alt .container {
    max-width: 1100px;
    margin: 0 auto;
}

/* ==========================================================================
   8. KARTEN (CARDS)
   ========================================================================== */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.card {
    background: var(--wolkenweiss);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(22, 50, 74, 0.06);
    border-top: 4px solid var(--himmel-blau);
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
}

.card h3 {
    color: var(--nachtblau);
    margin-bottom: 10px;
}

/* ==========================================================================
   9. LEISTUNGEN (Orange Highlight)
   ========================================================================== */
#leistungen {
    background: linear-gradient(135deg, var(--sonnen-orange) 0%, var(--sonnen-gelb) 100%);
    max-width: 100%;
    padding: var(--abstand-gross) 30px;
    margin: 0;
}

#leistungen .container-inner {
    max-width: 1100px;
    margin: 0 auto;
}

#leistungen h2 { color: white; }
#leistungen p { color: rgba(255, 255, 255, 0.95); font-size: 1.1rem; }
#leistungen .accent-bar { background: white; }

#leistungen .card {
    background: var(--wolkenweiss);
    color: var(--nachtblau);
    border-top: 4px solid var(--nachtblau);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}
#leistungen .card h3 { color: var(--sonnen-orange); }
#leistungen .card p { color: var(--nachtblau); font-size: 1rem; }

/* ==========================================================================
   10. TABELLEN (ROADMAP)
   ========================================================================== */
.table-wrapper { overflow-x: auto; }

.roadmap-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 30px;
    background: var(--wolkenweiss);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(22, 50, 74, 0.06);
}

.roadmap-table th {
    background-color: var(--nachtblau);
    color: var(--wolkenweiss);
    padding: 15px;
    text-align: left;
}

.roadmap-table td {
    padding: 15px;
    border-bottom: 1px solid var(--grau-hell);
}

.roadmap-table tr:last-child td { border-bottom: none; }
.roadmap-table tr:nth-child(even) { background-color: var(--himmel-hell); }

/* ==========================================================================
   11. KONTAKT-BOX
   ========================================================================== */
.contact-box {
    background: linear-gradient(135deg, var(--nachtblau) 0%, #244566 100%);
    color: var(--wolkenweiss);
    padding: 50px 30px;
    border-radius: 12px;
    text-align: center;
    margin-top: 30px;
}

.contact-box h2 { color: var(--sonnen-gelb); }
.contact-box p { color: var(--wolkenweiss); max-width: 600px; margin: 15px auto 30px; }

/* ==========================================================================
   12. FOOTER
   ========================================================================== */
footer {
    background-color: var(--nachtblau);
    color: var(--wolkenweiss);
    padding: var(--abstand-gross) 30px 0;
    margin-top: var(--abstand-gross);
}

.footer-grid {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    padding-bottom: 40px;
}

.footer-col h4 {
    color: var(--sonnen-gelb);
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.footer-col p, .footer-col a {
    color: #CBD6E0;
    line-height: 1.8;
}

.footer-col a:hover { color: var(--sonnen-gelb); }

.footer-bottom {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    color: #CBD6E0;
    font-size: 0.9rem;
}

.footer-bottom a { color: #CBD6E0; margin: 0 10px; }
.footer-bottom a:hover { color: var(--sonnen-gelb); }

/* ==========================================================================
   13. PARTNERLOGOS-KARUSSELL
   ========================================================================== */
.partner-marquee-wrapper {
    overflow: hidden;
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.03);
    padding: 25px 0;
    margin-top: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.partner-marquee {
    display: inline-block;
    animation: marquee 50s linear infinite;
}

.partner-marquee:hover { animation-play-state: paused; }

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.partner-marquee img {
    height: 100px;
    width: auto;
    margin: 0 35px;
    vertical-align: middle;
    opacity: 0.90;
    filter: brightness(1.2);
    transition: opacity 0.3s ease;
}

.partner-marquee img:hover { opacity: 1; }

.partner-marquee .placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 140px;
    height: 50px;
    margin: 0 35px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}

/* ==========================================================================
   14. DASHBOARD-SPEZIFISCHE STYLES (NUR für dashboard-advanced.html)
   ========================================================================== */
.chart-section { margin-bottom: var(--abstand-gross); }

.chart-header {
    display: flex; 
    justify-content: space-between; 
    align-items: flex-end;
    margin-bottom: var(--abstand-mittel); 
    flex-wrap: wrap; 
    gap: 15px;
}

.chart-controls { 
    display: flex; 
    gap: 15px; 
    align-items: center; 
    flex-wrap: wrap; 
}

.control-group { 
    display: flex; 
    flex-direction: column; 
    gap: 4px; 
}

.control-label {
    font-size: 0.75rem; 
    color: var(--grau-mittel); 
    font-weight: 600;
    text-transform: uppercase; 
    letter-spacing: 0.5px;
}

.timeframe-select, .date-input {
    padding: 8px 12px; 
    border: 1px solid var(--grau-hell); 
    border-radius: 6px;
    font: inherit; 
    font-size: 0.9rem; 
    background: var(--wolkenweiss);
    color: var(--nachtblau); 
    cursor: pointer;
}
.timeframe-select:focus, .date-input:focus { 
    outline: none; 
    border-color: var(--himmel-blau); 
}

.chart-source {
    font-size: 0.85rem; 
    color: var(--grau-mittel); 
    background: var(--himmel-hell);
    padding: 6px 12px; 
    border-radius: 4px; 
    border-left: 3px solid var(--himmel-blau);
}
.chart-source a { color: var(--himmel-blau); text-decoration: underline; }

.chart-container { 
    position: relative; 
    width: 100%; 
}
.chart-container.tariff { height: 450px; }
.chart-container.default { height: 350px; }

.data-note { 
    font-size: 0.8rem; 
    color: var(--grau-mittel); 
    margin-top: 8px; 
    font-style: italic; 
}

.error-box {
    display: flex; 
    align-items: center; 
    justify-content: center;
    height: 100%; 
    color: #d32f2f; 
    background: #ffebee;
    border-radius: 8px; 
    font-weight: 600; 
    text-align: center; 
    padding: 20px;
}

.tariff-legend {
    display: flex; 
    gap: 20px; 
    margin-top: 15px; 
    flex-wrap: wrap; 
    justify-content: center;
}

.tariff-legend-item { 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    font-size: 0.9rem;
}

.legend-color { 
    width: 20px; 
    height: 3px; 
    border-radius: 2px; 
}
.legend-color.dashed {
    border-top: 2px dashed;
    background: transparent !important;
    height: 0;
}

#prodGapInfo {
    display: none; 
    margin-top: 15px; 
    padding: 12px; 
    background: #fff3cd; 
    border-left: 4px solid #ffc107; 
    color: #856404; 
    font-size: 0.85rem; 
    border-radius: 4px;
}

/* ==========================================================================
   15. UTILITIES
   ========================================================================== */
.accent-bar {
    width: 60px;
    height: 4px;
    background: var(--sonnen-gelb);
    margin-bottom: 20px;
    border-radius: 2px;
}

/* ==========================================================================
   16. RESPONSIVE (1:1 aus index.html übernommen)
   ========================================================================== */
@media (max-width: 768px) {
    .nav-menu { display: none; }
    h1 { font-size: 2rem; }
    h2 { font-size: 1.7rem; }
    
    .nav-bar {
        padding: 5px 5px;                /* ← Original: 5px 5px (NICHT 10px 15px) */
        justify-content: center;          /* ← Original: center (NICHT space-between) */
    }
    
    .nav-logo {
        max-height: 160px;                /* ← Original: 160px (NICHT 80px) */
    }
    
    /* Dashboard Mobile Anpassungen */
    .chart-container { height: 300px !important; }
    .chart-header { flex-direction: column; align-items: flex-start; }
    .chart-controls { width: 100%; }
}

/* ==========================================================================
   17. BATTERIERECHNER-SPEZIFISCHE STYLES
   ========================================================================== */
.is-hidden {
    display: none !important;
}

.calculator-form {
    margin-top: 30px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

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

.form-group label {
    font-weight: 600;
    color: var(--nachtblau);
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.form-group input,
.form-select {
    padding: 12px 15px;
    border: 2px solid var(--grau-hell);
    border-radius: 6px;
    font: inherit;
    font-size: 1rem;
    background: var(--wolkenweiss);
    color: var(--nachtblau);
    transition: border-color 0.2s ease;
    width: 100%;
}

.form-group input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--himmel-blau);
}

.form-hint {
    font-size: 0.85rem;
    color: var(--grau-mittel);
    margin-top: 5px;
    font-style: italic;
    line-height: 1.4;
}

.toggle-group {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 600;
    color: var(--nachtblau);
    margin-bottom: 0;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--sonnen-gelb);
    cursor: pointer;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

.results-container {
    animation: fadeIn 0.5s ease;
}

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

.result-value {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--sonnen-orange);
    margin: 15px 0;
    line-height: 1;
}

.result-description {
    font-size: 0.9rem;
    color: var(--grau-mittel);
    margin: 0;
}

.info-box {
    background: var(--himmel-hell);
    padding: 30px;
    border-radius: 10px;
    margin-top: 30px;
    border-left: 4px solid var(--himmel-blau);
}

.info-box h3 {
    color: var(--nachtblau);
    margin-bottom: 10px;
}

.info-box p {
    color: var(--nachtblau);
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.7;
}

.warning-box {
    background: #fff3cd;
    padding: 30px;
    border-radius: 10px;
    margin-top: 30px;
    border-left: 4px solid var(--sonnen-orange);
}

.warning-box h3 {
    color: var(--sonnen-orange);
    margin-bottom: 10px;
}

.warning-box p {
    color: #856404;
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.7;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

/* Responsive Anpassungen für Batterierechner */
@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
    
    .result-value {
        font-size: 1.8rem;
    }
    
    .toggle-group {
        flex-direction: column;
        align-items: flex-start;
    }
}
