/* ListBase.css - Minimal Design */

:root {
    --color-primary: #2563eb;
    --color-primary-hover: #1d4ed8;
    --color-text: #1f2937;
    --color-text-muted: #6b7280;
    --color-border: #e5e7eb;
    --color-bg: #ffffff;
    --color-bg-alt: #f9fafb;
    --color-bg-card: #ffffff;
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --max-width: 1200px;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 6px rgba(0,0,0,0.1);
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Base */
html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-family);
    color: var(--color-text);
    background: var(--color-bg-alt);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Container */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
.site-header {
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
    text-decoration: none;
}

.lang-selector {
    display: flex;
    gap: 0.25rem;
}

.lang-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: var(--radius);
    text-decoration: none;
    transition: background 0.2s;
}

.lang-link:hover {
    background: var(--color-bg-alt);
}

.lang-link.active {
    background: var(--color-primary);
    box-shadow: var(--shadow);
}

.lang-link .flag {
    display: block;
    border-radius: 2px;
}

/* Main */
main {
    flex: 1;
    padding: 2rem 0;
}

/* Footer */
.site-footer {
    background: var(--color-bg);
    border-top: 1px solid var(--color-border);
    padding: 1.5rem 0;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: var(--color-text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--color-primary);
}

/* Static Page */
.static-page {
    background: var(--color-bg);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.static-page .content {
    line-height: 1.8;
}

.static-page .content h2 {
    margin: 2rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-border);
}

.static-page .content h3 {
    margin: 1.5rem 0 0.75rem;
}

.static-page .content p {
    margin-bottom: 1rem;
}

.static-page .content ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.static-page .content li {
    margin-bottom: 0.5rem;
}

.static-page .content a {
    color: var(--color-primary);
}

.static-page .page-footer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.contact-form {
    margin: 1.5rem 0;
    border-radius: var(--radius);
    overflow: hidden;
}

.contact-form iframe {
    display: block;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

/* Breadcrumb */
.breadcrumb {
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.breadcrumb a {
    color: var(--color-primary);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb .separator {
    margin: 0 0.5rem;
}

/* Page Header */
.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.page-header .description {
    color: var(--color-text-muted);
    font-size: 1rem;
}

.page-header .stats {
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

/* Cards */
.cards {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-decoration: none;
    color: var(--color-text);
    transition: box-shadow 0.2s, border-color 0.2s;
    display: block;
}

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

/* Language Card */
.language-card {
    text-align: center;
}

.language-card .flag {
    display: block;
    margin: 0 auto 0.5rem;
    border-radius: 4px;
    box-shadow: var(--shadow);
}

.language-card .code {
    font-size: 1.25rem;
    font-weight: 600;
    text-transform: uppercase;
    display: block;
}

.language-card .native {
    color: var(--color-text-muted);
    display: block;
    margin-bottom: 0.5rem;
}

.language-card .count {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

/* Category Card */
.category-card {
    text-align: center;
}

.category-card .icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
}

.category-card h2 {
    font-size: 1.125rem;
    margin-bottom: 0.25rem;
}

.category-card .count {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

/* Dataset Card */
.dataset-card {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.dataset-card .thumbnail {
    width: 120px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.dataset-card .card-content {
    flex: 1;
    min-width: 0;
}

.dataset-card h2 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.dataset-card .description {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.dataset-card .meta {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

/* Dataset List (stacked) */
.dataset-list .card {
    margin-bottom: 1rem;
}

.dataset-list .cards {
    display: block;
}

/* Homepage */
.homepage .hero {
    text-align: center;
    padding: 3rem 0;
}

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

.homepage .tagline {
    font-size: 1.25rem;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
}

.homepage .stats {
    color: var(--color-text-muted);
}

.homepage .language-grid {
    max-width: 800px;
    margin: 0 auto;
}

.homepage .language-grid h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    border: 1px solid var(--color-border);
    background: var(--color-bg);
    color: var(--color-text);
    transition: background 0.2s, border-color 0.2s;
}

.btn:hover {
    background: var(--color-bg-alt);
    border-color: var(--color-text-muted);
}

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

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

/* Top Row - Download + Key Takeaways side by side */
.top-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 900px) {
    .top-row {
        grid-template-columns: 1fr;
    }
}

/* Download Section */
.download-section {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px solid var(--color-primary);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 0;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.download-thumbnail {
    margin-bottom: 1rem;
}

.download-thumbnail img {
    width: 100%;
    max-width: 280px;
    height: auto;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-lg);
}

.download-content {
    width: 100%;
}

.download-content h2 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
    color: var(--color-primary);
}

.download-buttons {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}

.download-buttons .btn {
    text-align: center;
    padding: 0.5rem 0.875rem;
    font-size: 0.9rem;
}

.download-buttons .btn small {
    font-size: 0.75rem;
    opacity: 0.8;
}

.download-buttons .btn i {
    margin-right: 0.35rem;
}

.download-buttons .btn .fa-file-excel {
    color: #217346;
}

.download-buttons .btn .fa-file-csv {
    color: #4285f4;
}

.download-buttons .btn .fa-file-pdf {
    color: #ea4335;
}

.download-buttons .btn-primary .fa-file-excel {
    color: white;
}

@media (max-width: 600px) {
    .download-thumbnail img {
        max-width: 200px;
    }

    .download-buttons {
        flex-direction: column;
    }

    .download-buttons .btn {
        width: 100%;
    }
}

/* Key Takeaways */
.key-takeaways {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 0;
}

.key-takeaways h2 {
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
}

.key-takeaways ul {
    list-style: none;
    padding-left: 0;
}

.key-takeaways li {
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
    position: relative;
}

.key-takeaways li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #10b981;
    font-weight: 600;
}

/* Table of Contents */
.toc-section {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.toc-section h2 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--color-text);
}

.toc-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.toc-item {
    display: inline-block;
}

.toc-link {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 9999px;
    font-size: 0.875rem;
    text-decoration: none;
    color: var(--color-text);
    background: var(--color-bg);
    transition: all 0.2s;
}

.toc-link:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.toc-link.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

.toc-count {
    font-size: 0.75rem;
    opacity: 0.7;
}

/* Data Section */
.data-section {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.table-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.search-box input {
    padding: 0.5rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 1rem;
    width: 250px;
    max-width: 100%;
}

.search-box input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.result-count {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

/* Table */
.table-wrapper {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    max-height: 70vh;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.875rem;
}

th, td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

th {
    background: var(--color-bg-alt);
    font-weight: 600;
    white-space: nowrap;
}

/* Sticky header row */
thead th {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 2;
}

/* Sticky first column */
td:first-child,
th:first-child {
    position: -webkit-sticky;
    position: sticky;
    left: 0;
    background: var(--color-bg-card);
    z-index: 1;
    box-shadow: inset -1px 0 0 var(--color-border);
}

th:first-child {
    background: var(--color-bg-alt);
}

/* Corner cell (header + first column) - highest z-index */
thead th:first-child {
    z-index: 3;
}

tbody tr:hover {
    background: var(--color-bg-alt);
}

tbody tr:hover td:first-child {
    background: var(--color-bg-alt);
}

tbody tr.hidden {
    display: none;
}

/* Use Cases */
.use-cases {
    margin-bottom: 2rem;
}

.use-cases h2 {
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
}

.use-cases ul {
    list-style: none;
    padding-left: 0;
}

.use-cases li {
    margin-bottom: 0.75rem;
    padding-left: 1.75rem;
    position: relative;
}

.use-cases li::before {
    content: "💡";
    position: absolute;
    left: 0;
    font-size: 0.9rem;
}

/* Dataset Footer */
.dataset-footer {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    border-top: 1px solid var(--color-border);
    padding-top: 1rem;
}

/* Download Page */
.download-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.download-box {
    text-align: center;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 3rem;
    max-width: 500px;
    width: 100%;
}

.download-box h1 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

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

@keyframes spin {
    to { transform: rotate(360deg); }
}

.download-box .filename {
    font-family: monospace;
    background: var(--color-bg-alt);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    word-break: break-all;
}

.ad-space {
    background: var(--color-bg-alt);
    border: 1px dashed var(--color-border);
    padding: 3rem;
    margin-bottom: 1.5rem;
    color: var(--color-text-muted);
}

.download-box .countdown {
    margin-bottom: 1.5rem;
    color: var(--color-text-muted);
}

.download-box .countdown span {
    font-weight: 600;
    color: var(--color-primary);
}

.back-link {
    margin-top: 1rem;
}

.back-link a {
    color: var(--color-text-muted);
    text-decoration: none;
}

.back-link a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .cards {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .dataset-card {
        flex-direction: column;
    }

    .dataset-card .thumbnail {
        width: 100%;
        height: 120px;
    }

    .table-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box input {
        width: 100%;
    }

    .result-count {
        text-align: center;
    }

    .download-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}

@media (min-width: 768px) {
    table {
        font-size: 1rem;
    }

    th, td {
        padding: 1rem 1.25rem;
    }
}
