/* ============================================
   ENERGY FLOW - CORRECTED & SMALLER
   ============================================ */

:root {
    --energy-active-color: #77ae1b;
    --energy-inactive-color: #e0e0e0;
    --energy-bg-active: #77ae1b;
    --energy-bg-inactive: #f0f0f0;
    --animation-speed: 2.5s;
}

#energy-flow-container {
    margin-top: 40px;
    padding: 20px 0;
}

.energy-flow-wrapper {
    position: relative;
    width: 100%;
    max-width: 650px;
    height: 550px;
    margin: 0 auto;
    border: 1px solid #e5e5e5;
    border-radius: 20px;
    background: #ffffff;
    padding: 30px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    z-index: 0;
}

.energy-flow-label {
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%)!important;
    font-weight: 700;
    font-size: 18px;
    color: #333;
    z-index: 5;
    letter-spacing: 0.5px;
}

#energy-flow-svg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%)!important;
    width: 400px;
    height: 400px;
    z-index: 1;
}

.grid-line {
    stroke: #f5f5f5;
    stroke-width: 1;
    opacity: 0.5;
}

.flow-line {
    stroke: var(--energy-inactive-color);
    stroke-width: 2;
    fill: none;
    opacity: 0.3;
    transition: all 0.4s ease;
}

.flow-line.active {
    stroke: var(--energy-active-color);
    stroke-width: 2.5;
    opacity: 1;
    stroke-dasharray: 12, 8;
    animation: flowAnimation var(--animation-speed) linear infinite;
}

@keyframes flowAnimation {
    0% {
        stroke-dashoffset: 20;
    }
    100% {
        stroke-dashoffset: 0;
    }
}

.flow-line.active.reverse {
    animation: flowAnimationReverse var(--animation-speed) linear infinite;
}

@keyframes flowAnimationReverse {
    0% {
        stroke-dashoffset: 20;
    }
    100% {
        stroke-dashoffset: 0;
    }
}

/* Energy Components - SMALLER */
.energy-component {
    position: absolute;
    width: 95px;
    height: 95px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--energy-bg-inactive);
    border-radius: 16px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    border: 2px solid #e0e0e0;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
}

.energy-component.active {
    background: var(--energy-bg-active);
    border-color: var(--energy-bg-active);
    box-shadow: 0 8px 30px rgba(119, 174, 27, 0.4);
    transform: scale(1.05);
}

.energy-component.active .component-icon svg {
    color: #ffffff;
}

.energy-component.active .component-label {
    color: #ffffff;
}

/* Positions */
.solar-component {
    top: 50%;
    left: 50px;
    transform: translateY(-50%)!important;
}

.home-component {
    top: 75px;
    left: 50%;
    transform: translateX(-50%)!important;
}

.home-component .component-icon {
    position: relative;
}

.grid-component {
    top: 50%;
    right: 50px;
    transform: translateY(-50%)!important;
}

.battery-component {
    bottom: 75px;
    left: 50%;
    transform: translateX(-50%)!important;
}

.component-icon {
    width: 40px;
    height: 40px;
    margin-bottom: 6px;
}

.component-icon svg {
    width: 100%;
    height: 100%;
    color: #666;
    transition: color 0.3s ease;
}

.component-label {
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    color: #333;
    line-height: 1.3;
    width: 100%;
    letter-spacing: 0.3px;
}

.component-value {
    display: block;
    font-size: 11px;
    font-weight: 600;
    margin-top: 3px;
}

/* Scenario Description - NOW OUTSIDE wrapper */
.scenario-description {
    width: 100%;
    max-width: 650px;
    margin: 20px auto 0;  /* 20px space above, centered */
    text-align: center;
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    padding: 15px 25px;
    background: #f9f9f9;  /* Optional: light background */
    border-radius: 10px;
    border: 1px solid #e5e5e5;
}

.scenario-description p {
    margin: 0;
}

.how-systme-btn {
    transition: all 0.3s ease;
    text-transform: uppercase;
    font-weight: 600;
    font-size: 13px;
    padding: 12px 24px;
    border-radius: 8px;
    border: 2px solid #ddd;
}

.how-systme-btn.active {
    background-color: var(--energy-active-color) !important;
    color: #ffffff !important;
    border-color: var(--energy-active-color) !important;
}

.how-systme-btn:hover:not(.active) {
    background-color: #f5f5f5 !important;
    border-color: #bbb;
}

/* Responsive */
@media (max-width: 768px) {
    .energy-flow-wrapper {
        max-width: 100%;
        height: 500px;
        padding: 20px;
    }
    
    #energy-flow-svg {
        width: 350px;
        height: 350px;
    }
    
    .energy-component {
        width: 80px;
        height: 80px;
    }
    
    .solar-component {
        left: 35px;
    }
    
    .grid-component {
        right: 35px;
    }
    
    .home-component {
        top: 65px;
    }
    
    .battery-component {
        bottom: 65px;
    }
    
    .component-icon {
        width: 35px;
        height: 35px;
    }
    
    .component-label {
        font-size: 11px;
    }
    
    .component-value {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .energy-flow-wrapper {
        height: 450px;
        padding: 15px;
    }
    
    #energy-flow-svg {
        width: 300px;
        height: 300px;
    }
    
    .energy-component {
        width: 70px;
        height: 70px;
    }
    
    .solar-component {
        left: 25px;
    }
    
    .grid-component {
        right: 25px;
    }
    
    .home-component {
        top: 55px;
    }
    
    .battery-component {
        bottom: 55px;
    }
    
    .component-icon {
        width: 30px;
        height: 30px;
    }
    
    .component-label {
        font-size: 10px;
    }
    
    .component-value {
        font-size: 9px;
    }
    
    .how-systme-btn {
        font-size: 11px;
        padding: 10px 16px;
    }
}

/* Force center alignment on mobile */
@media (max-width: 768px) {
    #how-system-works #how-system-anchors {
        text-align: center !important;
    }
    
    #how-system-works .btn-group {
        display: inline-flex !important;
        flex-direction: column !important;
        align-items: center !important;
        margin: 0 auto !important;
    }
    
    #how-system-works .btn-group .how-systme-btn {
        width: 100%;
        max-width: 300px;
        margin: 5px 0 !important;
    }
    #lighter-font-fix{
        font-size: 10px;
    font-weight: 100;
    }
}

