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

:root {
    /* Color Palette */
    --color-primary: hsl(210, 100%, 56%);
    --color-primary-dark: hsl(210, 100%, 45%);
    --color-secondary: hsl(280, 70%, 60%);
    --color-accent: hsl(340, 82%, 60%);

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, hsl(210, 100%, 56%) 0%, hsl(280, 70%, 60%) 100%);
    --gradient-warm: linear-gradient(135deg, hsl(25, 95%, 60%) 0%, hsl(340, 82%, 60%) 100%);
    --gradient-cool: linear-gradient(135deg, hsl(200, 90%, 55%) 0%, hsl(240, 80%, 65%) 100%);

    /* Background */
    --bg-primary: hsl(220, 26%, 14%);
    --bg-secondary: hsl(220, 20%, 18%);
    --bg-card: hsl(220, 18%, 20%);
    --bg-card-hover: hsl(220, 18%, 23%);

    /* Text Colors */
    --text-primary: hsl(0, 0%, 98%);
    --text-secondary: hsl(220, 10%, 70%);
    --text-muted: hsl(220, 10%, 50%);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.3);

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    padding: var(--spacing-md);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header */
.header {
    background: var(--gradient-primary);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    animation: slideDown 0.8s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header-content {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.header-icon {
    font-size: 4rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
    color: white;
}

.subtitle {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
}

/* Card Styles */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

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

.card h2 {
    font-size: 1.8rem;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
    font-weight: 600;
}

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.info-card {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(147, 51, 234, 0.1) 100%);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    border: 1px solid rgba(59, 130, 246, 0.2);
    transition: all 0.3s ease;
}

.info-card:hover {
    transform: translateY(-4px);
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.2);
}

.info-icon {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-sm);
}

.info-card h3 {
    font-size: 1.2rem;
    margin-bottom: var(--spacing-xs);
    color: var(--color-primary);
}

.info-card p {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* Table Styles */
.table-container {
    overflow-x: auto;
    margin-top: var(--spacing-md);
    border-radius: var(--radius-md);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    overflow: hidden;
}

thead {
    background: var(--gradient-primary);
}

th {
    padding: var(--spacing-md);
    text-align: left;
    font-weight: 600;
    color: white;
    font-size: 1.1rem;
}

tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
}

tbody tr:hover {
    background: rgba(59, 130, 246, 0.1);
}

tbody tr:last-child {
    border-bottom: none;
}

td {
    padding: var(--spacing-md);
    color: var(--text-secondary);
    font-size: 1rem;
}

td:first-child {
    color: var(--text-primary);
    font-weight: 500;
}

td:last-child {
    color: var(--color-primary);
    font-weight: 600;
    font-size: 1.1rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.stat-card {
    background: var(--bg-secondary);
    padding: var(--spacing-lg);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-card:hover::before {
    opacity: 1;
}

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

.stat-mean {
    border-color: rgba(59, 130, 246, 0.3);
}

.stat-mean:hover {
    border-color: rgba(59, 130, 246, 0.6);
}

.stat-median {
    border-color: rgba(147, 51, 234, 0.3);
}

.stat-median:hover {
    border-color: rgba(147, 51, 234, 0.6);
}

.stat-mode {
    border-color: rgba(236, 72, 153, 0.3);
}

.stat-mode:hover {
    border-color: rgba(236, 72, 153, 0.6);
}

.stat-icon {
    font-size: 3rem;
    opacity: 0.8;
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
    font-weight: 500;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-unit {
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* Chart Section */
.chart-container {
    position: relative;
    height: 400px;
    margin-top: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

/* Trend Section */
.trend-content {
    margin-top: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--color-primary);
}

.trend-content p {
    margin-bottom: var(--spacing-sm);
    color: var(--text-secondary);
    line-height: 1.8;
}

.trend-content strong {
    color: var(--color-primary);
    font-weight: 600;
}

/* Conclusion Section */
.conclusion-content {
    display: grid;
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.conclusion-item {
    padding: var(--spacing-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--color-secondary);
    transition: all 0.3s ease;
}

.conclusion-item:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

.conclusion-item h3 {
    font-size: 1.2rem;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

.conclusion-item p {
    color: var(--text-secondary);
    line-height: 1.8;
}

/* Footer */
.footer {
    text-align: center;
    padding: var(--spacing-lg);
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: var(--spacing-xl);
}

/* Responsive Design */
@media (max-width: 768px) {
    .header h1 {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: 0.95rem;
    }

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

    .chart-container {
        height: 300px;
    }

    .stat-value {
        font-size: 2rem;
    }
}

/* Animations */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

/* Location Section */
.location-controls {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
    flex-wrap: wrap;
}

#locationInput {
    flex: 1;
    min-width: 250px;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-secondary);
    border: 2px solid rgba(59, 130, 246, 0.3);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
}

#locationInput:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn-primary {
    padding: var(--spacing-sm) var(--spacing-lg);
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Current Weather Display */
.current-weather {
    margin-top: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--color-primary);
}

.current-info h3 {
    color: var(--color-primary);
    font-size: 1.5rem;
    margin-bottom: var(--spacing-xs);
}

.current-temp {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: var(--spacing-sm) 0;
}

#currentCondition {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Loading Spinner */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl);
    gap: var(--spacing-md);
}

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

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

.loading-spinner p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Error Message */
.error-message {
    margin-top: var(--spacing-md);
    padding: var(--spacing-md);
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-md);
    color: rgb(252, 165, 165);
}

/* Prediction Section */
.prediction-note {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: var(--spacing-md);
    font-style: italic;
}

.prediction-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
    margin: var(--spacing-md) 0;
}

.algorithm-info {
    padding: var(--spacing-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--color-primary);
}

.algorithm-info h4 {
    color: var(--color-primary);
    font-size: 1rem;
    margin-bottom: var(--spacing-xs);
}

.algorithm-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Predictions Grid */
.predictions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
}

.prediction-card {
    background: var(--bg-secondary);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.prediction-card:hover {
    transform: translateY(-4px);
    border-color: var(--color-primary);
    box-shadow: var(--shadow-md);
}

.prediction-date {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: var(--spacing-xs);
}

.prediction-temp {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-primary);
    margin: var(--spacing-xs) 0;
}

.prediction-range {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.confidence-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-top: var(--spacing-xs);
}

.confidence-high {
    background: rgba(34, 197, 94, 0.2);
    color: rgb(134, 239, 172);
}

.confidence-medium {
    background: rgba(251, 191, 36, 0.2);
    color: rgb(253, 224, 71);
}

.confidence-low {
    background: rgba(239, 68, 68, 0.2);
    color: rgb(252, 165, 165);
}

/* Responsive Design Additions */
@media (max-width: 768px) {
    .location-controls {
        flex-direction: column;
    }

    #locationInput {
        min-width: 100%;
    }

    .predictions-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .prediction-temp {
        font-size: 1.5rem;
    }
}