:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --warm-gradient: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    --cool-gradient: linear-gradient(135deg, #30cfd0 0%, #330867 100%);

    --bg-dark: #0a0e27;
    --bg-card: rgba(255, 255, 255, 0.05);
    --bg-card-hover: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.5);

    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.3);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

.background-gradient {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at top, rgba(102, 126, 234, 0.15) 0%, transparent 60%),
        radial-gradient(ellipse at bottom, rgba(118, 75, 162, 0.15) 0%, transparent 60%);
    pointer-events: none;
    z-index: -1;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 0.6s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header-content {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2.5rem 2rem;
    box-shadow: var(--shadow-lg);
}

.title {
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.title-icon {
    font-size: 3rem;
    filter: drop-shadow(0 4px 8px rgba(102, 126, 234, 0.5));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 400;
    margin-bottom: 1rem;
}

.last-updated {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: var(--radius-lg);
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 1rem;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: #4facfe;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

/* Grid Layout */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

/* Location Card */
.location-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
    animation: fadeInUp 0.6s ease-out backwards;
    position: relative;
    overflow: visible;
}

.location-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-normal);
}

.location-card:hover::before {
    transform: scaleX(1);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.location-card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* Stagger animation for cards */
.location-card:nth-child(1) {
    animation-delay: 0.05s;
}

.location-card:nth-child(2) {
    animation-delay: 0.1s;
}

.location-card:nth-child(3) {
    animation-delay: 0.15s;
}

.location-card:nth-child(4) {
    animation-delay: 0.2s;
}

.location-card:nth-child(5) {
    animation-delay: 0.25s;
}

.location-card:nth-child(6) {
    animation-delay: 0.3s;
}

.location-card:nth-child(7) {
    animation-delay: 0.35s;
}

.location-card:nth-child(8) {
    animation-delay: 0.4s;
}

.location-card:nth-child(9) {
    animation-delay: 0.45s;
}

.location-card:nth-child(10) {
    animation-delay: 0.5s;
}

.card-header {
    margin-bottom: 1.5rem;
}

.location-name {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.location-code {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

.current-temp {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-md);
}

.temp-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.temp-value {
    font-size: 3rem;
    font-weight: 700;
    background: var(--warm-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.temp-range {
    display: flex;
    justify-content: space-around;
    margin-bottom: 1.5rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-md);
}

.range-item {
    text-align: center;
}

.range-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.range-value {
    font-size: 1.5rem;
    font-weight: 600;
}

.range-value.max {
    color: #fee140;
}

.range-value.min {
    color: #4facfe;
}

/* Chart Container */
.chart-container {
    position: relative;
    height: 200px;
    margin-top: 1rem;
}

.chart {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1px;
    padding: 0.5rem 0;
    position: relative;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: visible;
}

.chart::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border-color);
}

.bar-container {
    flex: 1 0 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.bar-container:hover {
    transform: translateY(-2px);
}

.bar {
    width: 100%;
    background: var(--primary-gradient);
    border-radius: 4px 4px 0 0;
    transition: all var(--transition-normal);
    position: relative;
    min-height: 4px;
    box-shadow: 0 -2px 8px rgba(102, 126, 234, 0.3);
}

.bar-container:hover .bar {
    filter: brightness(1.2);
    box-shadow: 0 -4px 16px rgba(102, 126, 234, 0.5);
}

.bar-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    text-align: center;
}

.bar-temp {
    font-size: 0.7rem;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

/* Tooltip */
.tooltip {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 14, 39, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition-fast);
    z-index: 10;
    box-shadow: var(--shadow-md);
}

.bar-container:hover .tooltip {
    opacity: 1;
}

.tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(10, 14, 39, 0.95);
}

/* Loading States */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 14, 39, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    z-index: 1000;
    transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(102, 126, 234, 0.2);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-overlay p {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
}

.footer a {
    color: #667eea;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.footer a:hover {
    color: #764ba2;
    text-decoration: underline;
}

.footer-note {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    opacity: 0.7;
}

/* Error State */
.error-message {
    background: rgba(245, 87, 108, 0.1);
    border: 1px solid rgba(245, 87, 108, 0.3);
    border-radius: var(--radius-md);
    padding: 1rem;
    color: #f5576c;
    text-align: center;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1.5rem 1rem;
    }

    .title {
        font-size: 2rem;
        flex-direction: column;
        gap: 0.5rem;
    }

    .title-icon {
        font-size: 2.5rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .temp-value {
        font-size: 2.5rem;
    }

    .bar-label {
        font-size: 0.6rem;
    }

    .bar-temp {
        font-size: 0.65rem;
    }
}

@media (min-width: 1200px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}