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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

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

/* Header Styles */
header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 40px 0;
    text-align: center;
    position: relative;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 300;
}

.subtitle {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

.guiding-question {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 8px;
    max-width: 600px;
    margin: 0 auto;
}

.guiding-question h3 {
    margin-bottom: 10px;
    color: #ecf0f1;
}

.guiding-question p {
    font-size: 1.1rem;
    font-style: italic;
}

/* Language Toggle */
.language-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 5px;
}

.lang-btn {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.lang-btn.active {
    background: rgba(255, 255, 255, 0.9);
    color: #2c3e50;
}

/* Main Content */
main {
    padding: 40px 0;
}

/* Chart Section */
.chart-section {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 40px;
}

.chart-section h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
    font-size: 1.8rem;
    font-weight: 400;
}

.chart-container {
    position: relative;
    height: 400px;
    margin-bottom: 20px;
}

.chart-container.small {
    height: 300px;
}

.chart-caption {
    text-align: center;
    font-style: italic;
    color: #666;
    font-size: 0.9rem;
}

/* Tabs Navigation */
.tabs-nav {
    display: flex;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    overflow: hidden;
}

.tab-button {
    flex: 1;
    padding: 18px 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: #666;
    transition: all 0.3s ease;
    border-right: 1px solid #e9ecef;
}

.tab-button:last-child {
    border-right: none;
}

.tab-button:hover {
    background: #f8f9fa;
    color: #2c3e50;
}

.tab-button.active {
    background: #3498db;
    color: white;
}

/* Tab Content */
.tab-content-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

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

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

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

.tab-content h2 {
    color: #2c3e50;
    margin-bottom: 30px;
    font-size: 1.8rem;
    font-weight: 400;
    border-bottom: 3px solid #3498db;
    padding-bottom: 10px;
}

.tab-content h3 {
    color: #34495e;
    margin-bottom: 15px;
    font-size: 1.3rem;
    font-weight: 500;
}

.tab-content h4 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.1rem;
    font-weight: 600;
}

/* Content Grid - Stack vertically to avoid compression */
.content-grid {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-bottom: 30px;
}

.text-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.info-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.info-section p {
    margin-top: 10px;
    line-height: 1.7;
}

/* Image Placeholders - Full width for better visibility */
.image-placeholder {
    background: #e9ecef;
    border: 2px dashed #adb5bd;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    text-align: center;
    width: 100%;
}

.image-placeholder.large {
    min-height: 400px;
}

.image-placeholder img {
    max-width: 100%;
    max-height: 100%;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

/* Specific width classes for images */
.image-placeholder img.width-75 {
    width: 75%;
    height: auto;
    object-fit: contain;
}

/* Research Description */
.research-description {
    background: #e8f4f8;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
    border-left: 4px solid #3498db;
}

.research-description h3 {
    color: #2980b9;
    margin-bottom: 15px;
}

.research-description p {
    line-height: 1.7;
}

/* Data Tables - Full width */
.data-table-container {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    width: 100%;
    margin-bottom: 30px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.data-table th {
    background: #34495e;
    color: white;
    font-weight: 500;
}

.data-table tr:nth-child(even) {
    background: #f1f3f4;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.metric-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #e74c3c;
    text-align: center;
}

.metric-card h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.metric-card p {
    margin-bottom: 8px;
    font-size: 0.9rem;
}

/* Habitat Loss Section */
.habitat-loss-section {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    margin-top: 30px;
}

.habitat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.habitat-card {
    text-align: center;
    padding: 20px;
    border-radius: 8px;
    color: white;
    font-weight: 600;
}

.habitat-card.good {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
}

.habitat-card.fair {
    background: linear-gradient(135deg, #f39c12, #e67e22);
}

.habitat-card.poor {
    background: linear-gradient(135deg, #e67e22, #d35400);
}

.habitat-card.critical {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.percentage {
    font-size: 2rem;
    margin-bottom: 5px;
}

.year {
    font-size: 1rem;
    opacity: 0.9;
}

/* Findings Section */
.findings-section {
    background: #e8f5e8;
    padding: 25px;
    border-radius: 8px;
    margin-top: 30px;
    border-left: 4px solid #27ae60;
}

.findings-list {
    margin-top: 15px;
    padding-left: 20px;
}

.findings-list li {
    margin-bottom: 10px;
    line-height: 1.6;
}

/* Nest Data Container - Full width */
.nest-data-container {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    width: 100%;
}

.comparison-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.comparison-card {
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #e74c3c;
}

.comparison-card.unfenced {
    background: #fdf2f2;
    border-left-color: #e74c3c;
}

.comparison-card.fenced {
    background: #f0f9f0;
    border-left-color: #27ae60;
}

.comparison-card h4 {
    margin-bottom: 15px;
    color: #2c3e50;
}

.stat-highlight {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: #e74c3c;
}

.stat-highlight.success {
    color: #27ae60;
}

.comparison-card ul {
    list-style: none;
    padding: 0;
}

.comparison-card li {
    padding: 5px 0;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    font-size: 0.9rem;
}

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

/* Zoom Controls */
.zoom-controls {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 20px 0;
}

.zoom-btn {
    padding: 10px 20px;
    background: transparent;
    border: 2px solid #3498db;
    color: #3498db;
    border-radius: 24px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s, color 0.3s, box-shadow 0.3s;
}

.zoom-btn:hover {
    background: #3498db;
    color: #fff;
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.4);
}

.zoom-btn.active {
    background: #3498db;
    color: #fff;
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.6);
}

/* Footer */
footer {
    background: #2c3e50;
    color: white;
    padding: 40px 0;
    margin-top: 60px;
}

footer h3 {
    margin-bottom: 20px;
    color: #ecf0f1;
    user-select: none;
}

.sources-toggle h3:hover {
    color: #3498db;
    transition: color 0.3s ease;
}

.arrow {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.arrow.rotated {
    transform: rotate(180deg);
}

.sources {
    line-height: 1.8;
    transition: all 0.3s ease;
    overflow: hidden;
}

.sources p {
    margin-bottom: 15px;
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .tabs-nav {
        flex-direction: column;
    }
    
    .tab-button {
        border-right: none;
        border-bottom: 1px solid #e9ecef;
    }
    
    .tab-button:last-child {
        border-bottom: none;
    }
    
    .habitat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .comparison-cards {
        grid-template-columns: 1fr;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .tab-content {
        padding: 20px;
    }
    
    .chart-container {
        height: 300px;
    }
    
    .chart-container.small {
        height: 250px;
    }
}

@media (max-width: 480px) {
    header {
        padding: 20px 0;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .guiding-question {
        padding: 15px;
    }
    
    .habitat-grid {
        grid-template-columns: 1fr;
    }
    
    .chart-container {
        height: 250px;
    }
}
