:root {
    --bg-main: #050608;
    --bg-panel: rgba(9, 13, 22, 0.96);
    --bg-panel-soft: rgba(15, 22, 34, 0.96);
    --accent: #00d7ff;
    --accent-soft: #52f2ff;
    --accent-warm: #ffc857;
    --accent-deep: #2196f3;
    --danger: #ff476f;
    --ok: #3af5a0;
    --text-main: #f7fafc;
    --text-muted: #9ca4b8;
    --border-soft: rgba(255, 255, 255, 0.04);
    --radius-lg: 18px;
    --shadow-soft: 0 30px 90px rgba(0, 0, 0, 0.8);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
}

body {
    min-height: 100vh;
    font-family: "Montserrat", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
    color: var(--text-main);
    background-attachment: fixed;
    overflow-x: hidden;
}

/* Fundo com imagem + blur */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image: url("../background.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: blur(10px);
    transform: scale(1.06);
    opacity: 1;
    z-index: -1;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at top, rgba(0, 0, 0, 0.25),
    rgba(0, 0, 0, 0.55));
    z-index: -1;
}

#app {
    max-width: 1680px;              /* MAIS LARGO */
    margin: 28px auto 32px;
    padding: 0 20px 32px;
    min-height: calc(100vh - 56px);
}

header {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 20px;
}

.logo-box {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-box img {
    margin-top: -10%;
    width: 250px;
    height: 250px;
    object-fit: contain;
    filter: drop-shadow(0 0 16px rgba(255, 255, 255, 0.25));
}

.title-block {
    display: flex;
    flex-direction: column;
}

.title-block h1 {
    font-family: "Rajdhani", sans-serif;
    font-weight: 700;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    font-size: 1.4rem;
    margin: 0;
}

.title-block span {
    font-size: 0.86rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--text-muted);
}

.header-right {
    margin-left: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    font-size: 0.9rem;
}

.location-chip {
    background: linear-gradient(120deg,
    rgba(0, 214, 255, 0.18),
    rgba(33, 150, 243, 0.08));
    border-radius: 999px;
    padding: 6px 16px;
    border: 1px solid rgba(0, 214, 255, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    backdrop-filter: blur(12px);
}

.location-chip span.label {
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--text-muted);
}

.location-chip span.value {
    font-family: "Rajdhani", sans-serif;
}

.btn-reload {
    padding: 7px 20px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-family: "Rajdhani", sans-serif;
    color: #051018;
    background: radial-gradient(circle at 15% 0,
    #ffffff 0,
    #ffc857 35%,
    #ff7a29 65%,
    #ff3b7f 100%);
    box-shadow:
        0 0 24px rgba(255, 200, 87, 0.4),
        0 12px 36px rgba(0, 0, 0, 0.9);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-compact {
    padding: 6px 18px;
}

.btn-reload span.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #051018;
}

.btn-reload:active {
    transform: translateY(1px);
    box-shadow:
        0 0 10px rgba(255, 200, 87, 0.5),
        0 4px 14px rgba(0, 0, 0, 0.8);
}

.form-row {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    font-size: 0.86rem;
}

.form-row label {
    color: var(--text-muted);
}

.form-row input,
.form-row select {
    background: rgba(6, 10, 18, 0.96);
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    color: var(--text-main);
    padding: 5px 10px;
    min-width: 80px;
    font-size: 0.85rem;
    outline: none;
}

.form-row input:focus,
.form-row select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px rgba(0, 214, 255, 0.35);
}

.btn-geo {
    border-radius: 999px;
    border: 1px solid rgba(0, 214, 255, 0.5);
    background: transparent;
    color: var(--accent-soft);
    padding: 5px 12px;
    font-size: 0.78rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-geo span.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-soft);
}

.grid-main {
    margin-top: 22px;
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(0, 1.2fr);
    gap: 24px;
}

.panel {
    background: radial-gradient(circle at top left,
    rgba(0, 214, 255, 0.12),
    transparent 55%),
    radial-gradient(circle at bottom right,
    rgba(255, 200, 87, 0.12),
    transparent 60%),
    var(--bg-panel);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.02);
    box-shadow: var(--shadow-soft);
    padding: 20px 22px 22px;
    position: relative;
    overflow: hidden;
}

.panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at -20% -20%,
    rgba(255, 255, 255, 0.08),
    transparent 55%);
    mix-blend-mode: soft-light;
    opacity: 0.7;
    pointer-events: none;
}

.panel-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 18px;
}

.panel-title {
    font-family: "Rajdhani", sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.24em;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.panel-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.status-bar {
    margin-top: 14px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.status-bar strong {
    color: var(--accent-soft);
}

.status-error {
    color: var(--danger);
}

.status-ok {
    color: var(--ok);
}

.current-main {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1.3fr);
    gap: 16px;
    margin-top: 8px;
}

.current-left {
    position: relative;
    padding: 10px 6px 0;
}

.wx-icon {
    width: 130px;
    height: 130px;
    border-radius: 32px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    box-shadow:
        0 0 22px rgba(0, 0, 0, 0.6),
        0 18px 48px rgba(0, 0, 0, 0.9);
}

/* dia */
.wx-icon.day {
    background: radial-gradient(circle at 30% 0,
    #ffffff,
    #ffe08a 35%,
    #ff9c3a 65%,
    #ff3e6b 100%);
    box-shadow:
        0 0 22px rgba(255, 180, 50, 0.45),
        0 18px 48px rgba(0, 0, 0, 0.9);
}

/* noite */
.wx-icon.night {
    background: radial-gradient(circle at 30% 0,
    #0b1020,
    #141b2f 40%,
    #020617 100%);
    box-shadow:
        0 0 22px rgba(0, 215, 255, 0.28),
        0 18px 48px rgba(0, 0, 0, 0.9);
}

.wx-icon .glyph {
    font-size: 3.2rem;
    text-shadow: 0 0 12px rgba(0, 0, 0, 0.7);
}

.wx-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.18em;
    margin-bottom: 2px;
}

.temp-main {
    font-family: "Rajdhani", sans-serif;
    font-size: 3.4rem;
    line-height: 1;
    font-weight: 700;
}

.temp-main span {
    font-size: 1.4rem;
    color: var(--accent-soft);
    margin-left: 4px;
}

.temp-extra {
    font-size: 0.85rem;
    margin-top: 6px;
    color: var(--text-muted);
}

.temp-extra strong {
    color: var(--accent-soft);
    font-weight: 600;
}

.location-small {
    margin-top: 10px;
    font-size: 0.82rem;
    color: var(--accent-soft);
}

.location-small span.label {
    color: var(--text-muted);
}

/* 6 cards (3 colunas x 2 linhas) */
.current-right {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.metric-card {
    background: var(--bg-panel-soft);
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    padding: 10px 11px;
    position: relative;
    overflow: hidden;
}

.metric-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 130% -20%,
    rgba(0, 214, 255, 0.14),
    transparent 55%);
    opacity: 0.85;
    pointer-events: none;
}

.metric-label {
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--text-muted);
}

.metric-value {
    margin-top: 6px;
    font-size: 1.05rem;
    font-weight: 600;
}

.metric-unit {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.metric-foot {
    margin-top: 3px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* Previsão */
.panel-forecast {
    margin-top: 16px;
    background: radial-gradient(circle at 0 0,
    rgba(0, 214, 255, 0.2),
    transparent 55%),
    linear-gradient(135deg,
    rgba(9, 12, 20, 0.98),
    rgba(7, 11, 18, 0.98));
    border-radius: var(--radius-lg);
    border: 1px solid rgba(0, 214, 255, 0.25);
    padding: 12px 14px 14px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9);
}

.forecast-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
}

.forecast-header .title {
    font-family: "Rajdhani", sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.forecast-header .hint {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.forecast-strip {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
}

.forecast-strip::-webkit-scrollbar {
    height: 6px;
}

.forecast-strip::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.4);
    border-radius: 999px;
}

.forecast-card {
    min-width: 180px;
    padding: 10px 11px 11px;
    border-radius: 12px;
    background: rgba(5, 11, 18, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.35);
    position: relative;
    overflow: hidden;
}

.forecast-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 0,
    rgba(255, 200, 87, 0.22),
    transparent 55%);
    opacity: 0.9;
    pointer-events: none;
}

.forecast-day {
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.forecast-date {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.forecast-temp {
    margin-top: 6px;
    font-family: "Rajdhani", sans-serif;
    font-size: 1.1rem;
}

.forecast-temp span.min {
    color: var(--accent-soft);
    font-size: 0.9rem;
}

.forecast-temp span.max {
    color: var(--accent-warm);
    font-size: 0.9rem;
}

.forecast-desc {
    margin-top: 4px;
    font-size: 0.82rem;
}

.forecast-line {
    margin-top: 3px;
    font-size: 0.76rem;
    color: var(--text-muted);
}

.moon-tag {
    font-size: 0.76rem;
    margin-top: 5px;
    color: var(--accent-soft);
}

/* Painel sistema */
.system-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr);
    row-gap: 10px;
}

.system-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.system-row span.label {
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.74rem;
}

.system-row span.value {
    color: var(--text-main);
}

.badge-live {
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    background: rgba(63, 243, 144, 0.2);
    border: 1px solid rgba(63, 243, 144, 0.6);
    color: var(--ok);
}

.badge-fail {
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    background: rgba(255, 71, 111, 0.12);
    border: 1px solid rgba(255, 71, 111, 0.6);
    color: var(--danger);
}

.system-video-wrapper {
    margin-top: 18px;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: radial-gradient(circle at top left,
        rgba(15, 23, 42, 0.9),
        rgba(8, 13, 23, 0.98));
    overflow: hidden;
    box-shadow:
        0 18px 40px rgba(0, 0, 0, 0.9),
        0 0 20px rgba(0, 0, 0, 0.6);
    min-height: 220px;         /* ajusta a altura do “frame” */
}

.system-video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;          /* vídeo preenchendo o frame */
}


/* Responsivo */
@media (max-width: 1200px) {
    #app {
        max-width: 100%;
    }
}

@media (max-width: 900px) {
    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .header-right {
        align-items: flex-start;
    }

    .grid-main {
        grid-template-columns: minmax(0, 1fr);
    }

    .current-right {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .current-main {
        grid-template-columns: minmax(0, 1fr);
    }

    .current-left {
        display: flex;
        flex-direction: row;
        gap: 14px;
        align-items: center;
    }

    .wx-icon {
        margin-bottom: 0;
    }

    .current-right {
        grid-template-columns: minmax(0, 1fr);
    }
}
