/* ============================================================
   Intics Service Status — CSS
   Clean white theme matching the provided design screenshots.
   ============================================================ */

.iss-wrap {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px 0;
    box-sizing: border-box;
}

/* ── Header ─────────────────────────────────────────────── */
.iss-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}
.iss-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    color: #111827;
}
.iss-legend {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}
.iss-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: #374151;
}
.iss-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.iss-dot::after {
    content: '✓';
    font-size: 11px;
    color: #fff;
    font-weight: 700;
}
.iss-dot-operational  { background: #16a34a; }
.iss-dot-degraded     { background: #d97706; }
.iss-dot-outage       { background: #dc2626; }
.iss-dot-maintenance  {
    background: #2563eb;
}
.iss-dot-maintenance::after { content: '⚠'; font-size: 10px; }

/* ── Overall Banner ──────────────────────────────────────── */
.iss-overall-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    border-radius: 8px;
    border-left: 4px solid #16a34a;
    background: #f0fdf4;
    margin-bottom: 28px;
    transition: border-color 0.3s, background 0.3s;
}
.iss-overall-banner.iss-banner-degraded {
    border-left-color: #d97706;
    background: #fffbeb;
}
.iss-overall-banner.iss-banner-outage {
    border-left-color: #dc2626;
    background: #fef2f2;
}
.iss-overall-banner.iss-banner-maintenance {
    border-left-color: #2563eb;
    background: #eff6ff;
}
.iss-overall-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #16a34a;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    flex-shrink: 0;
    transition: background 0.3s;
}
.iss-overall-icon::after { content: '✓'; }
.iss-overall-icon.iss-icon-degraded    { background: #d97706; }
.iss-overall-icon.iss-icon-degraded::after    { content: '!'; }
.iss-overall-icon.iss-icon-outage      { background: #dc2626; }
.iss-overall-icon.iss-icon-outage::after      { content: '✕'; }
.iss-overall-icon.iss-icon-maintenance { background: #2563eb; }
.iss-overall-icon.iss-icon-maintenance::after { content: '⚠'; font-size: 0.9rem; }

.iss-overall-title {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 3px;
}
.iss-overall-sub {
    font-size: 0.875rem;
    color: #6b7280;
}

/* ── Section Title ───────────────────────────────────────── */
.iss-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 14px;
}

/* ── Groups ──────────────────────────────────────────────── */
.iss-group {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 12px;
    overflow: hidden;
    background: #fff;
}
.iss-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}
.iss-group-header:hover { background: #f9fafb; }
.iss-group-left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.iss-expand-btn {
    background: none;
    border: none;
    padding: 0;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
}
.iss-expand-btn:hover { color: #111827; }
.iss-group-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #111827;
}

/* ── Status Badges (in group headers) ───────────────────── */
.iss-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #16a34a;
}
.iss-status-badge::before {
    content: '';
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #16a34a;
    display: inline-block;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M4.5 9l3 3 6-6' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    flex-shrink: 0;
}
.iss-status-badge.iss-badge-degraded  { color: #d97706; }
.iss-status-badge.iss-badge-degraded::before  { background-color: #d97706; }
.iss-status-badge.iss-badge-outage    { color: #dc2626; }
.iss-status-badge.iss-badge-outage::before    { background-color: #dc2626; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M5 5l8 8M13 5l-8 8' stroke='white' stroke-width='2' stroke-linecap='round' fill='none'/%3E%3C/svg%3E"); }
.iss-status-badge.iss-badge-maintenance { color: #2563eb; }
.iss-status-badge.iss-badge-maintenance::before { background-color: #2563eb; }

/* ── Child Rows ──────────────────────────────────────────── */
.iss-group-children {
    border-top: 1px solid #e5e7eb;
}
.iss-child-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 18px 13px 46px;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.1s;
}
.iss-child-row:last-child { border-bottom: none; }
.iss-child-row:hover { background: #f9fafb; }
.iss-child-name {
    font-size: 0.9rem;
    color: #374151;
}
/* DB child row: also show latency */
.iss-child-meta {
    font-size: 0.78rem;
    color: #9ca3af;
    margin-top: 2px;
}

/* ── Loading ─────────────────────────────────────────────── */
.iss-loading {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 32px 0;
    color: #6b7280;
    font-size: 0.9rem;
}
.iss-spinner {
    width: 20px; height: 20px;
    border: 2px solid #e5e7eb;
    border-top-color: #16a34a;
    border-radius: 50%;
    animation: iss-spin 0.7s linear infinite;
    flex-shrink: 0;
}
@keyframes iss-spin { to { transform: rotate(360deg); } }

/* ── Error ───────────────────────────────────────────────── */
.iss-error-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    color: #dc2626;
    font-size: 0.875rem;
    margin-bottom: 16px;
}
.iss-retry-btn {
    margin-left: auto;
    background: #dc2626;
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 5px 12px;
    font-size: 0.8rem;
    cursor: pointer;
    flex-shrink: 0;
}
.iss-retry-btn:hover { background: #b91c1c; }

/* ── Last Updated ────────────────────────────────────────── */
.iss-last-updated {
    font-size: 0.78rem;
    color: #9ca3af;
    margin-top: 16px;
    text-align: right;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 600px) {
    .iss-legend { gap: 10px; }
    .iss-child-row { padding-left: 32px; }
    .iss-header { flex-direction: column; align-items: flex-start; }
}
