:root {
    --bg-gradient: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    /* Blue Gradient */
    --card-bg: rgba(255, 255, 255, 0.95);
    --text-primary: #1a1a1a;
    --text-secondary: #5a6268;
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.2);
    --font-stack: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    font-family: var(--font-stack);
    background: var(--bg-gradient);
    color: var(--text-primary);
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* Main "NUI" Card */
.container {
    background: var(--card-bg);
    width: 100%;
    max-width: 800px;
    /* Unifying PC width with legal pages */
    border-radius: 24px;
    padding: 30px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    min-height: 600px;
}

/* Header */
/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    gap: 15px;
}

.city-select {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    padding: 8px 15px;
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e3c72;
    cursor: pointer;
    outline: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    animation: fadeIn 0.2s ease;
}

.modal-content {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 24px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
    position: relative;
    animation: slideUp 0.3s ease;
    text-align: center;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 2rem;
    line-height: 1;
    color: var(--text-secondary);
    cursor: pointer;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Hourly Scroll */
.hourly-scroll {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    padding-bottom: 10px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE */
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}

.hourly-scroll.active {
    cursor: grabbing;
    scroll-snap-type: none;
}


.hourly-scroll::-webkit-scrollbar {
    display: none;
}

.hour-card {
    flex: 0 0 auto;
    width: 65px;
    height: 90px;
    background: #fff;
    border-radius: 14px;
    padding: 8px 4px;
    text-align: center;
    scroll-snap-align: start;
    border: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
}

.hour-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.hour-icon {
    font-size: 1.4rem;
    margin: 6px 0;
}

.hour-temp {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.hour-prob {
    font-size: 0.75rem;
    color: #3bf;
    /* Rain Blue */
    font-weight: 700;
    margin-top: 4px;
}

/* Tabs */
.tabs {
    display: flex;
    background: #eef2f5;
    padding: 5px;
    border-radius: 16px;
    margin-bottom: 30px;
}

.tab-btn {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    border-radius: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn.active {
    background: #fff;
    color: #1e3c72;
    /* Accent blue */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Hero Section */
.hero-card {
    text-align: center;
    padding: 20px 0 0;
}

.weather-icon-huge {
    font-size: 5rem;
    margin-bottom: 10px;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.text-huge {
    font-size: 5rem;
    font-weight: 800;
    line-height: 1;
    color: #2d3436;
}

#hero-temp {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}


.text-lg {
    font-size: 1.25rem;
    font-weight: 500;
    margin-top: 10px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: auto;
}

.stat-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 14px;
    text-align: left;
}

.stat-label {
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 700;
}

/* Week List */
.forecast-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.forecast-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    padding: 16px;
    border-radius: 16px;
    border: 1px solid #f0f0f0;
}

.forecast-day {
    flex: 1;
    font-weight: 600;
    color: #2d3436;
}

.forecast-icon {
    font-size: 1.5rem;
}

.forecast-temps {
    min-width: 80px;
    text-align: right;
}

/* View Control */
.view-section {
    display: none;
    animation: fadeUp 0.4s ease forwards;
}

.view-section.active {
    display: block;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Status */
.status-msg {
    text-align: center;
    color: var(--text-secondary);
    margin-top: 100px;
}

/* Standardized Warning Badge */
.warning-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 160px;
    height: 38px;
    padding: 0 20px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.95rem;
    /* Explicit size to override hero inherit */
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-bottom: 15px;
    gap: 8px;
    line-height: normal;
    text-shadow: none;
}

/* Tooltip for Warning Badge */
.warning-container {
    position: relative;
    display: inline-block;
    cursor: pointer;
    z-index: 100;
}

.warning-tooltip {
    visibility: hidden;
    width: 280px;
    background-color: var(--card-bg);
    /* Use theme bg for consistency */
    color: #333;
    text-align: left;
    border-radius: 12px;
    padding: 15px;
    position: absolute;
    z-index: 200;
    top: 125%;
    /* Position below */
    left: 50%;
    transform: translateX(-50%);
    /* Better centering */

    /* Style matches the modal alert box */
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(0, 0, 0, 0.1);

    font-size: 0.85rem;
    line-height: 1.4;
    font-weight: 400;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

/* Arrow */
.warning-tooltip::after {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    margin-left: -8px;
    border-width: 8px;
    border-style: solid;
    border-color: transparent transparent var(--card-bg) transparent;
}

.warning-container:hover .warning-tooltip {
    visibility: visible;
    opacity: 1;
}