/* 
   Oicanadian Weather - Bento Grid Design
   Full Width, Responsive, No Centering Hacks
*/

:root {
    --bg-dark: #0f172a;
    --text-main: #ffffff;
    --text-muted: #94a3b8;
    --accent: #38bdf8;
    --glass-bg: rgba(30, 41, 59, 0.7);
    /* Darker, more opaque for contrast */
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    width: 100%;
    /* PADDING IS THE KEY - No margins */
    padding: 20px;
    overflow-x: hidden;
}

/* Background Blobs */
.bg-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
}

.blob-1 {
    top: -20%;
    left: -20%;
    width: 60vw;
    height: 60vw;
    background: #3b82f6;
}

.blob-2 {
    bottom: -20%;
    right: -20%;
    width: 60vw;
    height: 60vw;
    background: #06b6d4;
}

/* --- GLASS PANEL UTILITY --- */
.glass-panel {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    backdrop-filter: blur(12px);
    box-shadow: var(--glass-shadow);
}

/* --- NAVBAR --- */
.navbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    margin-bottom: 25px;
    gap: 15px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo i {
    color: var(--accent);
}

.search-container {
    flex: 1;
    max-width: 400px;
    position: relative;
}

.search-box {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid transparent;
    transition: border-color 0.2s;
}

.search-box:focus-within {
    border-color: var(--accent);
}

.search-box input {
    background: transparent;
    border: none;
    color: white;
    width: 100%;
    outline: none;
    font-size: 1rem;
}

.search-results {
    position: absolute;
    top: 110%;
    left: 0;
    width: 100%;
    background: #1e293b;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    z-index: 100;
    display: none;
    overflow: hidden;
}

.search-result-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.search-result-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* --- BENTO GRID LAYOUT --- */
.bento-grid {
    display: grid;
    /* Auto-fit columns: min 300px, max 1fr */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    width: 100%;
}

/* Widget Styles */
.widget {
    padding: 25px;
    display: flex;
    flex-direction: column;
}

.widget h3 {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Widget 1: Hero */
.weather-hero {
    /* Spans 2 columns on large screens */
    grid-column: span 1;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.1) 0%, rgba(59, 130, 246, 0.1) 100%);
}

@media (min-width: 1000px) {
    .weather-hero {
        grid-column: span 2;
    }
}

.hero-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.location-badge {
    background: rgba(255, 255, 255, 0.1);
    padding: 5px 12px;
    border-radius: 20px;
    align-self: flex-start;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.main-temp {
    font-size: 4.5rem;
    font-weight: 700;
    line-height: 1;
}

.main-temp .unit {
    font-size: 2rem;
    color: var(--accent);
}

.condition-badge {
    font-size: 1.5rem;
    color: var(--text-muted);
}

.hero-icon {
    font-size: 5rem;
    color: var(--accent);
}

/* Widget 2: Details */
.details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.detail-card {
    background: rgba(255, 255, 255, 0.03);
    padding: 15px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.detail-card i {
    font-size: 1.2rem;
    color: var(--accent);
}

.detail-card .label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.detail-card .value {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
}

/* Widget 3: Hourly */
.hourly-forecast {
    grid-column: 1 / -1;
    /* Always full width */
}

.hourly-scroll {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.hourly-item {
    min-width: 90px;
    background: rgba(255, 255, 255, 0.03);
    padding: 15px 10px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.hourly-time {
    font-size: 0.9rem;
    color: var(--text-muted);
}

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

.hourly-temp {
    font-weight: 600;
}

/* Widget 4: Daily */
.daily-forecast {
    grid-column: span 1;
}

@media (min-width: 1000px) {
    .daily-forecast {
        grid-column: span 1;
    }

    /* Can be side by side with details if we want */
}

/* Let's make Daily full width on mobile, but side-by-side on desktop if we have space */
/* Actually, let's keep it simple: auto-flow */

.daily-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.daily-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
}

.daily-day {
    width: 80px;
    font-weight: 500;
}

.daily-icon {
    color: var(--accent);
}

.daily-temps {
    display: flex;
    gap: 15px;
}

.min-temp {
    color: var(--text-muted);
}

/* Responsive Adjustments */
@media (max-width: 600px) {
    .navbar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-container {
        max-width: 100%;
    }

    .weather-hero {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .hero-icon {
        align-self: flex-end;
        margin-top: -60px;
    }
}

/* --- POPULAR CITIES WIDGET --- */
.popular-cities {
    grid-column: span 1;
}

@media (min-width: 1200px) {
    .popular-cities {
        grid-column: span 2;
        /* Fill remaining space on wide screens */
    }
}

.cities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    /* Wider chips */
    gap: 15px;
}

.city-chip {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.city-chip:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--accent);
    transform: translateY(-2px);
}

.city-chip .city-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.city-chip .province {
    font-size: 0.8rem;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
}

/* --- SITE INFO WIDGET --- */
.site-info {
    grid-column: 1 / -1;
    /* Full width */
    gap: 30px;
}

.info-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.info-header h2 {
    font-size: 2rem;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.info-header p {
    font-size: 1.1rem;
    color: var(--text-muted);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

.feature-item {
    background: rgba(255, 255, 255, 0.03);
    padding: 25px;
    border-radius: 16px;
    text-align: center;
    transition: transform 0.3s ease, background 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.06);
}

.feature-icon {
    font-size: 2.5rem;
    color: var(--accent);
    margin-bottom: 20px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feature-item h4 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--text-main);
}

.feature-item p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.info-footer {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    font-style: italic;
}