@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

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

html {
    overflow-x: hidden;
}

body {
    background-color: #0f1117;
    background-image:
        radial-gradient(ellipse at 20% 0%, rgba(71, 85, 105, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(100, 116, 139, 0.02) 0%, transparent 50%);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: #a5abb8;
    font-family: 'Inter', 'Roboto', sans-serif;
    margin: 0;
    padding: 24px;
    min-height: 100vh;
    transition: background-image 1s ease;
    overflow-x: hidden;
    max-width: 100%;
}

/* ── Header Card ──────────────────────────────────────────── */
.header {
    text-align: center;
    margin: 0 auto 28px;
    max-width: 1200px;
}

#date-time-card {
    background: linear-gradient(135deg, rgba(26, 29, 38, 0.7) 0%, rgba(20, 22, 30, 0.8) 100%);
    border: 1px solid rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 4px;
    padding: 28px 32px 22px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

#day-time {
    font-size: 1.6em;
    font-weight: 600;
    color: #d4d7e0;
    margin: 0 0 6px;
    letter-spacing: -0.02em;
}

#temp-icon {
    font-size: 2.6em;
    margin: 8px 0 12px;
    color: #7f8ea3;
}

/* Astro strip ────────────── */
#astro-strip {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 10px auto 16px;
    max-width: 600px;
}

.astro-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 4px;
    padding: 6px 14px;
    font-size: 0.82em;
    color: #8b92a0;
    white-space: nowrap;
}

.astro-emoji {
    font-size: 1.1em;
    line-height: 1;
}

.astro-chip span {
    color: #9ca8bd;
    font-weight: 500;
}

#moon-icon {
    font-size: 1.1em !important;
}

/* Warning badges ────────────── */
#warning-blobs {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 18px 0 16px;
    flex-wrap: wrap;
}

.warning-badge {
    background-color: #5eab8a;
    min-width: 140px;
    height: 36px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #0f1117;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    position: relative;
    transition: box-shadow 0.3s ease, filter 0.3s ease;
    cursor: pointer;
    padding: 0 20px;
}

.warning-badge:hover {
    box-shadow: 0 0 14px rgba(94, 171, 138, 0.25);
    filter: brightness(1.08);
}

.warning-badge span {
    margin-left: 5px;
    font-size: 11px;
    color: #ffffff;
    background-color: #8b96b0;
    padding: 1px 7px;
    border-radius: 3px;
    position: absolute;
    right: -8px;
    top: -8px;
    font-weight: 600;
}

.warning-badge.red {
    background-color: #c75f6f;
}

.warning-badge.red:hover {
    box-shadow: 0 0 14px rgba(199, 95, 111, 0.25);
}

.warning-badge.yellow {
    background-color: #d4a564;
}

.warning-badge.yellow:hover {
    box-shadow: 0 0 14px rgba(212, 165, 100, 0.25);
}

.warning-badge.grey {
    background-color: #64748b;
}

/* Quick links nav ────────────── */
#quick-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    padding: 0;
}

#quick-links a {
    color: #6b7385;
    text-decoration: none;
    font-size: 0.72em;
    font-weight: 500;
    letter-spacing: 0.04em;
    transition: color 0.2s ease;
}

#quick-links a:hover {
    color: #8b96b0;
}

.link-dot {
    color: #4a5060;
    font-size: 0.9em;
    user-select: none;
}

/* ── Card Grid ────────────────────────────────────────────── */
.container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.card {
    background: linear-gradient(145deg, rgba(26, 29, 38, 0.65) 0%, rgba(18, 20, 28, 0.75) 100%);
    border: 1px solid rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 4px;
    padding: 22px 24px;
    color: #a5abb8;
    position: relative;
    transition: box-shadow 0.35s ease, border-color 0.35s ease;
    cursor: pointer;
    min-height: 140px;
    display: flex;
    align-items: center;
}

.card:hover {
    box-shadow:
        0 0 20px rgba(71, 85, 105, 0.06),
        0 8px 32px rgba(0, 0, 0, 0.2);
    border-color: rgba(127, 142, 163, 0.12);
}

.card-content {
    display: flex;
    align-items: center;
    gap: 20px;
    width: 100%;
}

.icon-container {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 4px;
    background: linear-gradient(135deg, rgba(71, 85, 105, 0.08) 0%, rgba(100, 116, 139, 0.05) 100%);
}

.info-container {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
}

.card i {
    color: #7f8ea3;
    font-size: 1.6em;
}

.card table {
    width: 100%;
    margin: 0;
    border-spacing: 0 5px;
}

.card table td:first-child {
    text-align: left;
    color: #6b7385;
    font-weight: 500;
    font-size: 0.88em;
}

.card table td:last-child {
    text-align: right;
    font-size: 1.25em;
    color: #d4d7e0;
    font-weight: 700;
    min-width: 50px;
}

.card .unit {
    color: #8b96b0;
    font-weight: 500;
    font-size: 0.8em;
}

#additional-info {
    font-size: 1.1em;
    color: #d4a564;
    margin-top: 8px;
}

/* ── Forecast ─────────────────────────────────────────────── */
#forecast-card-container {
    max-width: 1200px;
    margin: 24px auto 0;
    overflow-x: auto;
}

#forecast {
    margin-top: 0;
}

#forecast table {
    width: 100%;
    margin: 0 auto;
    table-layout: fixed;
    border-spacing: 10px;
}

#forecast td {
    padding: 18px;
    background: linear-gradient(145deg, rgba(26, 29, 38, 0.65) 0%, rgba(18, 20, 28, 0.75) 100%);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 4px;
    text-align: center;
    vertical-align: top;
    height: 150px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.forecast-header {
    font-size: 1.15em;
    color: #7f8ea3;
    margin-bottom: 10px;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.forecast-day,
.forecast-night {
    color: #8b92a0;
    font-size: 0.92em;
    line-height: 1.5;
}

.forecast-day {
    border-bottom: 1px solid rgba(71, 85, 105, 0.15);
    padding-bottom: 10px;
}

.forecast-night {
    border-top: 1px solid rgba(71, 85, 105, 0.12);
    padding-top: 10px;
}

/* ── Modal ────────────────────────────────────────────────── */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: linear-gradient(145deg, #181b22 0%, #12141a 100%);
    margin: auto;
    padding: 28px 32px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    width: 92%;
    max-width: 1300px;
    border-radius: 4px;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.02);
    max-height: 92vh;
    overflow-y: auto;
    position: relative;
    scrollbar-width: thin;
    scrollbar-color: #2a2e38 transparent;
}

.close-btn {
    position: absolute;
    top: 14px;
    right: 20px;
    color: #64748b;
    font-size: 28px;
    font-weight: 300;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    transition: color 0.2s ease, background 0.2s ease;
    z-index: 10;
    line-height: 1;
}

.close-btn:hover {
    color: #7f8ea3;
    background: rgba(71, 85, 105, 0.08);
}

/* Plot grid */
#plot-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(500px, 100%), 1fr));
    gap: 24px;
    justify-content: center;
}

.plot {
    background: rgba(24, 27, 34, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 4px;
    padding: 12px;
    width: 100%;
    min-height: 350px;
}

/* View selector buttons */
#view-selectors {
    text-align: center;
    margin-bottom: 24px;
    padding-top: 4px;
}

.view-btn {
    background: rgba(71, 85, 105, 0.12);
    color: #a5abb8;
    padding: 10px 24px;
    margin: 0 6px;
    border: 1px solid rgba(71, 85, 105, 0.15);
    border-radius: 3px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 0.85em;
    font-weight: 600;
    transition: all 0.25s ease;
}

.view-btn:hover {
    background: rgba(71, 85, 105, 0.18);
    border-color: rgba(127, 142, 163, 0.25);
    color: #b8bec9;
}

.view-btn.active {
    background: rgba(71, 85, 105, 0.22);
    border-color: rgba(127, 142, 163, 0.3);
    color: #cbd0da;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 960px) {
    .container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    body {
        padding: 12px;
    }

    .container {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    #date-time-card {
        padding: 20px 16px 18px;
    }

    #day-time {
        font-size: 1.2em;
    }

    #temp-icon {
        font-size: 2em;
    }

    #astro-strip {
        gap: 6px;
        font-size: 0.78em;
    }

    .card {
        border-radius: 4px;
        padding: 18px;
        min-height: auto;
    }

    .card i {
        font-size: 1.4em;
    }

    .card table td:last-child {
        font-size: 1.05em;
    }

    .icon-container {
        width: 44px;
        height: 44px;
        border-radius: 4px;
    }

    #quick-links {
        gap: 8px;
        font-size: 0.9em;
    }

    /* Modal mobile */
    .modal-content {
        width: 96%;
        padding: 18px 14px;
        border-radius: 4px;
    }

    #plot-container {
        grid-template-columns: 1fr;
    }

    .plot {
        width: 100% !important;
        height: auto !important;
    }

    .view-btn {
        padding: 8px 16px;
        font-size: 0.8em;
    }

    /* Forecast mobile */
    #forecast table {
        border-spacing: 6px;
    }

    #forecast tr {
        display: block;
        margin-bottom: 8px;
    }

    #forecast td {
        display: block;
        width: 100%;
        height: auto;
        margin-bottom: 8px;
    }
}

@media (min-width: 641px) and (max-width: 768px) {
    .plot {
        width: 90% !important;
        height: auto !important;
    }
}

/* ── Scrollbar styling ────────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #252830;
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2e323c;
}