/* ============================================================================
   Weather Dashboard — MD3 Redesign
   ============================================================================ */

.weather-page {
    min-height: 100vh;
    padding-bottom: 2rem;
}

/* ── Search Section ── */
.weather-search-section {
    padding: 1rem 0;
}

.weather-search-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.weather-search-box {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    background: var(--md-surface-container, #fff);
    border: 1px solid var(--md-outline-variant, #e0e0e0);
    border-radius: var(--radius-xl, 28px);
    padding: 0 0.5rem 0 1rem;
    height: 48px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.weather-search-box:focus-within {
    border-color: var(--md-primary, #1565C0);
    box-shadow: 0 0 0 2px var(--md-primary-container, #d0e4ff);
}

.weather-search-icon {
    font-size: 20px;
    color: var(--md-on-surface-variant, #666);
    flex-shrink: 0;
}

.weather-search-input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    padding: 0 0.75rem;
    font-size: 15px;
    color: var(--md-on-surface, #1a1a1a);
    height: 100%;
}

.weather-search-input::placeholder {
    color: var(--md-on-surface-variant, #999);
}

.weather-search-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: var(--radius-full, 50%);
    background: var(--md-primary, #1565C0);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s ease;
}

.weather-search-btn:hover {
    background: var(--md-primary-dark, #0d47a1);
}

.weather-search-btn .material-symbols-rounded {
    font-size: 20px;
}

.weather-gps-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    height: 48px;
    padding: 0 1.25rem;
    border: 1px solid var(--md-outline-variant, #e0e0e0);
    border-radius: var(--radius-xl, 28px);
    background: var(--md-surface, #fff);
    color: var(--md-primary, #1565C0);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.weather-gps-btn:hover {
    background: var(--md-primary-container, #d0e4ff);
    border-color: var(--md-primary, #1565C0);
}

.weather-gps-btn .material-symbols-rounded {
    font-size: 20px;
}

/* ── City Pills ── */
.weather-city-pills {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.75rem 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.weather-city-pills::-webkit-scrollbar {
    display: none;
}

.weather-pill {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full, 999px);
    background: var(--md-surface-container, #f0f0f0);
    color: var(--md-on-surface, #1a1a1a);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.weather-pill:hover {
    background: var(--md-surface-container-high, #e0e0e0);
}

.weather-pill-active {
    background: var(--md-primary, #1565C0);
    color: #fff;
    border-color: var(--md-primary, #1565C0);
}

.weather-pill-active:hover {
    background: var(--md-primary-dark, #0d47a1);
}

/* ── Hero Card ── */
.weather-hero {
    border-radius: var(--radius-2xl, 28px);
    padding: 2rem 1.5rem;
    margin: 0.5rem 0 1.5rem;
    color: #fff;
    position: relative;
    overflow: hidden;
}

@media (min-width: 768px) {
    .weather-hero { padding: 2.5rem 2rem; }
}

.weather-hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.weather-hero-info {
    flex: 1;
}

.weather-hero-location {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(8px);
    padding: 0.375rem 0.875rem;
    border-radius: var(--radius-full, 999px);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 1rem;
}

.weather-hero-location .material-symbols-rounded {
    font-size: 16px;
}

.weather-hero-temp {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.weather-hero-temp-value {
    font-size: 5rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -3px;
}

@media (max-width: 575.98px) {
    .weather-hero-temp-value { font-size: 3.5rem; letter-spacing: -2px; }
}

.weather-hero-temp-meta {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding-top: 0.5rem;
}

.weather-hero-desc {
    font-size: 1.125rem;
    font-weight: 600;
}

.weather-hero-feels,
.weather-hero-range {
    font-size: 0.8125rem;
    opacity: 0.85;
}

.weather-hero-svg {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
}

@media (min-width: 768px) {
    .weather-hero-svg { width: 160px; height: 160px; }
}

@media (max-width: 575.98px) {
    .weather-hero-svg { width: 90px; height: 90px; }
    .weather-hero-content { flex-direction: column; align-items: flex-start; }
    .weather-hero-svg { align-self: center; }
}

/* ── Stats Grid ── */
.weather-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.15);
}

@media (min-width: 768px) {
    .weather-stats-grid { grid-template-columns: repeat(6, 1fr); }
}

.weather-stat {
    text-align: center;
    padding: 0.875rem 0.5rem;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(8px);
    border-radius: var(--radius-lg, 16px);
    border: 1px solid rgba(255,255,255,0.1);
    transition: background 0.2s ease;
}

.weather-stat:hover {
    background: rgba(255,255,255,0.18);
}

.weather-stat .material-symbols-rounded {
    font-size: 22px;
    opacity: 0.9;
    margin-bottom: 0.375rem;
}

.weather-stat-value {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
}

.weather-stat-value small {
    font-size: 0.7em;
    font-weight: 400;
}

.weather-stat-label {
    font-size: 0.6875rem;
    opacity: 0.75;
    margin-top: 0.125rem;
}

/* ── Theme Gradients ── */
.weather-theme-day-clear { background: linear-gradient(135deg, #1565C0 0%, #1E88E5 50%, #42A5F5 100%); }
.weather-theme-dawn, .weather-theme-sunrise { background: linear-gradient(135deg, #4A148C 0%, #AB47BC 35%, #FF8F00 70%, #FFD54F 100%); }
.weather-theme-dusk, .weather-theme-sunset { background: linear-gradient(135deg, #4A148C 0%, #AD1457 35%, #E65100 70%, #FFD600 100%); }
.weather-theme-night-clear { background: linear-gradient(135deg, #000510 0%, #0D1B2A 50%, #1A237E 100%); }
.weather-theme-cloudy { background: linear-gradient(135deg, #37474F 0%, #455A64 50%, #90A4AE 100%); }
.weather-theme-rain { background: linear-gradient(135deg, #0D1B2A 0%, #1B2838 50%, #37474F 100%); }
.weather-theme-thunderstorm { background: linear-gradient(135deg, #060A10 0%, #1A237E 50%, #4A148C 100%); }
.weather-theme-snow { background: linear-gradient(135deg, #0277BD 0%, #29B6F6 50%, #81D4FA 100%); }
.weather-theme-fog { background: linear-gradient(135deg, #455A64 0%, #607D8B 50%, #B0BEC5 100%); }

/* ── SVG Animations ── */
@keyframes spinSun { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes pulseSun { 0%, 100% { transform: scale(1); opacity: 0.9; } 50% { transform: scale(1.06); opacity: 1; } }
@keyframes floatCloud { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(12px); } }
@keyframes fallRain { 0% { transform: translateY(-10px); opacity: 0; } 50% { opacity: 1; } 100% { transform: translateY(22px); opacity: 0; } }
@keyframes flashLightning { 0%, 90%, 100% { opacity: 0; } 92%, 96% { opacity: 1; } }
@keyframes pulseStar { 0%, 100% { opacity: 0.3; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1.2); } }

.svg-sun-rays { transform-origin: center; animation: spinSun 25s linear infinite; }
.svg-sun-core { animation: pulseSun 3s ease-in-out infinite; }
.svg-cloud { animation: floatCloud 6s ease-in-out infinite; }
.svg-cloud-secondary { animation: floatCloud 8s ease-in-out infinite reverse; }
.svg-drop-1 { animation: fallRain 1.2s linear infinite; animation-delay: 0s; }
.svg-drop-2 { animation: fallRain 1.2s linear infinite; animation-delay: 0.4s; }
.svg-drop-3 { animation: fallRain 1.2s linear infinite; animation-delay: 0.8s; }
.svg-lightning { animation: flashLightning 4s ease-in-out infinite; }
.svg-star-1 { animation: pulseStar 2s ease-in-out infinite; animation-delay: 0.2s; }
.svg-star-2 { animation: pulseStar 2.5s ease-in-out infinite; animation-delay: 0.7s; }
.svg-star-3 { animation: pulseStar 1.8s ease-in-out infinite; animation-delay: 1.1s; }

/* ── Weather Sections ── */
.weather-section {
    margin-bottom: 1.25rem;
}

.weather-card {
    background: var(--md-surface, #fff);
    border: 1px solid var(--md-outline-variant, #e0e0e0);
    border-radius: var(--radius-xl, 20px);
    padding: 1.25rem;
    transition: background 0.3s ease, border-color 0.3s ease;
}

@media (min-width: 768px) {
    .weather-card { padding: 1.5rem; }
}

.weather-card-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--md-on-surface, #1a1a1a);
    margin: 0 0 1rem;
}

.weather-card-title .material-symbols-rounded {
    font-size: 22px;
    color: var(--md-primary, #1565C0);
}

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

.weather-card-header .weather-card-title {
    margin: 0;
}

.weather-view-all {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 13px;
    font-weight: 500;
    color: var(--md-primary, #1565C0);
    text-decoration: none;
}

.weather-view-all:hover {
    text-decoration: underline;
}

.weather-view-all .material-symbols-rounded {
    font-size: 16px;
}

/* ── Hourly Forecast ── */
.weather-hourly-scroll {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: var(--md-outline-variant, #ccc) transparent;
    margin: 0 -0.25rem;
    padding: 0 0.25rem 0.5rem;
}

.weather-hourly-scroll::-webkit-scrollbar {
    height: 4px;
}

.weather-hourly-scroll::-webkit-scrollbar-thumb {
    background: var(--md-outline-variant, #ccc);
    border-radius: 2px;
}

.weather-hourly-item {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
    padding: 0.75rem 1rem;
    min-width: 72px;
    background: var(--md-surface-container-low, #f8f8f8);
    border-radius: var(--radius-lg, 14px);
    transition: background 0.2s ease;
}

.weather-hourly-item:hover {
    background: var(--md-surface-container-high, #eaeaea);
}

.weather-hourly-time {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--md-on-surface-variant, #666);
}

.weather-hourly-icon {
    font-size: 24px;
    color: var(--md-primary, #1565C0);
}

.weather-hourly-temp {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--md-on-surface, #1a1a1a);
}

/* ── Daily Forecast ── */
.weather-daily-list {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.weather-daily-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.875rem;
    background: var(--md-surface-container-low, #f8f8f8);
    border-radius: var(--radius-lg, 14px);
    transition: background 0.2s ease;
}

.weather-daily-item:hover {
    background: var(--md-surface-container-high, #eaeaea);
}

.weather-daily-day {
    min-width: 90px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--md-on-surface, #1a1a1a);
}

@media (max-width: 575.98px) {
    .weather-daily-day { min-width: 70px; font-size: 0.8125rem; }
}

.weather-daily-icon {
    font-size: 22px;
    color: var(--md-primary, #1565C0);
}

.weather-daily-desc {
    flex: 1;
    font-size: 0.8125rem;
    color: var(--md-on-surface-variant, #666);
    display: none;
}

@media (min-width: 576px) {
    .weather-daily-desc { display: block; }
}

.weather-daily-rain {
    display: inline-flex;
    align-items: center;
    gap: 0.125rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--md-primary, #0288d1);
    min-width: 48px;
    justify-content: flex-end;
}

.weather-daily-rain .material-symbols-rounded {
    font-size: 14px;
}

.weather-daily-rain-empty {
    min-width: 48px;
}

.weather-daily-temps {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 120px;
}

@media (max-width: 575.98px) {
    .weather-daily-temps { min-width: 100px; }
}

.weather-daily-min {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--md-on-surface-variant, #888);
    min-width: 28px;
    text-align: right;
}

.weather-daily-max {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--md-on-surface, #1a1a1a);
    min-width: 28px;
}

.weather-temp-bar {
    flex: 1;
    height: 4px;
    background: var(--md-outline-variant, #e0e0e0);
    border-radius: 2px;
    overflow: hidden;
    min-width: 40px;
}

.weather-temp-bar-fill {
    height: 100%;
    border-radius: 2px;
    background: linear-gradient(90deg, #42A5F5 0%, #EF5350 100%);
}

/* ── Local News ── */
.weather-news-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

@media (min-width: 576px) {
    .weather-news-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 992px) {
    .weather-news-grid { grid-template-columns: repeat(4, 1fr); }
}

.weather-news-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--md-surface-container-low, #f8f8f8);
    border-radius: var(--radius-lg, 14px);
    text-decoration: none;
    transition: background 0.2s ease;
}

.weather-news-item:hover {
    background: var(--md-surface-container-high, #eaeaea);
}

.weather-news-img {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border-radius: var(--radius-md, 10px);
    overflow: hidden;
    background: var(--md-surface-container-high, #e0e0e0);
}

.weather-news-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.weather-news-body {
    flex: 1;
    min-width: 0;
}

.weather-news-source {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--md-on-surface-variant, #666);
    margin-bottom: 0.25rem;
}

.weather-news-source img {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    object-fit: cover;
}

.weather-news-title {
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--md-on-surface, #1a1a1a);
    margin: 0 0 0.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.weather-news-time {
    font-size: 0.6875rem;
    color: var(--md-on-surface-variant, #888);
}

/* ── Attribution ── */
.weather-attribution {
    text-align: center;
    font-size: 0.75rem;
    color: var(--md-on-surface-variant, #888);
    padding: 1.5rem 0 0.5rem;
}

.weather-attribution a {
    color: var(--md-primary, #1565C0);
    text-decoration: none;
    font-weight: 500;
}

.weather-attribution a:hover {
    text-decoration: underline;
}

/* ── Search Dropdown ── */
.weather-search-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 1050;
    background: var(--md-surface, #fff);
    border: 1px solid var(--md-outline-variant, #e0e0e0);
    border-radius: var(--radius-lg, 16px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    max-height: 280px;
    overflow-y: auto;
}

.weather-search-dropdown .list-group-item {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--md-outline-variant, #f0f0f0);
    color: var(--md-on-surface, #1a1a1a);
    padding: 0.75rem 1rem;
}

.weather-search-dropdown .list-group-item:last-child {
    border-bottom: none;
}

.weather-search-dropdown .list-group-item:hover {
    background: var(--md-surface-container-low, #f8f8f8);
}

.weather-search-dropdown .list-group-item .fw-bold {
    color: var(--md-on-surface, #1a1a1a);
}

.weather-search-dropdown .list-group-item small {
    color: var(--md-on-surface-variant, #666);
}
