:root {
    --background: #050914;
    --panel: #0c1424;
    --panel-light: #111d31;
    --border: #24344d;
    --text: #f2f6ff;
    --muted: #8fa1ba;
    --accent: #62b7ff;
    --accent-bright: #8dd0ff;
    --gold: #ffd166;
    --success: #58d68d;
}

* {
    box-sizing: border-box;
}

html {
    color-scheme: dark;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Segoe UI", Arial, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 15% 0%, rgba(42, 84, 140, .22), transparent 32%),
        radial-gradient(circle at 85% 20%, rgba(57, 45, 115, .18), transparent 30%),
        linear-gradient(180deg, #050914 0%, #07101d 50%, #040812 100%);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: .45;
    background-image:
        radial-gradient(circle at 8% 18%, #fff 0 1px, transparent 1.4px),
        radial-gradient(circle at 21% 63%, #fff 0 1px, transparent 1.3px),
        radial-gradient(circle at 37% 26%, #fff 0 1px, transparent 1.3px),
        radial-gradient(circle at 54% 72%, #fff 0 1px, transparent 1.3px),
        radial-gradient(circle at 68% 14%, #fff 0 1px, transparent 1.3px),
        radial-gradient(circle at 83% 57%, #fff 0 1px, transparent 1.3px),
        radial-gradient(circle at 94% 31%, #fff 0 1px, transparent 1.3px);
}

.site-header {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 28px 5%;
    border-bottom: 1px solid rgba(116, 150, 195, .18);
    background: rgba(5, 10, 20, .72);
    backdrop-filter: blur(10px);
}

.site-header h1 {
    margin: 0;
    font-size: clamp(1.65rem, 3vw, 2.45rem);
    font-weight: 600;
    letter-spacing: .02em;
}

.subtitle {
    margin: 6px 0 0;
    color: var(--muted);
}

.status {
    display: flex;
    align-items: center;
    gap: 9px;
    white-space: nowrap;
    color: #c8d6e8;
    font-size: .9rem;
}

.status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 12px rgba(88, 214, 141, .8);
}

.dashboard {
    position: relative;
    z-index: 1;
    width: min(1400px, 92%);
    margin: 34px auto 60px;
}

.location-panel {
    display: grid;
    grid-template-columns: minmax(250px, 1fr) auto auto;
    align-items: end;
    gap: 14px;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(12, 20, 36, .88);
    box-shadow: 0 14px 40px rgba(0, 0, 0, .25);
}

.location-panel label {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.location-panel input {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border: 1px solid #334863;
    border-radius: 9px;
    outline: none;
    background: #08111f;
    color: var(--text);
    font-size: 1rem;
}

.location-panel input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(98, 183, 255, .12);
}

button {
    height: 46px;
    padding: 0 20px;
    border: 0;
    border-radius: 9px;
    cursor: pointer;
    background: linear-gradient(135deg, #2388db, #1763b4);
    color: white;
    font-weight: 600;
    font-size: .95rem;
}

button:hover {
    filter: brightness(1.1);
}

.secondary-button {
    border: 1px solid #36516f;
    background: #101d30;
}

.location-display {
    padding: 18px 4px 10px;
    color: var(--accent-bright);
    font-size: 1.05rem;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-top: 16px;
}

.astro-card,
.wide-card {
    border: 1px solid var(--border);
    background: linear-gradient(
        145deg,
        rgba(16, 29, 49, .95),
        rgba(8, 16, 29, .95)
    );
    box-shadow: 0 16px 35px rgba(0, 0, 0, .22);
}

.astro-card {
    position: relative;
    overflow: hidden;
    min-height: 255px;
    padding: 24px;
    border-radius: 16px;
}

.astro-card::after {
    content: "";
    position: absolute;
    width: 160px;
    height: 160px;
    right: -70px;
    top: -70px;
    border-radius: 50%;
    background: rgba(98, 183, 255, .06);
}

.card-icon {
    position: absolute;
    top: 18px;
    right: 22px;
    color: var(--gold);
    font-size: 2rem;
}

.astro-card h2,
.wide-card h2 {
    margin: 0;
    font-weight: 600;
}

.astro-card h2 {
    margin-bottom: 22px;
    font-size: 1.3rem;
}

.data-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    min-height: 42px;
    border-bottom: 1px solid rgba(107, 136, 174, .13);
}

.data-row:last-child {
    border-bottom: 0;
}

.data-row span {
    color: var(--muted);
}

.data-row strong {
    text-align: right;
    font-weight: 600;
}

.wide-card {
    margin-top: 18px;
    padding: 24px;
    border-radius: 16px;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 22px;
}

.section-heading h2 {
    font-size: 1.3rem;
}

.section-heading p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: .9rem;
}

#planetUpdate {
    color: var(--muted);
    font-size: .85rem;
}

.twilight-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.twilight-item {
    padding: 18px;
    border: 1px solid rgba(93, 127, 167, .18);
    border-radius: 11px;
    background: rgba(5, 13, 25, .55);
}

.twilight-item span {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: .86rem;
}

.twilight-item strong {
    font-size: 1.05rem;
}

.planet-table-wrapper {
    overflow-x: auto;
}

.planet-table {
    width: 100%;
    border-collapse: collapse;
}

.planet-table th {
    padding: 12px 14px;
    border-bottom: 1px solid #30435d;
    color: var(--muted);
    text-align: left;
    font-size: .8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.planet-table td {
    padding: 15px 14px;
    border-bottom: 1px solid rgba(79, 108, 143, .15);
}

.planet-table tbody tr:last-child td {
    border-bottom: 0;
}

.planet-table tbody tr:hover {
    background: rgba(98, 183, 255, .04);
}

.waiting {
    padding: 35px !important;
    color: var(--muted);
    text-align: center;
}

.observing-window {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 24px;
}

.observing-window span {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: .8rem;
}

.observing-window strong {
    font-size: 1.15rem;
}

.window-line {
    position: relative;
    height: 8px;
    overflow: hidden;
    border-radius: 10px;
    background: #07101d;
}

.window-line::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        #30445f,
        #428ac4,
        #72c7ff,
        #428ac4,
        #30445f
    );
    opacity: .75;
}

#windowProgress {
    position: absolute;
    top: -3px;
    left: 50%;
    width: 2px;
    height: 14px;
    background: white;
    box-shadow: 0 0 8px white;
}

.message {
    min-height: 24px;
    margin-top: 18px;
    color: var(--muted);
    text-align: center;
}

footer {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 24px 5%;
    border-top: 1px solid rgba(116, 150, 195, .15);
    color: #71849d;
    background: rgba(3, 7, 14, .75);
    font-size: .82rem;
}

@media (max-width: 900px) {
    .card-grid {
        grid-template-columns: 1fr;
    }

    .location-panel {
        grid-template-columns: 1fr 1fr;
    }

    .location-panel > div {
        grid-column: 1 / -1;
    }

    .twilight-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .site-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .dashboard {
        width: 94%;
        margin-top: 20px;
    }

    .location-panel {
        grid-template-columns: 1fr;
    }

    .location-panel > div {
        grid-column: auto;
    }

    button {
        width: 100%;
    }

    .observing-window {
        grid-template-columns: 1fr;
    }

    .window-line {
        order: 3;
    }

    footer {
        flex-direction: column;
    }
}

/* Hourly observing forecast */
.forecast-chart-wrapper {
    position: relative;
    width: 100%;
    min-height: 300px;
    padding: 10px 4px 0;
}

#observingForecastChart {
    display: block;
    width: 100%;
    height: 300px;
}

#forecastChartSummary {
    color: var(--muted);
    font-size: .85rem;
}

.forecast-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 14px;
    color: var(--muted);
    font-size: .85rem;
}

.forecast-legend span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.legend-swatch {
    display: inline-block;
    width: 22px;
    height: 3px;
    border-radius: 3px;
}

.cloud-swatch {
    background: #62b7ff;
}

.transparency-swatch {
    background: #ffd166;
}

@media (max-width: 600px) {
    .forecast-chart-wrapper {
        min-height: 250px;
    }

    #observingForecastChart {
        height: 250px;
    }
}


/* Interactive forecast chart */
.forecast-tooltip {
    position: absolute;
    z-index: 5;
    min-width: 205px;
    max-width: 260px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 9px;
    pointer-events: none;
    background: rgba(5, 13, 25, .96);
    box-shadow: 0 10px 28px rgba(0, 0, 0, .35);
    color: var(--text);
    font-size: .82rem;
    line-height: 1.55;
}

.forecast-tooltip strong {
    color: var(--accent-bright);
}

.forecast-tooltip .tooltip-muted {
    color: var(--muted);
}

.forecast-chart-wrapper {
    overflow: hidden;
}
\n\n/* Clickable observing-target details */\n.target-detail-row {\n    cursor: pointer;\n    border-radius: 8px;\n    padding-left: 8px;\n    padding-right: 8px;\n    transition: background .15s ease, transform .15s ease;\n}\n.target-detail-row:hover,\n.target-detail-row:focus-visible {\n    background: rgba(98, 183, 255, .07);\n    outline: none;\n}\n.target-detail-row:focus-visible {\n    box-shadow: 0 0 0 2px rgba(98, 183, 255, .35);\n}\n.object-detail-modal { position: fixed; inset: 0; z-index: 50; }\n.object-detail-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.68); backdrop-filter: blur(4px); }\n.object-detail-panel {\n    position: relative; z-index: 1; width: min(720px, 92vw); max-height: 84vh; overflow-y: auto;\n    margin: 8vh auto 0; padding: 28px; border: 1px solid var(--border); border-radius: 16px;\n    background: linear-gradient(145deg, rgba(16,29,49,.99), rgba(8,16,29,.99));\n    box-shadow: 0 24px 70px rgba(0,0,0,.5);\n}\n.object-detail-close {\n    position: absolute; top: 14px; right: 14px; width: 38px; height: 38px; padding: 0;\n    border: 1px solid #36516f; border-radius: 50%; background: #101d30; font-size: 1.45rem; line-height: 1;\n}\n.object-detail-kicker { color: var(--accent-bright); font-size: .78rem; text-transform: uppercase; letter-spacing: .09em; }\n.object-detail-panel h2 { margin: 7px 45px 8px 0; font-size: 1.55rem; }\n.object-detail-description { margin: 0 0 20px; color: var(--muted); line-height: 1.55; }\n.object-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px 18px; }\n.object-detail-item { padding: 12px 0; border-bottom: 1px solid rgba(107,136,174,.13); }\n.object-detail-item span { display: block; margin-bottom: 4px; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }\n.object-detail-item strong { font-weight: 600; }\n@media (max-width: 600px) { .object-detail-panel { margin-top: 4vh; padding: 22px; } .object-detail-grid { grid-template-columns: 1fr; } }\n

/* Clickable target affordance and detail spacing */
.click-hint {
    color: var(--accent-bright);
    font-size: .84rem;
    font-style: italic;
    text-align: right;
    white-space: nowrap;
}

.clickable-object {
    cursor: pointer;
}

.clickable-object:hover .object-name,
.clickable-object:focus-visible .object-name {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
    color: var(--accent-bright);
}

.clickable-object:focus-visible {
    outline: 1px solid var(--accent);
    outline-offset: 3px;
    border-radius: 6px;
}

.object-detail-row {
    column-gap: 28px;
}

.object-detail-row > span {
    padding-right: 18px;
}

.object-detail-row > strong {
    margin-left: auto;
    padding-left: 18px;
}

@media (max-width: 700px) {
    .click-hint {
        white-space: normal;
        text-align: left;
    }
}


.target-detail-trigger {
    cursor: pointer;
}

.target-detail-trigger:hover .target-name,
.target-detail-trigger:hover strong:first-child,
.target-detail-trigger:focus-visible .target-name,
.target-detail-trigger:focus-visible strong:first-child {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
    color: var(--accent-bright);
}

.target-detail-trigger:focus-visible {
    outline: 1px solid var(--accent);
    outline-offset: 3px;
    border-radius: 6px;
}

.detail-row {
    display: grid;
    grid-template-columns: minmax(145px, .8fr) minmax(0, 1.2fr);
    column-gap: 28px;
    align-items: baseline;
}

.detail-row > span:first-child {
    padding-right: 14px;
}

.detail-row > strong,
.detail-row > span:last-child {
    text-align: right;
}


/* Object detail modal — explicit label/value spacing fix */
.object-detail-item {
    display: grid;
    grid-template-columns: minmax(150px, .85fr) minmax(0, 1.15fr);
    column-gap: 32px;
    align-items: baseline;
}

.object-detail-item > span {
    padding-right: 12px;
    color: var(--muted);
}

.object-detail-item > strong {
    padding-left: 12px;
    text-align: right;
    overflow-wrap: anywhere;
}

@media (max-width: 520px) {
    .object-detail-item {
        grid-template-columns: 1fr;
        row-gap: 4px;
    }

    .object-detail-item > strong {
        padding-left: 0;
        text-align: left;
    }
}


/* Clickable target rows — visible mouse/keyboard affordance */
.target-detail-row {
    cursor: pointer;
    border-radius: 7px;
    transition:
        background-color .15s ease,
        color .15s ease,
        transform .15s ease;
}

.target-detail-row:hover,
.target-detail-row:focus-visible {
    background: rgba(98, 183, 255, .09);
}

.target-detail-row:hover > span:first-child,
.target-detail-row:focus-visible > span:first-child {
    color: var(--accent-bright);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
}

.target-detail-row:hover {
    transform: translateX(3px);
}

.target-detail-row:focus-visible {
    outline: 1px solid var(--accent);
    outline-offset: 2px;
}


/* Location sky-quality summary */
.location-summary {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.location-summary .location-display {
    flex: 1 1 420px;
}

.bortle-display {
    flex: 0 1 auto;
    padding: 18px 4px 10px;
    color: var(--accent-bright);
    font-size: .95rem;
    text-align: right;
    white-space: nowrap;
}

.bortle-display a {
    color: inherit;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

@media (max-width: 760px) {
    .location-summary {
        gap: 0;
    }

    .bortle-display {
        flex-basis: 100%;
        padding-top: 0;
        text-align: left;
        white-space: normal;
    }
}


/* Provider attribution — replaces the original site footer content */
.provider-footer {
    display: block;
    text-align: center;
    padding: 20px 32px 24px;
    line-height: 1.55;
}

.provider-credits {
    color: var(--text);
    font-size: .84rem;
}

.provider-disclaimer {
    max-width: 1000px;
    margin: 8px auto 0;
    color: var(--muted);
    font-size: .75rem;
}

.provider-footer a {
    color: var(--accent-bright);
    text-decoration: none;
}

.provider-footer a:hover,
.provider-footer a:focus-visible {
    text-decoration: underline;
    text-underline-offset: 3px;
}

@media (max-width: 700px) {
    .provider-footer {
        padding-left: 18px;
        padding-right: 18px;
    }
}


/* Private bug / suggested-fix reporting */
.report-problem-section {
    width: min(1180px, calc(100% - 64px));
    margin: 24px auto 18px;
    padding: 22px 28px;
    border: 1px solid var(--border);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.report-problem-copy h2 {
    margin: 0 0 6px;
    font-size: 1rem;
    letter-spacing: .04em;
}

.report-problem-copy p {
    margin: 0;
    color: var(--muted);
    font-size: .9rem;
}

.report-problem-button,
.report-submit-button {
    border: 0;
    border-radius: 9px;
    padding: 11px 16px;
    background: var(--accent);
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.report-problem-button:hover,
.report-submit-button:hover {
    filter: brightness(1.12);
}

.report-modal[hidden] {
    display: none;
}

.report-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: grid;
    place-items: center;
    padding: 20px;
}

.report-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .72);
}

.report-modal-panel {
    position: relative;
    z-index: 1;
    width: min(620px, 100%);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: 26px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #10233e;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .45);
}

.report-modal-panel h2 {
    margin: 0 42px 6px 0;
}

.report-modal-intro {
    margin: 0 0 20px;
    color: var(--muted);
    line-height: 1.5;
}

.report-modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    border: 0;
    background: transparent;
    color: var(--text);
    font-size: 1.8rem;
    cursor: pointer;
}

.report-form {
    display: grid;
    gap: 14px;
}

.report-form label {
    display: grid;
    gap: 6px;
    font-weight: 650;
}

.optional-field {
    color: var(--muted);
    font-size: .78rem;
    font-weight: 400;
}

.report-form input,
.report-form select,
.report-form textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 11px;
    background: #09182b;
    color: var(--text);
    font: inherit;
}

.report-form textarea {
    resize: vertical;
    min-height: 130px;
}

.report-form input:focus,
.report-form select:focus,
.report-form textarea:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

.report-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 4px;
}

.report-cancel-button {
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 10px 15px;
    background: transparent;
    color: var(--text);
    font: inherit;
    cursor: pointer;
}

@media (max-width: 700px) {
    .report-problem-section {
        width: min(100% - 36px, 1180px);
        flex-direction: column;
        align-items: stretch;
    }

    .report-problem-button {
        width: 100%;
    }
}


/* Subtle astronomy artwork background */
body {
    position: relative;
    background-color: #071426;
    background-image:
        linear-gradient(rgba(4, 14, 28, .76), rgba(4, 14, 28, .82)),
        url("/static/images/astronomy-background.png");
    background-size: cover;
    background-position: center top;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

/* Keep dashboard content clearly above the decorative background. */
header,
main,
footer,
.site-footer,
.report-problem-section {
    position: relative;
    z-index: 1;
}

/* Preserve readability: cards remain strongly separated from the star field. */
.astro-card,
.wide-card,
.report-problem-section {
    backdrop-filter: blur(1px);
}

@media (max-width: 900px) {
    body {
        background-attachment: scroll;
        background-position: center top;
    }
}

@media (prefers-reduced-motion: reduce) {
    body {
        background-attachment: scroll;
    }
}
