/* China Data Portal - Singapore Style */

/* CSS Variables */
:root {
    --primary-color: #1a73e8;
    --primary-dark: #1557b0;
    --secondary-color: #34a853;
    --accent-color: #fbbc04;
    --text-primary: #202124;
    --text-secondary: #5f6368;
    --text-light: #80868b;
    --background: #ffffff;
    --background-light: #f8f9fa;
    --border-color: #dadce0;
    --border-light: #e8eaed;
    --shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    --shadow-hover: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);
    --font-family: 'Google Sans', 'Roboto', 'Helvetica Neue', sans-serif;
    --border-radius: 8px;
    --transition: all 0.2s ease-in-out;
}

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

body {
    font-family: var(--font-family);
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--background);
    margin: 0;
    padding: 0;
}

/* Header Styles */
.header {
    background: var(--background);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-light);
}

.header-brand .brand-link {
    text-decoration: none;
    color: var(--text-primary);
}

.brand-text {
    font-size: 24px;
    font-weight: 500;
    color: var(--primary-color);
}

.header-actions .btn {
    border-radius: 20px;
    padding: 8px 16px;
    font-weight: 500;
}

.header-nav {
    padding: 16px 0;
}

.nav-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 32px;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    padding: 8px 0;
    transition: var(--transition);
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -16px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e8f0fe 100%);
    padding: 80px 0;
    text-align: center;
}

.hero-title {
    font-size: 48px;
    font-weight: 400;
    line-height: 1.2;
    margin: 0 0 24px 0;
    color: var(--text-primary);
}

.hero-highlight {
    color: var(--primary-color);
    font-weight: 500;
}

.hero-subtitle {
    font-size: 20px;
    color: var(--text-secondary);
    margin: 0 0 40px 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-search {
    margin-bottom: 40px;
}

.search-container {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.search-input {
    width: 100%;
    padding: 16px 60px 16px 20px;
    border: 2px solid var(--border-color);
    border-radius: 24px;
    font-size: 16px;
    background: var(--background);
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.search-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-color);
    color: var(--background);
    border: none;
    border-radius: 20px;
    padding: 12px 16px;
    cursor: pointer;
    transition: var(--transition);
}

.search-btn:hover {
    background: var(--primary-dark);
}

.hero-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.category-tag {
    background: var(--background);
    color: var(--text-secondary);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}

.category-tag:hover {
    background: var(--primary-color);
    color: var(--background);
    border-color: var(--primary-color);
}

/* Stats Section */
.stats-section {
    padding: 60px 0;
    background: var(--background);
}

.stats-title {
    font-size: 32px;
    font-weight: 400;
    text-align: center;
    margin-bottom: 40px;
    color: var(--text-primary);
}

.agencies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.agency-card {
    display: flex;
    align-items: center;
    padding: 24px;
    background: var(--background);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius);
    transition: var(--transition);
    cursor: pointer;
}

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

.agency-logo {
    width: 48px;
    height: 48px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    flex-shrink: 0;
}

.agency-logo i {
    color: var(--background);
    font-size: 20px;
}

.agency-info h3 {
    font-size: 16px;
    font-weight: 500;
    margin: 0 0 8px 0;
    color: var(--text-primary);
}

.agency-stats {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.agency-stats .stat {
    font-size: 14px;
    color: var(--text-secondary);
}

.view-all {
    text-align: center;
}

/* Features Section */
.features-section {
    padding: 80px 0;
    background: var(--background-light);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 32px;
}

.feature-card {
    text-align: center;
    padding: 40px 24px;
    background: var(--background);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.feature-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-4px);
}

.feature-icon {
    width: 64px;
    height: 64px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.feature-icon i {
    color: var(--background);
    font-size: 24px;
}

.feature-card h3 {
    font-size: 20px;
    font-weight: 500;
    margin: 0 0 16px 0;
    color: var(--text-primary);
}

.feature-card p {
    color: var(--text-secondary);
    margin: 0 0 16px 0;
}

.feature-detail {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 24px !important;
}

.feature-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.feature-link:hover {
    text-decoration: underline;
}

/* Popular Datasets Section */
.popular-datasets {
    padding: 80px 0;
    background: var(--background);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.section-header h2 {
    font-size: 32px;
    font-weight: 400;
    margin: 0;
    color: var(--text-primary);
}

.time-filter {
    display: flex;
    gap: 8px;
}

.filter-btn {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    background: var(--background);
    color: var(--text-secondary);
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
}

.filter-btn.active,
.filter-btn:hover {
    background: var(--primary-color);
    color: var(--background);
    border-color: var(--primary-color);
}

.datasets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
    margin-bottom: 40px;
}

.dataset-card {
    padding: 20px;
    background: var(--background);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius);
    transition: var(--transition);
    cursor: pointer;
}

.dataset-card:hover {
    box-shadow: var(--shadow);
    border-color: var(--primary-color);
}

.dataset-info h3 {
    font-size: 16px;
    font-weight: 500;
    margin: 0 0 12px 0;
    color: var(--text-primary);
}

.dataset-stats {
    display: flex;
    gap: 16px;
}

.dataset-stats .stat {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Visualization Section */
.visualization-section {
    padding: 60px 0;
    background: var(--background-light);
}

.section-title {
    font-size: 32px;
    font-weight: 400;
    text-align: center;
    margin-bottom: 40px;
    color: var(--text-primary);
}

.chart-container {
    background: var(--background);
    padding: 32px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.data-summary {
    background: var(--background);
    padding: 24px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    height: fit-content;
}

.data-summary h4 {
    color: var(--primary-color);
    margin-bottom: 16px;
    font-size: 18px;
    font-weight: 500;
}

.summary-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.summary-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-color);
}

.data-table-container {
    background: var(--background);
    padding: 32px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.data-table-container h4 {
    color: var(--primary-color);
    margin-bottom: 16px;
    font-size: 18px;
    font-weight: 500;
}

/* Table Styles */
.table {
    margin-bottom: 0;
}

.table th {
    background-color: var(--background-light);
    color: var(--text-primary);
    font-weight: 500;
    border-bottom: 2px solid var(--primary-color);
    padding: 16px 12px;
    font-size: 14px;
}

.table td {
    padding: 12px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-light);
    font-size: 14px;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(26, 115, 232, 0.05);
}

/* Footer */
.footer {
    background: var(--text-primary);
    color: var(--background);
    padding: 60px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h4 {
    color: var(--background);
    margin-bottom: 16px;
    font-size: 18px;
    font-weight: 500;
}

.footer-section p {
    color: #b0b0b0;
    line-height: 1.6;
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section ul li a {
    color: #b0b0b0;
    text-decoration: none;
    transition: var(--transition);
}

.footer-section ul li a:hover {
    color: var(--background);
}

.footer-bottom {
    border-top: 1px solid #333;
    padding-top: 20px;
    text-align: center;
}

.footer-bottom p {
    color: #b0b0b0;
    margin: 0;
    font-size: 14px;
}

/* Loading States */
.spinner-border {
    width: 3rem;
    height: 3rem;
    border: 0.25rem solid var(--border-color);
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border 0.75s linear infinite;
}

@keyframes spinner-border {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 36px;
    }
    
    .hero-subtitle {
        font-size: 18px;
    }
    
    .nav-list {
        gap: 16px;
    }
    
    .agencies-grid {
        grid-template-columns: 1fr;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .datasets-grid {
        grid-template-columns: 1fr;
    }
    
    .section-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
    
    .hero-categories {
        justify-content: flex-start;
    }
}

@media (max-width: 576px) {
    .hero-section {
        padding: 40px 0;
    }
    
    .hero-title {
        font-size: 28px;
    }
    
    .hero-subtitle {
        font-size: 16px;
    }
    
    .search-input {
        padding: 12px 50px 12px 16px;
    }
    
    .agency-card {
        padding: 16px;
    }
    
    .feature-card {
        padding: 24px 16px;
    }
    
    .chart-container,
    .data-summary,
    .data-table-container {
        padding: 16px;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 1.5rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: var(--background);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 14px;
}