/* style-47-website-status.css — FEAT-254-P2 Website Status Monitor */
/* Prefix: wbs- | Themes: dark (default) + light override */

/* ── Page wrapper ────────────────────────────────────────────────────────── */
.wbs-page {
    padding: 16px 20px;
    max-width: 1100px;
}

/* ── Header ──────────────────────────────────────────────────────────────── */
.wbs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}
.wbs-header-left {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
}
.wbs-page-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #e2e8f0;
}
.wbs-last-checked {
    font-size: 12px;
    color: #6b7280;
}
.wbs-header-actions { display: flex; gap: 8px; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.wbs-btn {
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    padding: 7px 14px;
    transition: opacity 0.15s, background 0.15s;
    white-space: nowrap;
}
.wbs-btn:disabled { opacity: 0.4; cursor: default; }
.wbs-btn-primary          { background: #4a9eff; color: #fff; }
.wbs-btn-primary:hover:not(:disabled)    { background: #2d82e0; }
.wbs-btn-secondary        { background: #3a3f4b; color: #d0d4dc; }
.wbs-btn-secondary:hover:not(:disabled)  { background: #454b5a; }
.wbs-btn-success          { background: #166534; color: #4ade80; }
.wbs-btn-success:hover:not(:disabled)    { background: #14532d; }
.wbs-btn-danger           { background: #c0392b; color: #fff; }
.wbs-btn-danger:hover:not(:disabled)     { background: #a93226; }
.wbs-btn-sm { padding: 4px 10px; font-size: 12px; }

/* ── API error strip ─────────────────────────────────────────────────────── */
.wbs-api-error {
    background: #4a1414;
    color: #f87171;
    border: 1px solid #7f1d1d;
    border-radius: 6px;
    padding: 8px 14px;
    font-size: 13px;
    margin-bottom: 10px;
}

/* ── Empty state ─────────────────────────────────────────────────────────── */
.wbs-empty, .wbs-bar-empty {
    color: #6b7280;
    font-size: 13px;
    padding: 20px 0;
    text-align: center;
}

/* ── Site list ───────────────────────────────────────────────────────────── */
.wbs-site-list { display: flex; flex-direction: column; gap: 2px; }

.wbs-site-row {
    background: #1e2028;
    border: 1px solid #2e3340;
    border-radius: 8px;
    padding: 12px 14px 10px;
    transition: border-color 0.15s;
}
.wbs-site-row:hover { border-color: #3a4155; }

/* ── Site meta row ───────────────────────────────────────────────────────── */
.wbs-site-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.wbs-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.wbs-site-identity {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 160px;
    flex: 1;
}
.wbs-site-name {
    font-size: 13px;
    font-weight: 600;
    color: #93c5fd;
    text-decoration: none;
}
.wbs-site-name:hover { text-decoration: underline; }
.wbs-site-url {
    font-size: 11px;
    color: #6b7280;
    word-break: break-all;
}
.wbs-last-check-ts {
    font-size: 11px;
    color: #6b7280;
    margin-left: auto;
    white-space: nowrap;
}

/* ── Uptime / ms chips ───────────────────────────────────────────────────── */
.wbs-chip {
    font-size: 11px;
    font-weight: 500;
    padding: 2px 7px;
    border-radius: 4px;
    white-space: nowrap;
}
.wbs-chip-ok       { background: #14532d; color: #4ade80; }
.wbs-chip-degraded { background: #451a03; color: #fbbf24; }
.wbs-chip-down     { background: #450a0a; color: #f87171; }
.wbs-chip-unknown  { background: #1f2937; color: #6b7280; }
.wbs-chip-ms       { background: #1e293b; color: #94a3b8; }

/* ── Badges ──────────────────────────────────────────────────────────────── */
.wbs-badge-active   { font-size: 11px; color: #4ade80; padding: 2px 6px;
                       background: #14532d; border-radius: 4px; }
.wbs-badge-disabled { font-size: 11px; color: #6b7280; padding: 2px 6px;
                       background: #1f2937; border-radius: 4px; }
.wbs-badge-paused   { font-size: 11px; color: #fbbf24; padding: 2px 6px;
                       background: #451a03; border-radius: 4px; }

/* ── 90-day bar strip ────────────────────────────────────────────────────── */
.wbs-bar-strip {
    display: flex;
    gap: 1.5px;
    height: 28px;
    align-items: stretch;
}
.wbs-bar-day {
    flex: 1;
    min-width: 3px;
    border-radius: 2px;
    cursor: default;
    transition: opacity 0.1s;
}
.wbs-bar-day:hover { opacity: 0.75; }
.wbs-bar-ok       { background: #22c55e; }
.wbs-bar-degraded { background: #f59e0b; }
.wbs-bar-down     { background: #ef4444; }
.wbs-bar-unknown  { background: #374151; }

/* ── Divider ─────────────────────────────────────────────────────────────── */
.wbs-divider {
    border: none;
    border-top: 1px solid #2e3340;
    margin: 20px 0 16px;
}
.wbs-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: #e2e8f0;
    margin-bottom: 12px;
}

/* ── Admin add form ──────────────────────────────────────────────────────── */
.wbs-add-form {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.wbs-form-input {
    background: #1e2028;
    border: 1px solid #3a3f4b;
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 13px;
    padding: 7px 10px;
    outline: none;
    width: 200px;
}
.wbs-form-input-url { width: 280px; }
.wbs-form-input:focus { border-color: #4a9eff; }
.wbs-add-status { min-height: 28px; margin-bottom: 10px; font-size: 13px; }
.wbs-status-success {
    background: #1a4731; color: #4ade80;
    border: 1px solid #166534; border-radius: 6px;
    padding: 6px 12px;
}
.wbs-status-error {
    background: #4a1414; color: #f87171;
    border: 1px solid #7f1d1d; border-radius: 6px;
    padding: 6px 12px;
}

/* ── Manage table ────────────────────────────────────────────────────────── */
.wbs-manage-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-top: 8px;
}
.wbs-manage-thead-row th {
    text-align: left;
    padding: 8px 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #9ca3af;
    border-bottom: 1px solid #2e3340;
}
.wbs-manage-tr td {
    padding: 9px 10px;
    border-bottom: 1px solid #1e2028;
    vertical-align: middle;
}
.wbs-manage-url {
    color: #93c5fd;
    font-size: 12px;
    text-decoration: none;
    word-break: break-all;
}
.wbs-manage-url:hover { text-decoration: underline; }
.wbs-action-row { display: flex; gap: 6px; }

/* ── Confirm modal ───────────────────────────────────────────────────────── */
.wbs-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
}
.wbs-modal {
    background: #1e2028;
    border: 1px solid #2e3340;
    border-radius: 10px;
    width: 420px;
    max-width: 95vw;
    box-shadow: 0 8px 32px rgba(0,0,0,.5);
}
.wbs-modal-sm { width: 380px; }
.wbs-modal-header {
    padding: 14px 18px 12px;
    border-bottom: 1px solid #2e3340;
}
.wbs-modal-header-danger { border-bottom-color: #7f1d1d; }
.wbs-modal-title { font-weight: 600; font-size: 14px; color: #e2e8f0; }
.wbs-modal-body { padding: 16px 18px; }
.wbs-modal-footer {
    padding: 12px 18px;
    border-top: 1px solid #2e3340;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}
.wbs-remove-info { font-size: 13px; color: #d0d4dc; margin-bottom: 10px; }
.wbs-remove-site-name { font-weight: 500; }
.wbs-remove-warning { font-size: 12px; color: #f87171; margin: 0; }

/* ── 390px mobile ────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .wbs-page { padding: 10px 10px; }
    .wbs-site-meta { gap: 5px; }
    .wbs-last-check-ts { margin-left: 0; width: 100%; }
    .wbs-add-form { flex-direction: column; }
    .wbs-form-input, .wbs-form-input-url { width: 100%; }
    .wbs-manage-table { font-size: 12px; overflow-x: auto; display: block; }
    .wbs-bar-strip { height: 20px; }
    /* Drop https:// prefix to save line space on phone */
    .wbs-url-protocol { display: none; }
}

/* ── Light theme overrides ───────────────────────────────────────────────── */
body[data-theme="light"] .wbs-page-title    { color: #1e293b; }
body[data-theme="light"] .wbs-last-checked  { color: #64748b; }
body[data-theme="light"] .wbs-site-row      { background: #ffffff; border-color: #e2e8f0; }
body[data-theme="light"] .wbs-site-row:hover { border-color: #cbd5e1; }
body[data-theme="light"] .wbs-site-name     { color: #2563eb; }
body[data-theme="light"] .wbs-site-url      { color: #64748b; }
body[data-theme="light"] .wbs-last-check-ts { color: #64748b; }
body[data-theme="light"] .wbs-chip-unknown  { background: #f1f5f9; color: #64748b; }
body[data-theme="light"] .wbs-chip-ms       { background: #f1f5f9; color: #475569; }
body[data-theme="light"] .wbs-divider       { border-top-color: #e2e8f0; }
body[data-theme="light"] .wbs-section-title { color: #1e293b; }
body[data-theme="light"] .wbs-form-input    {
    background: #fff; border-color: #cbd5e1; color: #1e293b;
}
body[data-theme="light"] .wbs-form-input:focus { border-color: #2563eb; }
body[data-theme="light"] .wbs-manage-table  { color: #1e293b; }
body[data-theme="light"] .wbs-manage-thead-row th { color: #64748b; border-bottom-color: #e2e8f0; }
body[data-theme="light"] .wbs-manage-tr td  { border-bottom-color: #f1f5f9; }
body[data-theme="light"] .wbs-manage-url    { color: #2563eb; }
body[data-theme="light"] .wbs-modal         { background: #fff; border-color: #e2e8f0; }
body[data-theme="light"] .wbs-modal-title   { color: #1e293b; }
body[data-theme="light"] .wbs-modal-header  { border-bottom-color: #e2e8f0; }
body[data-theme="light"] .wbs-modal-footer  { border-top-color: #e2e8f0; }
body[data-theme="light"] .wbs-remove-info   { color: #334155; }
body[data-theme="light"] .wbs-btn-secondary { background: #e2e8f0; color: #334155; }
body[data-theme="light"] .wbs-btn-secondary:hover:not(:disabled) { background: #cbd5e1; }
body[data-theme="light"] .wbs-bar-unknown   { background: #d1d5db; }
body[data-theme="light"] .wbs-empty         { color: #64748b; }
body[data-theme="light"] .wbs-bar-empty     { color: #64748b; }
