/* ==========================================
   Status Page Specific Styles
   Matches the muleyo.dev design system
   ========================================== */

/* Wider container for status page */
.container {
    max-width: 900px !important;
    width: 100% !important;
    padding: 2rem 1rem !important;
}

/* Give cards more room */
.content-card,
.nav-card,
.footer-card {
    padding: 1.25rem !important;
}

.monitors-card {
    padding: 1.5rem 1rem !important;
}

/* ==========================================
   Monitoring-offline banner
   ========================================== */

.monitoring-offline-banner {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1.25rem;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.12), rgba(239, 68, 68, 0.04));
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.monitoring-offline-banner i {
    flex-shrink: 0;
    font-size: 1rem;
}

/* ==========================================
   Overall Status Banner
   ========================================== */

.status-banner-card {
    padding: 0 !important;
    overflow: hidden;
}

.status-banner {
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    transition: all 0.3s ease;
}

.status-banner.all-up {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.12), rgba(34, 197, 94, 0.04));
    border-color: rgba(34, 197, 94, 0.3);
}

.status-banner.some-down {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.12), rgba(251, 191, 36, 0.04));
    border-color: rgba(251, 191, 36, 0.3);
}

.status-banner.major-down {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.12), rgba(239, 68, 68, 0.04));
    border-color: rgba(239, 68, 68, 0.3);
}

.status-banner-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.status-banner.all-up .status-banner-icon {
    color: #22c55e;
}

.status-banner.some-down .status-banner-icon {
    color: #fbbf24;
}

.status-banner.major-down .status-banner-icon {
    color: #ef4444;
}

.status-banner h1 {
    font-size: 1.5rem;
    margin: 0;
    color: var(--text-primary);
}

/* ==========================================
   Monitors List
   ========================================== */

.monitors-header,
.incidents-header,
.chart-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.monitors-icon,
.incidents-icon,
.chart-icon {
    font-size: 1.5rem;
    color: var(--accent-color);
}

.monitors-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.loading-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2rem;
    color: var(--text-secondary);
    font-size: 1rem;
}

.loading-placeholder i {
    color: var(--accent-color);
}

/* ==========================================
   Monitor Groups (Status Page)
   ========================================== */

.status-group {
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    overflow: visible;
    background: var(--bg-card);
    backdrop-filter: blur(10px);
}

.status-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.25rem;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
}

.status-group-header:hover {
    background: rgba(255, 255, 255, 0.03);
}

.status-group-left {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.status-group-arrow {
    font-size: 0.7rem;
    color: var(--text-secondary);
    transition: transform 0.25s ease;
}

.status-group.collapsed .status-group-arrow {
    transform: rotate(-90deg);
}

.status-group-name {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
}

.status-group-badge {
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.status-group-badge.down {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.status-group-badge.maintenance {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.status-group-body {
    border-top: 1px solid var(--border-color);
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: max-height 0.3s ease, opacity 0.25s ease, padding 0.3s ease;
    overflow: visible;
}

.status-group.collapsed .status-group-body {
    max-height: 0 !important;
    opacity: 0;
    padding: 0 0.75rem;
    border-top: none;
}

/* ==========================================
   Monitor Item — Compact Row Layout
   ========================================== */

.monitor-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--payment-btn-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.6rem;
    padding: 0.5rem 0.75rem;
    transition: all 0.25s ease;
    cursor: pointer;
}

.monitor-item:hover {
    background: var(--payment-btn-hover);
    border-color: var(--accent-color);
    box-shadow: var(--shadow);
}

.monitor-item.paused {
    opacity: 0.55;
}

.monitor-item.maintenance {
    opacity: 0.65;
}

/* Status dot */
.monitor-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
}

.monitor-status-dot.up {
    background: #22c55e;
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.5);
}

.monitor-status-dot.up::after {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(34, 197, 94, 0.3);
    animation: pulse-dot 2s ease-in-out infinite;
}

.monitor-status-dot.down {
    background: #ef4444;
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.5);
}

.monitor-status-dot.down::after {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.3);
    animation: pulse-dot 1.5s ease-in-out infinite;
}

@keyframes pulse-dot {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.6);
        opacity: 0;
    }
}

.monitor-status-dot.unknown {
    background: #6b7280;
    box-shadow: 0 0 6px rgba(107, 114, 128, 0.4);
}

.monitor-status-dot.paused {
    background: #6b7280;
    box-shadow: 0 0 6px rgba(107, 114, 128, 0.3);
    opacity: 0.6;
}

.monitor-status-dot.maintenance {
    background: #3b82f6;
    box-shadow: 0 0 6px rgba(59, 130, 246, 0.4);
}

/* Name */
.monitor-name {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text-primary);
    white-space: nowrap;
    width: 130px;
    min-width: 130px;
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 0 0 130px;
    text-align: left;
}

/* Uptime percentage */
.monitor-uptime-pct {
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
    width: 50px;
    min-width: 50px;
    max-width: 50px;
    text-align: right;
    color: #22c55e;
    flex: 0 0 50px;
}

.monitor-uptime-pct.degraded {
    color: #fbbf24;
}

.monitor-uptime-pct.warning {
    color: #f97316;
}

.monitor-uptime-pct.down {
    color: #ef4444;
}

/* Heartbeat bar — inline compact */
.heartbeat-bar {
    display: flex;
    align-items: center;
    gap: 1px;
    height: 22px;
    flex: 1;
    min-width: 0;
}

.heartbeat-beat {
    flex: 1;
    min-width: 0;
    height: 100%;
    border-radius: 2px;
    transition: opacity 0.15s ease, transform 0.15s ease;
    position: relative;
}

.heartbeat-beat.up {
    background: #22c55e;
    opacity: 0.65;
}

.heartbeat-beat.down,
.heartbeat-beat.down-red {
    background: #ef4444;
    opacity: 0.9;
}

.heartbeat-beat.down-orange {
    background: #f97316;
    opacity: 0.9;
}

.heartbeat-beat.down-yellow {
    background: #eab308;
    opacity: 0.9;
}

.heartbeat-beat.empty {
    background: var(--border-color);
    opacity: 0.25;
}

.heartbeat-beat.maintenance {
    background: #3b82f6;
    opacity: 0.5;
}

.heartbeat-beat:hover {
    opacity: 1;
    filter: brightness(1.3);
}

/* Heartbeat tooltip */
.heartbeat-beat::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 0.4rem 0.65rem;
    border-radius: 0.4rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    white-space: pre;
    line-height: 1.4;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
    z-index: 100;
}

.heartbeat-beat:hover::after {
    opacity: 1;
}

/* Tooltip alignment for edge beats */
.heartbeat-beat.tooltip-right::after {
    left: 0;
    transform: none;
}

.heartbeat-beat.tooltip-left::after {
    left: auto;
    right: 0;
    transform: none;
}

/* Response time */
.monitor-response {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
    width: 70px;
    min-width: 70px;
    max-width: 70px;
    justify-content: flex-end;
    flex: 0 0 70px;
}

.monitor-response i {
    font-size: 0.7rem;
    color: var(--accent-color);
}



/* ==========================================
   Maintenance Card Overrides
   ========================================== */

.maintenance-card .incident-item {
    text-align: center;
}

.maintenance-card .incident-title {
    font-size: 1.15rem;
}

.maintenance-card .incident-message {
    font-size: 0.95rem;
}

.maintenance-card .incident-meta {
    justify-content: center;
    font-size: 0.9rem;
}

.maintenance-card .incident-badge {
    font-size: 0.8rem;
}

/* ==========================================
   Incidents
   ========================================== */

.incidents-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.incident-item {
    background: var(--payment-btn-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.25rem;
    border-left: 4px solid #ef4444;
}

.incident-item.resolved {
    border-left-color: #22c55e;
    opacity: 0.7;
}

.incident-item.investigating {
    border-left-color: #ef4444;
}

.incident-item.identified {
    border-left-color: #fbbf24;
}

.incident-item.monitoring {
    border-left-color: var(--accent-color);
}

.incident-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
}

.incident-message {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.incident-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.incident-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.15rem 0.6rem;
    border-radius: 1rem;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.incident-badge.investigating {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.incident-badge.identified {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
}

.incident-badge.monitoring {
    background: rgba(94, 179, 255, 0.15);
    color: var(--accent-color);
}

.incident-badge.resolved {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

/* ==========================================
   Response Time Chart
   ========================================== */

.chart-card {
    position: relative;
    padding-top: 1.5rem !important;
}

.chart-header {
    padding-right: 2.5rem;
}

.chart-container {
    width: 100%;
    height: 250px;
    position: relative;
}

.chart-container canvas {
    width: 100% !important;
    height: 100% !important;
}

.chart-subtitle {
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-secondary);
}

.chart-close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--payment-btn-bg);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chart-close-btn:hover {
    background: var(--payment-btn-hover);
    color: var(--text-primary);
    border-color: var(--accent-color);
}

/* ==========================================
   Refresh / Last Updated
   ========================================== */

.refresh-card {
    text-align: center;
    padding: 1rem 1.5rem !important;
}

.refresh-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.refresh-info span {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.refresh-btn {
    background: var(--payment-btn-bg);
    border: 1px solid var(--border-color);
    color: var(--accent-color);
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.refresh-btn:hover {
    background: var(--payment-btn-hover);
    border-color: var(--accent-color);
    transform: rotate(180deg);
}

.refresh-btn.spinning i {
    animation: spin 0.6s linear;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.auto-refresh-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

.auto-refresh-info i {
    font-size: 0.75rem;
}

/* ==========================================
   Nav active state
   ========================================== */

.nav-links a.nav-active {
    background: var(--payment-btn-hover);
    color: var(--accent-color);
}

/* Uptime summary removed — compact layout uses inline uptime % */

/* ==========================================
   Error state
   ========================================== */

.error-message {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.error-message i {
    font-size: 2.5rem;
    color: #ef4444;
    margin-bottom: 1rem;
    display: block;
}

.error-message p {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.error-message small {
    font-size: 0.85rem;
    opacity: 0.7;
}

/* ==========================================
   Stagger animations for monitor items
   ========================================== */

.monitor-item {
    animation: fadeInUp 0.4s ease-out both;
}

.monitor-item:nth-child(1) {
    animation-delay: 0.1s;
}

.monitor-item:nth-child(2) {
    animation-delay: 0.15s;
}

.monitor-item:nth-child(3) {
    animation-delay: 0.2s;
}

.monitor-item:nth-child(4) {
    animation-delay: 0.25s;
}

.monitor-item:nth-child(5) {
    animation-delay: 0.3s;
}

.monitor-item:nth-child(6) {
    animation-delay: 0.35s;
}

.monitor-item:nth-child(7) {
    animation-delay: 0.4s;
}

.monitor-item:nth-child(8) {
    animation-delay: 0.45s;
}

.monitor-item:nth-child(9) {
    animation-delay: 0.5s;
}

.monitor-item:nth-child(10) {
    animation-delay: 0.55s;
}

/* ==========================================
   Responsive
   ========================================== */

@media (max-width: 768px) {
    .status-banner {
        padding: 1.2rem 1.25rem;
    }

    .status-banner h1 {
        font-size: 1.2rem;
    }

    .status-banner-icon {
        font-size: 1.6rem;
    }

    .chart-container {
        height: 200px;
    }
}

@media (max-width: 550px) {
    .monitor-item {
        flex-wrap: wrap;
    }

    .heartbeat-bar {
        order: 10;
        width: 100%;
        flex: none;
        height: 18px;
    }
}

@media (max-width: 480px) {
    .status-banner h1 {
        font-size: 1.1rem;
    }

    .monitor-name {
        font-size: 0.82rem;
    }

    .monitor-uptime-pct,
    .monitor-response {
        font-size: 0.75rem;
    }
}