:root {
    --bg-color: #f8fafc;
    --text-color: #0f172a;
    --text-muted: #64748b;
    --card-bg: #ffffff;
    --card-border: #e2e8f0;
    --accent-color: #3b82f6;
    --accent-hover: #2563eb;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #0f172a;
        --text-color: #f8fafc;
        --text-muted: #94a3b8;
        --card-bg: #1e293b;
        --card-border: #334155;
        --accent-color: #60a5fa;
        --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
        --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4);
        --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5);
    }
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
    width: 100%;
    flex: 1;
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.125rem;
    margin-bottom: 1.5rem;
}

.search-container {
    max-width: 500px;
    margin: 0 auto;
    position: relative;
    z-index: 50;
}

.search-input {
    width: 100%;
    padding: 0.875rem 1.5rem;
    border-radius: 9999px;
    border: 1px solid var(--card-border);
    background-color: var(--card-bg);
    color: var(--text-color);
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.search-input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 0.5rem;
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    text-align: left;
}

.search-item {
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    border-bottom: 1px solid var(--card-border);
    transition: background-color 0.2s ease;
}

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

.search-item:hover {
    background-color: rgba(59, 130, 246, 0.05);
}

.search-item-name {
    font-weight: 600;
    display: block;
}

.search-item-details {
    font-size: 0.75rem;
    color: var(--text-muted);
}

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

.card {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

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

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.card-title {
    font-weight: 600;
    font-size: 1.125rem;
}

.model-badge {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--accent-color);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.main-temp {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.5rem;
    letter-spacing: -0.05em;
}

.feels-like {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

.day-range {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.range-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.65rem;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 500;
}

.range-badge.max {
    color: #dc2626;
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.range-badge.min {
    color: #2563eb;
    background-color: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

@media (prefers-color-scheme: dark) {
    .range-badge.max {
        color: #f87171;
        background-color: rgba(239, 68, 68, 0.15);
        border-color: rgba(239, 68, 68, 0.25);
    }
    .range-badge.min {
        color: #60a5fa;
        background-color: rgba(59, 130, 246, 0.15);
        border-color: rgba(59, 130, 246, 0.25);
    }
}

.range-arrow {
    font-weight: 700;
    font-size: 0.875rem;
    line-height: 1;
}

.range-label {
    opacity: 0.8;
    font-size: 0.75rem;
}

.range-value {
    font-weight: 600;
    font-size: 0.875rem;
}

.consensus-card .day-range {
    justify-content: center;
}

.details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid var(--card-border);
}

.detail-item {
    display: flex;
    flex-direction: column;
}

.detail-label {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.detail-value {
    font-weight: 500;
}

.consensus-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.consensus-card {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(59, 130, 246, 0.05) 100%);
    border-color: rgba(59, 130, 246, 0.2);
    max-width: 600px;
    margin: 0 auto;
}

.loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 0;
    color: var(--text-muted);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(59, 130, 246, 0.2);
    border-radius: 50%;
    border-top-color: var(--accent-color);
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.hidden {
    display: none !important;
}

.chart-section {
    margin-bottom: 3rem;
}

.chart-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.chart-container {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    height: 400px;
    width: 100%;
}

.daily-forecast-section {
    margin-bottom: 3rem;
}

.daily-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 600px;
    margin: 0 auto 1.5rem auto;
}

.daily-header h2 {
    font-size: 1.5rem;
    margin: 0;
}

.model-select {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--card-border);
    background-color: var(--card-bg);
    color: var(--text-color);
    font-family: inherit;
    font-size: 0.875rem;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s ease;
}

.model-select:focus {
    border-color: var(--accent-color);
}

.daily-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 600px;
    margin: 0 auto;
}

.daily-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 0.75rem;
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: background-color 0.2s ease;
}

.daily-item:hover {
    background-color: rgba(59, 130, 246, 0.05);
}

.daily-date {
    display: flex;
    flex-direction: column;
}

.daily-day-name {
    font-weight: 600;
    font-size: 1rem;
}

.daily-day-date {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.daily-extra {
    display: flex;
    gap: 1.5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    align-items: center;
}

.daily-extra-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.daily-temps {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.daily-max {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-color);
}

.daily-min {
    font-weight: 500;
    font-size: 1.125rem;
    color: var(--text-muted);
}

/* Tabs Styling */
.tabs {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.tab-btn {
    background-color: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    border-radius: 9999px;
    transition: all 0.2s ease;
    font-family: inherit;
}

.tab-btn:hover {
    color: var(--text-color);
    background-color: rgba(59, 130, 246, 0.05);
}

.tab-btn.active {
    background-color: var(--accent-color);
    color: white;
    box-shadow: var(--shadow-md);
}

.tab-pane {
    display: none;
    animation: fadeIn 0.3s ease;
}

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

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

.accuracy-rating {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(245, 158, 11, 0.02) 100%);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 1rem;
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
    animation: fadeIn 0.4s ease;
}

.accuracy-icon {
    font-size: 2rem;
    line-height: 1;
}

.accuracy-title {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.accuracy-winner {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-color);
}

footer {
    text-align: center;
    padding-top: 3rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

footer a {
    color: var(--accent-color);
    text-decoration: none;
}

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