/* Animated Sustainability Impact Tracker Styles */

.sustainability-tracker {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 20px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.sustainability-tracker::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #28a745, #20c997, #17a2b8, #007bff);
    animation: rainbow-slide 3s linear infinite;
}

@keyframes rainbow-slide {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.tracker-header {
    text-align: center;
    margin-bottom: 2rem;
}

.tracker-header h3 {
    color: #28a745;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.tracker-header h3 i {
    margin-right: 0.5rem;
    animation: leaf-sway 2s ease-in-out infinite;
}

@keyframes leaf-sway {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(5deg); }
}

.tracker-header p {
    color: #6c757d;
    font-size: 1rem;
    margin: 0;
}

.impact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.impact-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.impact-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.impact-card.pulse-effect {
    animation: card-pulse 1s ease-out;
}

@keyframes card-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.impact-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.co2-card .impact-icon { color: #17a2b8; }
.trees-card .impact-icon { color: #28a745; }
.cars-card .impact-icon { color: #ffc107; }
.oil-card .impact-icon { color: #343a40; }
.coal-card .impact-icon { color: #6c757d; }
.homes-card .impact-icon { color: #007bff; }

.impact-value {
    font-size: 2.2rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-family: 'Inter', sans-serif;
}

.impact-unit {
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Animation Elements */
.impact-animation {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
}

/* CO2 Bubbles Animation */
.co2-bubble {
    position: absolute;
    width: 8px;
    height: 8px;
    background: rgba(23, 162, 184, 0.3);
    border-radius: 50%;
    animation: bubble-float 4s linear infinite;
}

.co2-bubble:nth-child(1) {
    left: 20%;
    animation-delay: 0s;
}

.co2-bubble:nth-child(2) {
    left: 50%;
    animation-delay: 1.5s;
}

.co2-bubble:nth-child(3) {
    left: 80%;
    animation-delay: 3s;
}

@keyframes bubble-float {
    0% {
        bottom: -10px;
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        bottom: 110%;
        opacity: 0;
    }
}

/* Tree Growth Animation */
.tree-grow {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 0;
    background: #28a745;
    animation: tree-growth 3s ease-out infinite;
}

@keyframes tree-growth {
    0% { height: 0; }
    50% { height: 30px; }
    100% { height: 0; }
}

/* Car Exhaust Animation */
.car-exhaust {
    position: absolute;
    bottom: 15px;
    right: 20px;
    width: 20px;
    height: 10px;
    background: rgba(108, 117, 125, 0.4);
    border-radius: 50%;
    animation: exhaust-fade 2s ease-out infinite;
}

@keyframes exhaust-fade {
    0% {
        opacity: 0.6;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(2) translateY(-20px);
    }
}

/* Oil Drop Animation */
.oil-drop {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 12px;
    background: #343a40;
    border-radius: 50% 50% 50% 0;
    animation: oil-drop-fall 3s ease-in infinite;
}

@keyframes oil-drop-fall {
    0% {
        top: 20px;
        opacity: 1;
    }
    100% {
        top: 80%;
        opacity: 0;
    }
}

/* Coal Smoke Animation */
.coal-smoke {
    position: absolute;
    bottom: 20px;
    left: 30%;
    width: 15px;
    height: 15px;
    background: rgba(108, 117, 125, 0.5);
    border-radius: 50%;
    animation: smoke-rise 4s ease-out infinite;
}

@keyframes smoke-rise {
    0% {
        bottom: 20px;
        opacity: 0.7;
        transform: scale(1);
    }
    100% {
        bottom: 80%;
        opacity: 0;
        transform: scale(2);
    }
}

/* Power Pulse Animation */
.power-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border: 2px solid #007bff;
    border-radius: 50%;
    animation: power-pulse-effect 2s ease-out infinite;
}

@keyframes power-pulse-effect {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
}

/* Footer Styles */
.tracker-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1.5rem;
    border-top: 1px solid #dee2e6;
    flex-wrap: wrap;
    gap: 1rem;
}

.total-capacity {
    font-size: 1.1rem;
    font-weight: 600;
    color: #007bff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.total-capacity i {
    font-size: 1.3rem;
    animation: solar-rotate 4s linear infinite;
}

@keyframes solar-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.update-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #6c757d;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: #28a745;
    border-radius: 50%;
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .sustainability-tracker {
        padding: 1.5rem;
        margin: 1rem 0;
    }
    
    .impact-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .impact-card {
        padding: 1rem;
    }
    
    .impact-value {
        font-size: 1.8rem;
    }
    
    .tracker-footer {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .total-capacity {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .tracker-header h3 {
        font-size: 1.4rem;
    }
    
    .impact-icon {
        font-size: 2rem;
    }
    
    .impact-value {
        font-size: 1.5rem;
    }
    
    .impact-unit {
        font-size: 0.8rem;
    }
}