/* Reset et variables */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #007e76;
    --secondary-color: #00514c;
    --accent-color: #e61e27;
    --text-dark: #13093d;
    --text-light: #4a5568;
    --bg-light: #f4e5a2;
    --bg-white: #ffffff;
    --border-color: #e2e8f0;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-light);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.site-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #00514c 100%);
    color: white;
    padding: 2rem 0;
    box-shadow: var(--shadow);
}

.site-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.site-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Header Flex Layout */
.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Bouton Retour à la carte */
.btn-back-map {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-back-map:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}




/* Main content */
.main-content {
    padding: 2rem 0;
    min-height: calc(100vh - 200px);
}

/* Country selector */
.country-selector {
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.country-selector label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

#country-select {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

#country-select:hover {
    border-color: var(--primary-color);
}

#country-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(44, 82, 130, 0.1);
}

/* Loading */
.loading {
    text-align: center;
    padding: 3rem;
}

.spinner {
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

/* Country header */
.country-header {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.country-name {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.country-meta {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.meta-item {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Indicators grid */
.indicators-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.indicator-card {
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.indicator-label {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.indicator-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Section box */
.section-box {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.section-title {
    font-size: 1.3rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

/* Two columns */
.two-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.stat-highlight {
    text-align: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, #007e76 0%, #00514c 100%);
    color: white;
    border-radius: 8px;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.stat-unit {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Charts */
.charts-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.chart-container {
    position: relative;
}

.chart-container-large {
    position: relative;
    height: 400px;
}

.chart-note {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 0.5rem;
    font-style: italic;
}

/* Scores */
.scores-grid {
    display: grid;
    gap: 1.5rem;
}

.score-card {
    padding: 1rem;
}

.score-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.score-bar {
    height: 24px;
    background: var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.score-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary-color), var(--accent-color));
    transition: width 0.6s ease;
    border-radius: 12px;
}

.score-value {
    font-weight: 600;
    color: var(--primary-color);
}

/* Trade */
.trade-box {
    padding: 1rem;
    background: var(--bg-light);
    border-radius: 6px;
}

.trade-box h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.trade-details {
    font-size: 0.95rem;
    line-height: 1.8;
}

/* Policy */
.policy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.policy-card {
    padding: 1.5rem;
    background: var(--bg-light);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.policy-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.policy-card h4 {
    color: var(--primary-color);
    margin-bottom: 0.75rem;
}

.policy-card p {
    color: var(--text-light);
}

/* Analysis */
.analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.analysis-card {
    padding: 1.5rem;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 8px;
}

.analysis-card h4 {
    color: var(--primary-color);
    margin-bottom: 0.75rem;
}

.analysis-card p {
    color: var(--text-light);
}

/* Focus box */
.focus-box {
    padding: 1.5rem;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border-radius: 8px;
}

.focus-box h4 {
    margin-bottom: 0.75rem;
}

/* Quote */
.quote-box {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1a365d 100%);
    color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
    text-align: center;
}

.quote-box blockquote {
    font-size: 1.3rem;
    font-style: italic;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.quote-box cite {
    font-size: 0.95rem;
    opacity: 0.9;
}

/* Methodology note */
.methodology-note {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid var(--secondary-color);
}

.methodology-note p {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.6;
}

/* Footer */
.site-footer {
    background: var(--text-dark);
    color: white;
    padding: 2rem 0;
    text-align: center;
    margin-top: 3rem;
}

.site-footer p {
    margin-bottom: 0.5rem;
    opacity: 0.8;
}

/* Error message */
.error-message {
    background: #fed7d7;
    color: #c53030;
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    margin: 2rem 0;
}

/* Responsive */
@media (max-width: 768px) {
    .site-title {
        font-size: 1.5rem;
    }
    
    .site-subtitle {
        font-size: 0.95rem;
    }
	
	    .header-flex {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .btn-back-map {
        width: 100%;
        justify-content: center;
        margin-top: 1rem;
    }
    
    .country-name {
        font-size: 1.5rem;
    }
    
    .charts-row {
        grid-template-columns: 1fr;
    }
    
    .two-columns {
        grid-template-columns: 1fr;
    }
    
    .policy-grid,
    .analysis-grid {
        grid-template-columns: 1fr;
    }
    
    .quote-box blockquote {
        font-size: 1.1rem;
    }
}
