/* ═══════════════════════════════════════════════════
   WEATHERHERE — AURORA PROFESSIONAL EDITION
   All class names synced exactly with scripts.js
   ═══════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600&family=DM+Mono:wght@400;500&display=swap');

/* ── TOKENS ── */
:root {
    --col-bg: #3f578ca1;
    --col-surface-1: rgba(13, 20, 38, 0.72);
    --col-surface-2: rgba(18, 28, 50, 0.55);
    --col-surface-3: rgba(10, 18, 32, 0.45);
    --col-border: rgba(120, 220, 160, 0.12);
    --col-border-md: rgba(120, 220, 160, 0.22);
    --col-border-hi: rgba(167, 139, 250, 0.38);

    --green: #34d87a;
    --green-dim: rgba(52, 216, 122, 0.12);
    --green-glow: rgba(52, 216, 122, 0.25);
    --violet: #a78bfa;
    --violet-dim: rgba(167, 139, 250, 0.13);
    --cyan: #67e8f9;

    --text-1: #eef4f0;
    --text-2: rgba(200, 235, 210, 0.65);
    --text-3: rgba(180, 220, 195, 0.38);

    --blur: blur(18px);
    --blur-sm: blur(8px);
    --radius: 18px;
    --shadow: 0 12px 40px rgba(0, 5, 20, 0.55), inset 0 1px 0 rgba(120, 220, 160, 0.07);
    --shadow-v: 0 8px 28px rgba(167, 139, 250, 0.2);
    --tr: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    --tr-fast: 0.15s ease;

    --font-body: 'DM Sans', sans-serif;
    --font-mono: 'DM Mono', monospace;
}



/* ── RESET ── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

img {
    display: block;
}

button {
    cursor: pointer;
    font-family: var(--font-body);
}

input {
    font-family: var(--font-body);
}

/* ── BODY ── */
body {
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-1);
    background-color: var(--col-bg);
    background-image:
        radial-gradient(ellipse 80% 60% at 0% 0%, rgba(18, 48, 78, 0.9) 0%, transparent 60%),
        radial-gradient(ellipse 70% 60% at 100% 0%, rgba(27, 89, 137, 0.638) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 50% 100%, rgba(18, 51, 172, 0.467) 0%, transparent 55%),
        radial-gradient(ellipse 40% 40% at 80% 60%, rgba(78, 78, 79, 0.5) 0%, transparent 50%);
    background-attachment: fixed;
    min-height: 100vh;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 50% 30% at 20% 30%, rgba(52, 216, 122, 0.04) 0%, transparent 60%),
        radial-gradient(ellipse 40% 25% at 75% 20%, rgba(167, 139, 250, 0.05) 0%, transparent 55%);
    animation: aurora-drift 18s ease-in-out infinite alternate;
    pointer-events: none;
    z-index: 0;
}

@keyframes aurora-drift {
    0% {
        opacity: 0.6;
        transform: translateY(0) scale(1);
    }

    100% {
        opacity: 1;
        transform: translateY(-18px) scale(1.04);
    }
}

/* ── HEADER ── */
.header {
    position: sticky;
    top: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 28px;
    height: 62px;
    background: rgba(7, 12, 23, 0.85);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border-bottom: 1px solid var(--col-border);
    justify-content: center;
}

.header-inner {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 1800px;
    gap: 16px;
}

.header>img {
    width: 36px;
    height: 36px;
    filter: drop-shadow(0 0 8px var(--green-glow));
    flex-shrink: 0;
}

.banner {
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0.05em;
    color: var(--green);
    text-shadow: 0 0 22px var(--green-glow);
    flex: 1;
    white-space: nowrap;
}

/* ── SEARCH ── */
.search-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

#searchBox {
    width: 240px;
    height: 38px;
    padding: 0 14px;
    background: rgba(15, 28, 22, 0.7);
    border: 1px solid var(--col-border-md);
    border-radius: 10px;
    color: var(--text-1);
    font-size: 14px;
    backdrop-filter: var(--blur-sm);
    transition: border-color var(--tr), box-shadow var(--tr);
    outline: none;
}

#searchBox::placeholder {
    color: var(--text-3);
}

#searchBox:focus {
    border-color: var(--col-border-hi);
    box-shadow: 0 0 0 3px var(--violet-dim), 0 0 18px rgba(167, 139, 250, 0.1);
}

#searchButton {
    height: 38px;
    padding: 0 20px;
    background: var(--violet);
    color: #0d0820;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    transition: background var(--tr), transform var(--tr), box-shadow var(--tr);
    box-shadow: 0 4px 16px rgba(167, 139, 250, 0.28);
}

#searchButton:hover {
    background: #c4b5fd;
    transform: translateY(-1px);
    box-shadow: 0 6px 22px rgba(167, 139, 250, 0.38);
}

#searchButton:active {
    transform: translateY(0);
}

/* ── TABS ── */
.tabs {
    display: inline-flex;
    gap: 2px;
    margin: 22px 28px 0;
    padding: 4px;
    background: rgba(10, 16, 28, 0.6);
    backdrop-filter: var(--blur-sm);
    border: 1px solid var(--col-border);
    border-radius: 10px;
}

.tab {
    position: relative;
    padding: 7px 24px;
    background: transparent;
    border: none;
    border-radius: 7px;
    color: var(--text-2);
    font-size: 13px;
    font-weight: 500;
    transition: color var(--tr), background var(--tr);
}

.tab:hover:not(.active) {
    color: var(--text-1);
    background: rgba(120, 220, 160, 0.06);
}

.tab.active {
    background: var(--violet-dim);
    color: var(--violet);
    box-shadow: 0 2px 12px rgba(167, 139, 250, 0.14);
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 25px;
    height: 2px;
    background: var(--violet);
    border-radius: 2px;
    opacity: 0.7;
}

/* ── MAIN ── */
main {
    position: relative;
    z-index: 1;
    padding: 20px 28px 40px;
    max-width: 1800px;
    margin: 0 auto;
    width: 100%;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fade-up 0.35s ease both;
}

@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── TODAY GRID ── */
#weatherDataContainer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

#weatherDataContainer .current-weather {
    grid-column: 1;
    grid-row: 1;
    border-radius: 16px;
}

#weatherDataContainer .nearby-places {
    grid-column: 2;
    grid-row: 1;
    border-radius: 16px;
}

#weatherDataContainer .hourly-forecast {
    grid-column: 1 / -1;
    grid-row: 2;
    border-radius: 16px;
}

/* ── 5-DAY GRID ── */
#fiveDayDataContainer {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    
}
#fiveDayDataContainer .hourly-forecast{
    border-radius: 16px;
}

/* ── BASE CARD ── */
.card {
    position: relative;
    background: var(--col-surface-1) !important;
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--col-border) !important;
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow);
    overflow: hidden;
    animation: fade-up 0.4s ease both;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 12px;
    right: 12px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(120, 220, 160, 0.18), rgba(167, 139, 250, 0.2), transparent);
    pointer-events: none;
}

.card:nth-child(1) {
    animation-delay: 0.05s;
}

.card:nth-child(2) {
    animation-delay: 0.12s;
}

.card:nth-child(3) {
    animation-delay: 0.19s;
}

/* ── CARD HEADER ── */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(120, 220, 160, 0.07);
}

.card-header .title {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.2em;
    color: var(--green);
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-header .title::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--green);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--green-glow);
    animation: pulse-dot 2.5s ease-in-out infinite;
}
/* remove line */
.current-weather .card-header {
    border-bottom: none;
}
.nearby-places .card-header {
    border-bottom: none;
}
.hourly-forecast .card-header {
    border-bottom: none;
}
@keyframes pulse-dot {

    0%,
    100% {
        opacity: 1;
        box-shadow: 0 0 6px var(--green-glow);
    }

    50% {
        opacity: 0.4;
        box-shadow: 0 0 14px var(--green-glow);
    }
}

.card-header .date {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-3);
    letter-spacing: 0.05em;
}

/* ── CURRENT WEATHER ── */
.current-main {
    background: var(--col-surface-2);
    border: 1px solid rgba(120, 220, 160, 0.08);
    border-radius: 14px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.weather-status {
    display: flex;
    align-items: center;
    gap: 14px;
}

.weather-status img {
    width: 68px;
    height: 68px;
    filter: drop-shadow(0 0 14px var(--green-glow));
    flex-shrink: 0;
}

img:not([src]),
img[src=""] {
    opacity: 0;
}

img[src].loaded {
    opacity: 1;
}

/* #locationName — JS sets this */
.weather-status h1 {
    font-size: 20px;
    font-weight: 500;
    color: var(--text-1);
    line-height: 1.3;
}

.temp-display {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

/* #temperature — JS sets innerHTML */
.temp-display h1 {
    font-family: var(--font-mono);
    font-size: 68px;
    font-weight: 400;
    color: var(--text-1);
    line-height: 1;
    letter-spacing: -0.03em;
}

.temp-display p {
    font-size: 11px;
    color: var(--text-3);
    padding-top: 8px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

/* #realFeel — inline span */
.temp-display p span {
    display: block;
    font-family: var(--font-mono);
    font-size: 22px;
    color: var(--violet);
    font-weight: 400;
    line-height: 1.2;
    margin-top: 4px;
    text-transform: none;
    letter-spacing: -0.01em;
}

.sun-times {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}

.sunRise,
.sunSet,
.duration {
    background: rgba(15, 28, 22, 0.6);
    border: 1px solid var(--col-border);
    border-radius: 10px;
    padding: 10px 12px;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.sunRise span,
.sunSet span,
.duration span {
    display: block;
    font-size: 15px;
    color: var(--green);
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    margin-top: 5px;
}

/* ── SKELETON ── */
.skeleton {
    background: linear-gradient(90deg,
            rgba(120, 200, 150, 0.05) 0%,
            rgba(167, 139, 250, 0.10) 50%,
            rgba(120, 200, 150, 0.05) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.8s ease-in-out infinite;
    border-radius: 8px;
    color: transparent !important;
    user-select: none;
}

.skeleton-icon {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: linear-gradient(90deg,
            rgba(120, 200, 150, 0.05) 0%,
            rgba(167, 139, 250, 0.10) 50%,
            rgba(120, 200, 150, 0.05) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.8s ease-in-out infinite;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ── HOURLY FORECAST ── */
.hourly-wrapper {
    display: flex;
    border-radius: 12px;
    border: 1px solid var(--col-border);
    overflow: hidden;
    background: transparent;
    box-shadow: none;

    
}

.hourly-labels {
    flex-shrink: 0;
    width: 118px;
    background: rgba(10, 18, 14, 0.6);
    border-right: 1px solid var(--col-border);
    
}

/* row-label1 = "TODAY" header */
.row-label1 {
    display: flex;
    align-items: center;
    padding: 0 16px;
    height: 62px;
    /* matches hourly-header-group height */
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.18em;
    color: var(--green);
    text-transform: uppercase;
    border-bottom: 1px solid var(--col-border);
    background: rgba(52, 216, 122, 0.05);
}

/* row-label = Forecast / Temp / RealFeel / Wind */
.row-label {
    display: flex;
    align-items: center;
    padding: 0 14px;
    height: 38px;
    font-size: 11px;
    color: var(--text-2);
    border-bottom: 1px solid rgba(120, 220, 160, 0.06);
}

.row-label:last-child {
    border-bottom: none;
}

/* ── HOURLY TIMELINE (scrollable) ── */
.hourly-timeline {
    display: flex;
    overflow-x: auto;
    flex: 1;
    width: 100%;
    background: rgba(8, 14, 26, 0.35);
    scrollbar-width: thin;
    scrollbar-color: rgba(167, 139, 250, 0.25) transparent;
}

.hourly-timeline::-webkit-scrollbar {
    height: 3px;
}

.hourly-timeline::-webkit-scrollbar-track {
    background: transparent;
}

.hourly-timeline::-webkit-scrollbar-thumb {
    background: rgba(167, 139, 250, 0.28);
    border-radius: 3px;
}

/* .hourly-column — created by JS */
.hourly-column {
    flex: 1;
    min-width: 100px;
    border-right: 1px solid rgba(120, 220, 160, 0.05);
    transition: background var(--tr);
    display: flex;
    flex-direction: column;
}

.hourly-column:last-child {
    border-right: none;
}

.hourly-column:hover {
    background: rgba(120, 220, 160, 0.04);
}

.hourly-header-group {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 62px;
    padding: 8px 4px;
    border-bottom: 1px solid rgba(120, 220, 160, 0.06);
    background: rgba(26, 39, 32, 0.096);

}

/* .time-text — the hour label */
.time-text {
    font-family: var(--font-mono);
    font-size: 13px;
    margin-top: 5px;
    color: var(--green);
    letter-spacing: 0.05em;
    text-align: center;
}

/* .icon-box — weather icon wrapper */
.icon-box img {
    width: 40px;
    height: 40px;
}

/* .hourly-data — the data rows */
.hourly-data {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    font-size: 13px;
    color: var(--text-2);
    border-bottom: 1px solid rgba(120, 220, 160, 0.05);
    text-align: center;
    padding: 0 4px;
}

.hourly-data:last-child {
    border-bottom: none;
}

.hourly-data.desc {
    font-size: 13px;
    color: var(--cyan);
}

.hourly-data.temp {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-1);
    font-weight: 500;
}

.hourly-data.feel {
    color: var(--violet);
}

.hourly-data.wind {
    color: var(--cyan);
    font-size: 11px;
}

/* ── NEARBY PLACES ── */
.nearby-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

/* .place-item — created by JS */
.place-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--col-surface-3);
    border: 1px solid var(--col-border);
    border-radius: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background var(--tr), border-color var(--tr), transform var(--tr);
}

.place-item:hover {
    background: var(--green-dim);
    border-color: var(--col-border-md);
    transform: translateX(4px);
}

.place-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-1);
}

/* .place-weather — icon + temp wrapper */
.place-weather {
    display: flex;
    align-items: center;
    gap: 6px;
}

.place-weather img {
    width: 32px;
    height: 32px;
    filter: drop-shadow(0 0 6px var(--green-glow));
    position: relative;
}

.place-temp {
    font-family: var(--font-mono);
    font-size: 18px;
    font-weight: 500;
    color: var(--green);
    letter-spacing: -0.02em;
}

/* ── 5-DAY CARDS ── */
.five-day-cards-container {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
    padding: 25px;
    background: var(--col-surface-1);
    border-radius: 16px;
    border: 1px solid var(--col-border);
}

.day-card {
    position: relative;
    background: rgba(120, 220, 160, 0.05);
    border: 1px solid var(--col-border);
    border-radius: 16px;
    padding: 16px 10px;
    text-align: center;
    cursor: pointer;
    transition: transform var(--tr), background var(--tr), border-color var(--tr), box-shadow var(--tr);
    overflow: hidden;
}

.day-card:nth-child(1) {
    animation-delay: 0.05s;
}

.day-card:nth-child(2) {
    animation-delay: 0.10s;
}

.day-card:nth-child(3) {
    animation-delay: 0.15s;
}

.day-card:nth-child(4) {
    animation-delay: 0.20s;
}

.day-card:nth-child(5) {
    animation-delay: 0.25s;
}

.day-card:nth-child(6) {
    animation-delay: 0.30s;
}

.day-card:nth-child(7) {
    animation-delay: 0.35s;
}

/* THE HOVER EFFECT */
.day-card:hover:not(.active) {
    background-color: var(--green-dim);
    border-color: var(--violet);
    transform: translateY(-10px);
    box-shadow: 0 10px 25px rgba(167, 139, 250, 0.15);
}

.day-card:hover img {
    transform: scale(1.15) translateY(-5px);
    filter: drop-shadow(0 0 10px var(--green-glow));
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.day-card.active {
    background: rgba(45, 107, 151, 0.391);
    border-color: var(--violet);
    transform: translateY(-10px);
    box-shadow: var(--shadow-v);
}

.card-day {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.16em;
    color: var(--violet);
    margin-bottom: 4px;
}

/* .card-date — date e.g. APR 19 */
.card-date {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-2);
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}

/* icon img inside day-card */
.day-card img {
    width: 40px;
    height: 40px;
    margin: 0 auto 8px;
    filter: drop-shadow(0 2px 8px rgba(52, 216, 122, 0.2));
}

/* .card-temp — temperature */
.card-temp {
    font-family: var(--font-mono);
    font-size: 18px;
    font-weight: 500;
    color: var(--text-1);
    line-height: 1;
}

/* .card-desc — weather description */
.card-desc {
    font-size: 13px;
    color: var(--text-2);
    margin-top: 6px;
    line-height: 1.4;
}

/* ── ERROR VIEW ── */
#errorView {
    display: flex;
    align-items: center;
    justify-content: center;
}

#errorView.hidden {
    display: none !important;
}

.error-card {
    background: var(--col-surface-1);
    border: 1px solid var(--col-border);
    border-radius: 24px;
    padding: 60px 40px;
    text-align: center;
    width: 100%;
    box-shadow: var(--shadow);
    backdrop-filter: var(--blur);
    animation: fade-up 0.4s ease both;
}

.error-404-graphic {
    margin-bottom: 24px;
}

.error-404-graphic img {
    width: 300px;
    margin: 0 auto;
    opacity: 1;
    filter: hue-rotate(245deg) saturate(0.55) brightness(0.9);
}

.error-message {
    font-size: 20px;
    font-weight: 500;
    color: var(--text-1);
    margin-bottom: 10px;
    line-height: 1.4;
}

.error-message span {
    color: var(--violet);
}

.error-subtext {
    font-size: 14px;
    color: var(--text-3);
}

/* ── UTILITY ── */
.hidden {
    display: none !important;
}

/* ── RESPONSIVE & SCREEN OPTIMIZATIONS ── */

/* 1. Large Screens (Desktop Standard) */
@media (min-width: 1200px) {
    main {
        max-width: 95%;
    }

    #weatherDataContainer {
        grid-template-columns: 1.2fr 0.8fr;
        gap: 24px;
    }

    .card {
        padding: 30px;
    }

    /* Force hourly columns to fill the full width of the card */
    .hourly-timeline {
        overflow-x: hidden;
    }

    .hourly-column {
        flex: 1;
    }

    .five-day-cards-container {
        gap: 20px;
    }
}

/* 2. Extra Large / Ultra Wide (Professional View) */
@media (min-width: 1600px) {
    :root {
        --radius: 24px;
    }

    main {
        max-width: 1800px;
        /* Limits growth slightly so lines aren't too long to read */
    }

    .temp-display h1 {
        font-size: 84px;
    }

    .hourly-column {
        min-width: 120px;
    }
}

/* 3. Mid-range Tablets */
@media (max-width: 960px) {
    #weatherDataContainer {
        grid-template-columns: 1fr;
    }

    #weatherDataContainer .current-weather,
    #weatherDataContainer .nearby-places,
    #weatherDataContainer .hourly-forecast {
        grid-column: 1;
        grid-row: auto;
    }

    .five-day-cards-container {
        grid-template-columns: repeat(6, 1fr);
    }

    /* Re-enable scroll for smaller containers */
    .hourly-timeline {
        overflow-x: auto;
    }
}

/* 4. Small Tablets / Large Phones */
@media (max-width: 640px) {
    .header {
        flex-wrap: wrap;
        height: auto;
        padding: 12px 12px;
        gap: px;
    }

    .banner {
        font-size: 13px;
    }

    .search-container {
        width: 100%;
        order: 3;
    }

    #searchBox {
        flex: 1;
        width: auto;
    }

    main {
        padding: 16px 16px 32px;
    }

    .tabs {
        margin: 16px 16px 0;
    }

    .card {
        padding: 18px 16px;
    }

    .current-main {
        padding: 16px;
    }

    .temp-display h1 {
        font-size: 52px;
    }

    .sun-times {
        grid-template-columns: 1fr;
    }

    .hourly-labels {
        width: 96px;
    }

    .five-day-cards-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 5. Small Phones */
@media (max-width: 420px) {
    .header {
        flex-wrap: wrap;
        height: auto;
        padding: 12px 12px;
        gap: 3px;
    }

    .search-container {
        order: 3;
        width: 100%;
    }

    .five-day-cards-container {
        grid-template-columns: repeat(2, 1fr);
    }
}
