/* Global Styles */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --light-color: #ecf0f1;
    --dark-color: #2c3e50;
    --text-color: #333;
    --background-color: #f9f9f9;
    --card-background: #fff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
}

/* Typography */
h1, h2, h3, h4 {
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

h2 {
    font-size: 2rem;
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 0.5rem;
    margin-top: 2rem;
}

h3 {
    font-size: 1.5rem;
    color: var(--secondary-color);
}

p {
    margin-bottom: 1.2rem;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--secondary-color);
    margin-bottom: 2rem;
}

/* Layout */
header, footer {
    background-color: var(--primary-color);
    color: var(--light-color);
    text-align: center;
    padding: 2rem 0;
}

header h1, header p {
    color: var(--light-color);
}

nav {
    background-color: var(--secondary-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

nav ul {
    display: flex;
    justify-content: center;
    list-style: none;
    padding: 0;
}

nav ul li {
    margin: 0;
}

nav ul li a {
    display: block;
    color: white;
    text-decoration: none;
    padding: 1rem 1.5rem;
    transition: var(--transition);
}

nav ul li a:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

section {
    margin-bottom: 3rem;
    scroll-margin-top: 4rem;
}

footer {
    margin-top: 2rem;
    padding: 1.5rem;
    font-size: 0.9rem;
}

/* Charts and Data Visualization */
.chart-container {
    background-color: var(--card-background);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin: 2rem 0;
    height: 400px;
    position: relative;
}

.interactive-table {
    overflow-x: auto;
    margin: 2rem 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--card-background);
    box-shadow: var(--shadow);
    border-radius: 8px;
    overflow: hidden;
}

thead {
    background-color: var(--secondary-color);
    color: white;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

tbody tr:hover {
    background-color: rgba(52, 152, 219, 0.1);
}

/* Language Cards */
.language-details {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.language-card {
    background-color: var(--card-background);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 1.5rem;
    transition: var(--transition);
}

.language-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.language-card h3 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
}

/* Native Speakers Section */
.native-speakers-details {
    background-color: var(--card-background);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin: 2rem 0;
}

.native-speakers-details h3 {
    color: var(--secondary-color);
    margin: 1.5rem 0 1rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
}

.native-speakers-details h3:first-child {
    margin-top: 0;
}

.native-speakers-details p {
    margin-bottom: 1.2rem;
    line-height: 1.7;
}

/* Country Tabs */
.country-tabs {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    border-bottom: 1px solid #ddd;
}

.tab-button {
    background-color: transparent;
    border: none;
    padding: 1rem 1.5rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: var(--transition);
    color: var(--text-color);
}

.tab-button:hover {
    background-color: rgba(52, 152, 219, 0.1);
}

.tab-button.active {
    color: var(--secondary-color);
    border-bottom: 3px solid var(--secondary-color);
}

.country-content {
    display: none;
    padding: 1.5rem 0;
}

.country-content.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

/* Future Trends */
.trends-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.trend-card {
    background-color: var(--card-background);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 1.5rem;
    transition: var(--transition);
    border-top: 4px solid var(--secondary-color);
}

.trend-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.trend-card h3 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    nav ul {
        flex-direction: column;
    }
    
    nav ul li a {
        padding: 0.8rem 1rem;
    }
    
    .language-details, .trends-grid {
        grid-template-columns: 1fr;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.7rem;
    }
    
    .chart-container {
        height: 300px;
    }
    
    .country-tabs {
        overflow-x: auto;
        white-space: nowrap;
        display: flex;
        flex-wrap: nowrap;
    }
}

/* Custom Styles for Specific Elements */
#english-card { border-top: 4px solid #3498db; }
#chinese-card { border-top: 4px solid #e74c3c; }
#hindi-card { border-top: 4px solid #2ecc71; }
#spanish-card { border-top: 4px solid #f39c12; }
#french-card { border-top: 4px solid #9b59b6; }

/* Print Styles */
@media print {
    nav {
        display: none;
    }
    
    .chart-container {
        break-inside: avoid;
        page-break-inside: avoid;
    }
    
    body {
        background-color: white;
    }
    
    main {
        max-width: 100%;
    }
}
