/* Modern CSS for CrUX Cache */

:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #3b82f6;
    --success: #10b981;
    --background: #ffffff;
    --surface: #f9fafb;
    --text: #1f2937;
    --text-secondary: #6b7280;
    --border: #e5e7eb;
    --shadow: rgba(0, 0, 0, 0.1);
    --radius: 12px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 2rem 1rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--background);
    border-radius: var(--radius);
    box-shadow: 0 20px 50px var(--shadow);
    overflow: hidden;
}

/* Header */
header {
    text-align: center;
    padding: 3rem 2rem 2rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

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

.tagline {
    font-size: 1.1rem;
    opacity: 0.95;
}

/* Main Content */
main {
    padding: 3rem 2rem;
}

/* Hero Section */
.hero {
    margin-bottom: 4rem;
}

.hero-content h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--text);
}

.hero-content > p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* Download Card */
.download-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    margin-top: 2rem;
}

.dataset-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.info-item .label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.info-item .value {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
}

/* Download Button */
.download-btn {
    width: 100%;
    padding: 1.25rem 2rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.download-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}

.download-btn:active:not(:disabled) {
    transform: translateY(0);
}

.download-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-icon {
    font-size: 1.5rem;
}

/* Progress */
.progress-container {
    margin-top: 1.5rem;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: var(--border);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--success) 100%);
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Info Section */
.info-section {
    margin-bottom: 4rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.info-box {
    padding: 1.5rem;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.info-box h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--primary);
}

.info-box p {
    color: var(--text-secondary);
    line-height: 1.7;
}

.info-box code {
    background: var(--background);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: var(--primary);
}

/* Browse Section */
.browse-section {
    padding: 2rem;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-bottom: 2rem;
}

.browse-section h2 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.browse-section > p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

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

.selector-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.selector-group label {
    font-weight: 600;
    color: var(--text);
    font-size: 0.95rem;
}

.dataset-select,
.month-select {
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: white;
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s ease;
}

.dataset-select:hover:not(:disabled),
.month-select:hover:not(:disabled) {
    border-color: var(--primary);
}

.dataset-select:focus,
.month-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.dataset-select:disabled,
.month-select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.selected-dataset-info {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.info-value {
    font-weight: 600;
    color: var(--text);
    font-size: 1rem;
}

.secondary-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.secondary-btn:hover:not(:disabled) {
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    background: var(--surface);
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

footer p {
    margin: 0.25rem 0;
}

footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

footer a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 1rem 0.5rem;
    }

    header h1 {
        font-size: 2rem;
    }

    .hero-content h2 {
        font-size: 1.5rem;
    }

    main {
        padding: 2rem 1.5rem;
    }

    .download-card {
        padding: 1.5rem;
    }

    .dataset-info {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .dataset-selector {
        grid-template-columns: 1fr;
    }

    .browse-section {
        padding: 1.5rem;
    }
}
