/* ============================================================
   UKNONG Status
   ============================================================ */

:root {
    --bg: #202124;
    --text: #e8eaed;
    --text-2: #9aa0a6;
    --text-3: #5f6368;
    --surface: #303134;
    --line: rgba(255,255,255,0.06);
    --green: #81c995;
    --yellow: #fdd663;
    --red: #f28b82;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Inter', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }

.wrap {
    max-width: 600px;
    margin: 0 auto;
    padding: 60px 24px 100px;
}

/* ---------- Header ---------- */
.hd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 48px;
}
.hd-left {
    display: flex;
    align-items: baseline;
    gap: 10px;
}
.hd-title {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.03em;
}
.hd-home {
    font-size: 13px;
    color: var(--text-3);
    transition: color .15s;
}
.hd-home:hover { color: var(--text-2); }
.hd-right {
    display: flex;
    align-items: center;
    gap: 2px;
}
.hd-btn {
    appearance: none;
    -webkit-appearance: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-3);
    padding: 6px;
    border-radius: 8px;
    transition: color .15s, background .15s;
    display: flex;
}
.hd-btn:hover { color: var(--text-2); background: rgba(255,255,255,0.04); }
.hd-btn svg { width: 18px; height: 18px; }

/* ---------- Language Selector ---------- */
.lang-wrap {
    position: relative;
}
.lang-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 4px;
    min-width: 120px;
    box-shadow: 0 8px 24px rgba(0,0,0,.25);
    z-index: 10;
}
.lang-opt {
    display: block;
    width: 100%;
    padding: 6px 10px;
    font-size: 12px;
    font-family: inherit;
    color: var(--text-2);
    background: none;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-align: left;
    transition: background .1s, color .1s;
}
.lang-opt:hover { background: rgba(255,255,255,0.06); color: var(--text); }
.lang-opt.active { color: var(--text); font-weight: 500; }

/* ---------- Overall ---------- */
.overall {
    margin-bottom: 40px;
    animation: fadeIn .4s ease both;
}
.overall-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
.overall-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green);
    flex-shrink: 0;
}
.overall-dot.warn { background: var(--yellow); }
.overall-dot.bad { background: var(--red); }
.overall-label {
    font-size: 14px;
    font-weight: 500;
}
.overall-sub {
    font-size: 12px;
    color: var(--text-3);
    padding-left: 15px;
}

/* ---------- Service Row ---------- */
.svc {
    padding: 18px 0;
    border-bottom: 1px solid var(--line);
    animation: fadeIn .35s ease both;
}
.svc:first-child { border-top: 1px solid var(--line); }
.svc:nth-child(1) { animation-delay: .04s; }
.svc:nth-child(2) { animation-delay: .08s; }

.svc-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.svc-name {
    font-size: 13px;
    font-weight: 600;
}
.svc-right {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--text-2);
    font-variant-numeric: tabular-nums;
}
.svc-pill {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
}
.svc-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
}
.svc-dot.up { background: var(--green); }
.svc-dot.down { background: var(--red); }
.svc-dot.unknown { background: var(--text-3); }
.svc-label.up { color: var(--green); }
.svc-label.down { color: var(--red); }
.svc-label.unknown { color: var(--text-3); }

/* ---------- Uptime Bar ---------- */
.bar-wrap {
    display: flex;
    gap: 1px;
    height: 20px;
    margin-bottom: 3px;
}
.bar-day {
    flex: 1;
    border-radius: 1px;
    cursor: pointer;
    transition: opacity .12s;
}
.bar-day:hover { opacity: .5; }
.bar-day.g { background: var(--green); opacity: .55; }
.bar-day.y { background: var(--yellow); opacity: .65; }
.bar-day.r { background: var(--red); opacity: .7; }
.bar-day.e { background: rgba(255,255,255,0.03); }

.bar-labels {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: var(--text-3);
}

/* ---------- Tooltip ---------- */
.tip {
    position: fixed;
    background: var(--surface);
    color: var(--text);
    padding: 5px 9px;
    border-radius: 6px;
    font-size: 11px;
    pointer-events: none;
    z-index: 9;
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(0,0,0,.35);
    display: none;
}
.tip.on { display: block; }

/* ---------- Incidents ---------- */
.inc-section {
    margin-top: 40px;
    animation: fadeIn .4s ease .12s both;
}
.inc-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-3);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 14px;
}
.inc-empty {
    font-size: 13px;
    color: var(--text-3);
    padding: 16px 0;
}
.inc-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}
.inc-item:last-child { border-bottom: none; }
.inc-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}
.inc-name {
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}
.inc-sev {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    flex-shrink: 0;
}
.inc-sev.minor { background: var(--yellow); }
.inc-sev.major { background: #f29900; }
.inc-sev.critical { background: var(--red); }
.inc-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.inc-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 100px;
    letter-spacing: 0.02em;
}
.inc-badge.resolved { background: rgba(129,201,149,.1); color: var(--green); }
.inc-badge.investigating { background: rgba(253,214,99,.1); color: var(--yellow); }
.inc-badge.identified { background: rgba(253,214,99,.1); color: var(--yellow); }
.inc-badge.monitoring { background: rgba(138,180,248,.1); color: #8ab4f8; }
.inc-date {
    font-size: 11px;
    color: var(--text-3);
    font-variant-numeric: tabular-nums;
}
.inc-updates {
    margin-top: 6px;
    padding-left: 12px;
    border-left: 1px solid var(--line);
}
.inc-upd {
    padding: 3px 0;
    font-size: 12px;
    color: var(--text-2);
}
.inc-upd-time {
    font-size: 10px;
    color: var(--text-3);
    margin-right: 6px;
}

/* ---------- Footer ---------- */
.ft {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    padding: 14px 0;
    font-size: 11px;
    color: var(--text-3);
    background: #171717;
}
.ft a { color: var(--text-3); transition: color .15s; }
.ft a:hover { color: var(--text-2); }

/* ---------- Updated ---------- */
.updated {
    font-size: 11px;
    color: var(--text-3);
    margin-top: 16px;
}

/* ---------- Skeleton ---------- */
.sk { display: flex; flex-direction: column; gap: 2px; }
.sk-row {
    height: 56px;
    background: linear-gradient(90deg, rgba(48,49,52,.2) 25%, rgba(48,49,52,.4) 50%, rgba(48,49,52,.2) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 0;
    border-bottom: 1px solid var(--line);
}
.sk-row:first-child { border-top: 1px solid var(--line); }

/* ---------- Animation ---------- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.hidden { display: none !important; }

/* ============================================================
   Light
   ============================================================ */
body.light {
    --bg: #f5f5f7;
    --text: #1d1d1f;
    --text-2: #6e6e73;
    --text-3: #aeaeb2;
    --surface: #fff;
    --line: rgba(0,0,0,0.06);
    --green: #34a853;
    --yellow: #e37400;
    --red: #d93025;
}
body.light .hd-btn:hover { background: rgba(0,0,0,0.04); }
body.light .lang-menu { background: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.08); }
body.light .lang-opt:hover { background: rgba(0,0,0,0.04); }
body.light .ft { background: #fff; border-top: 1px solid var(--line); }
body.light .bar-day.g { opacity: .65; }
body.light .bar-day.e { background: rgba(0,0,0,0.04); }
body.light .tip { background: #fff; box-shadow: 0 4px 16px rgba(0,0,0,.1); }

/* ---------- Mobile ---------- */
@media (max-width: 480px) {
    .wrap { padding: 40px 16px 90px; }
    .hd { margin-bottom: 36px; }
    .svc-top { flex-direction: column; align-items: flex-start; gap: 4px; }
    .svc-right { width: 100%; justify-content: space-between; }
    .inc-top { flex-direction: column; align-items: flex-start; }
}
