/* ── Reset & Base ────────────────────────────────── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    min-height: 100vh;
    background: linear-gradient(160deg, #0d1b4b 0%, #1a3a7a 35%, #1e6fa5 65%, #3a9fd1 100%);
    background-attachment: fixed;
    color: #fff;
    -webkit-font-smoothing: antialiased;
}

/* ── Glass Utility ───────────────────────────────── */
.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 20px;
}

/* ── App Shell ───────────────────────────────────── */
.app {
    max-width: 620px;
    margin: 0 auto;
    padding: 0 16px 60px;
}

/* ── Search Section ──────────────────────────────── */
.search-section {
    text-align: center;
    padding: 52px 0 24px;
}

.app-title {
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 28px;
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.3);
}

.search-wrapper {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}

.search-bar:focus-within {
    background: rgba(255, 255, 255, 0.24);
    border-color: rgba(255, 255, 255, 0.55);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.25), 0 0 0 4px rgba(255, 255, 255, 0.08);
}

.search-icon {
    color: rgba(255, 255, 255, 0.65);
    font-size: 1rem;
    flex-shrink: 0;
}

.search-bar input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-size: 1rem;
    color: #fff;
    caret-color: rgba(255, 255, 255, 0.8);
}

.search-bar input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.clear-btn {
    display: none;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: 0.8rem;
    transition: background 0.2s, color 0.2s;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clear-btn:hover {
    background: rgba(255, 255, 255, 0.28);
    color: #fff;
}

/* ── Suggestions Dropdown ────────────────────────── */
.suggestions-list {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    list-style: none;
    background: rgba(10, 30, 80, 0.92);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 18px;
    overflow: hidden;
    z-index: 200;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    animation: fadeSlideDown 0.18s ease;
}

@keyframes fadeSlideDown {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.suggestions-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 20px;
    cursor: pointer;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    transition: background 0.15s;
}

.suggestions-list li:last-child {
    border-bottom: none;
}

.suggestions-list li:hover {
    background: rgba(255, 255, 255, 0.12);
}

.suggestions-list li i {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.85rem;
    width: 14px;
    text-align: center;
    flex-shrink: 0;
}

/* ── Loading ─────────────────────────────────────── */
.loading {
    text-align: center;
    padding: 56px 0;
}

.spinner {
    width: 42px;
    height: 42px;
    border: 3px solid rgba(255, 255, 255, 0.12);
    border-top-color: rgba(255, 255, 255, 0.75);
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
    margin: 0 auto 14px;
}

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

.loading-text {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.55);
}

/* ── Error ───────────────────────────────────────── */
.error-msg {
    text-align: center;
    padding: 24px;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.75);
    animation: fadeIn 0.3s ease;
}

.error-msg i {
    color: #ff8a80;
    margin-right: 8px;
}

/* ── Weather Section ─────────────────────────────── */
.weather-section {
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Current Weather Card ────────────────────────── */
.current-weather-card {
    padding: 28px 28px 24px;
    margin-bottom: 14px;
}

.location-info {
    margin-bottom: 16px;
}

.location-info h2 {
    font-size: 1.7rem;
    font-weight: 600;
    letter-spacing: -0.3px;
    line-height: 1.2;
}

.location-info p {
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 4px;
}

.main-weather {
    display: flex;
    align-items: center;
    gap: 4px;
}

.weather-icon-img {
    width: 90px;
    height: 90px;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
    flex-shrink: 0;
    margin-left: -10px;
}

.temp-block {
    flex: 1;
}

.temp-display {
    display: flex;
    align-items: flex-start;
    line-height: 1;
}

.temp {
    font-size: 5.5rem;
    font-weight: 200;
    letter-spacing: -4px;
}

.temp-unit {
    font-size: 2rem;
    font-weight: 300;
    margin-top: 12px;
    margin-left: 2px;
    color: rgba(255, 255, 255, 0.75);
}

.description {
    font-size: 1.05rem;
    text-transform: capitalize;
    color: rgba(255, 255, 255, 0.88);
    margin-top: 4px;
}

.feels-like {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.55);
    margin-top: 3px;
}

/* ── Stats Grid ──────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 14px;
}

.stat-card {
    padding: 18px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.stat-icon-wrap {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.stat-icon-wrap.blue   { background: rgba(116, 185, 255, 0.2); color: #74b9ff; }
.stat-icon-wrap.yellow { background: rgba(253, 203, 110, 0.2); color: #fdcb6e; }
.stat-icon-wrap.purple { background: rgba(162, 155, 254, 0.2); color: #a29bfe; }
.stat-icon-wrap.orange { background: rgba(255, 178, 102, 0.2); color: #ffb266; }
.stat-icon-wrap.teal   { background: rgba(85, 239, 196, 0.2);  color: #55efc4; }
.stat-icon-wrap.red    { background: rgba(255, 118, 117, 0.2); color: #ff7675; }

.stat-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.stat-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.55);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 500;
}

.stat-value {
    font-size: 1.15rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* UV severity color classes */
.uv-low    { color: #55efc4; }
.uv-mod    { color: #fdcb6e; }
.uv-high   { color: #e17055; }
.uv-vhigh  { color: #d63031; }
.uv-ext    { color: #a855f7; }

/* ── Forecast Section ────────────────────────────── */
.forecast-section {
    padding: 22px 22px 18px;
}

.forecast-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
}

.forecast-header i {
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.8rem;
}

.forecast-title {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: rgba(255, 255, 255, 0.55);
}

.forecast-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.forecast-scroll::-webkit-scrollbar {
    height: 3px;
}

.forecast-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.forecast-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.18);
    border-radius: 2px;
}

.forecast-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    min-width: 68px;
    padding: 12px 8px 10px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid transparent;
    transition: background 0.2s, border-color 0.2s;
    flex-shrink: 0;
    cursor: default;
}

.forecast-item:hover {
    background: rgba(255, 255, 255, 0.14);
}

.forecast-item.now {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.3);
}

.forecast-time {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
}

.forecast-item.now .forecast-time {
    color: #fff;
    font-weight: 700;
}

.forecast-icon {
    width: 38px;
    height: 38px;
}

.forecast-temp {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
}

.forecast-pop {
    font-size: 0.72rem;
    color: #74b9ff;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 3px;
}

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 440px) {
    .app-title { font-size: 1.75rem; }
    .temp      { font-size: 4.5rem; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat-value { font-size: 1rem; }
}
