/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Color Palette - Sustainability with Red Accents */
    --primary-green: #2d5a27;
    --secondary-green: #4a7c59;
    --accent-red: #c53030;
    --light-red: #fed7d7;
    --neutral-100: #f7fafc;
    --neutral-200: #edf2f7;
    --neutral-300: #e2e8f0;
    --neutral-400: #cbd5e0;
    --neutral-600: #718096;
    --neutral-800: #2d3748;
    --neutral-900: #1a202c;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--neutral-800);
    background: linear-gradient(135deg, var(--neutral-100) 0%, #f0f9ff 100%);
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--secondary-green) 100%);
    color: white;
    padding: var(--spacing-xl) 0;
    margin-bottom: var(--spacing-lg);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="2" fill="rgba(255,255,255,0.1)"/></svg>');
    opacity: 0.1;
}

.header-content {
    position: relative;
    z-index: 1;
}

.title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.leaf-icon {
    font-size: 2rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.subtitle {
    font-size: 1.125rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Navigation Styles */
.navigation {
    display: flex;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-lg);
    background: white;
    padding: var(--spacing-xs);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
}

.nav-btn {
    background: transparent;
    border: none;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    font-weight: 500;
    color: var(--neutral-600);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    min-width: fit-content;
}

.nav-btn:hover {
    background: var(--neutral-100);
    color: var(--neutral-800);
}

.nav-btn.active {
    background: var(--accent-red);
    color: white;
    box-shadow: var(--shadow-sm);
}

/* Main Content */
.main-content {
    min-height: 60vh;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.tab-content.active {
    display: block;
}

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

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.stat-card {
    background: white;
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    text-align: center;
    border-left: 4px solid var(--accent-red);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-red);
    margin-bottom: var(--spacing-xs);
}

.stat-label {
    color: var(--neutral-600);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
}

/* Chart Styles */
.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.chart-container {
    background: white;
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    position: relative;
}

.chart-container.full-width {
    grid-column: 1 / -1;
}

.chart-container h3 {
    color: var(--neutral-800);
    margin-bottom: var(--spacing-md);
    font-weight: 600;
    font-size: 1.125rem;
}

.chart-container canvas {
    max-height: 300px;
}

/* Report Cards */
.report-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.report-card {
    background: white;
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border-top: 3px solid var(--secondary-green);
}

.report-card h4 {
    color: var(--primary-green);
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
}

.report-card p {
    color: var(--neutral-600);
    font-size: 0.875rem;
    margin-bottom: var(--spacing-md);
}

.usage-bar {
    background: var(--neutral-200);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: var(--spacing-sm);
}

.usage-fill {
    background: linear-gradient(90deg, var(--accent-red), #e53e3e);
    height: 100%;
    border-radius: 4px;
    transition: width 0.8s ease;
}

.usage-percent {
    font-size: 0.875rem;
    color: var(--neutral-600);
    font-weight: 500;
}

/* Challenge Cards */
.challenges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

.challenge-card {
    background: white;
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.challenge-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--neutral-300);
}

.challenge-card.high::before {
    background: var(--accent-red);
}

.challenge-card.medium::before {
    background: #ed8936;
}

.challenge-card.low::before {
    background: var(--secondary-green);
}

.challenge-icon {
    font-size: 2rem;
    margin-bottom: var(--spacing-sm);
}

.challenge-card h4 {
    color: var(--neutral-800);
    margin-bottom: var(--spacing-sm);
    font-weight: 600;
}

.challenge-card p {
    color: var(--neutral-600);
    font-size: 0.875rem;
    margin-bottom: var(--spacing-md);
}

.challenge-stat {
    font-weight: 700;
    color: var(--accent-red);
    font-size: 1.125rem;
}

/* Insights */
.insights-card {
    background: white;
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--secondary-green);
    margin-top: var(--spacing-lg);
}

.insights-card h3 {
    color: var(--neutral-800);
    margin-bottom: var(--spacing-md);
    font-weight: 600;
}

.insights-card ul {
    list-style: none;
}

.insights-card li {
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--neutral-200);
    color: var(--neutral-700);
}

.insights-card li:last-child {
    border-bottom: none;
}

.insights-card li strong {
    color: var(--primary-green);
}

.insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.insight-card {
    background: white;
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border-top: 3px solid var(--accent-red);
}

.insight-icon {
    font-size: 2rem;
    margin-bottom: var(--spacing-md);
}

.insight-card h3 {
    color: var(--neutral-800);
    margin-bottom: var(--spacing-md);
    font-weight: 600;
    font-size: 1.125rem;
}

.insight-card ul {
    list-style: none;
}

.insight-card li {
    padding: var(--spacing-xs) 0;
    color: var(--neutral-700);
    position: relative;
    padding-left: var(--spacing-md);
}

.insight-card li::before {
    content: '•';
    color: var(--accent-red);
    position: absolute;
    left: 0;
}

/* Quote Section */
.quote-section {
    background: linear-gradient(135deg, var(--light-red) 0%, #fef5e7 100%);
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    margin-top: var(--spacing-xl);
    border-left: 4px solid var(--accent-red);
}

.quote-section blockquote {
    font-size: 1.125rem;
    font-style: italic;
    color: var(--neutral-800);
    margin-bottom: var(--spacing-md);
    line-height: 1.7;
}

.quote-section cite {
    color: var(--neutral-600);
    font-weight: 500;
    font-size: 0.875rem;
}

/* Footer */
.footer {
    margin-top: var(--spacing-xl);
    padding: var(--spacing-lg) 0;
    border-top: 1px solid var(--neutral-300);
    text-align: center;
    color: var(--neutral-600);
    font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 var(--spacing-sm);
    }
    
    .title {
        font-size: 2rem;
    }
    
    .chart-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .navigation {
        flex-wrap: wrap;
    }
    
    .challenges-grid {
        grid-template-columns: 1fr;
    }
    
    .insights-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .title {
        font-size: 1.75rem;
        flex-direction: column;
        text-align: center;
    }
    
    .chart-container {
        padding: var(--spacing-md);
    }
}

/* Loading and Animation States */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--neutral-300);
    border-top: 4px solid var(--accent-red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Accessibility Improvements */
.nav-btn:focus {
    outline: 2px solid var(--accent-red);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print Styles */
@media print {
    .navigation,
    .footer {
        display: none;
    }
    
    .container {
        max-width: none;
        padding: 0;
    }
    
    .chart-container {
        box-shadow: none;
        border: 1px solid var(--neutral-300);
    }
} 