/* ═══════════════════════════════════════════════════════════════════════════
   TNX DATA Status Page Styles

   Brand Identity System v3 colors and typography. This is a public-facing page
   so it uses Product UI semantics (Deep Navy shell, white panels, Evidence Blue
   interactive) but sits outside the main application.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
    /* TNX Brand Colors (Brand Identity System v3, §7) */
    --charcoal:      #212427;
    --white:         #FFFFFF;
    --deep-navy:     #0F172A;

    --harbour-blue-600: #426E9C;
    --cool-grey-700:    #666B71;
    --cool-grey-400:    #A8ADB3;
    --cool-grey-200:    #D5D8DC;

    /* Semantic colors (AA-corrected, never sole carrier of status) */
    --evidence-blue-600:    #1D5CDE;
    --governance-green-600: #047A55;
    --risk-red-600:         #CE2222;

    /* Typography (§8) */
    --font-display: Georgia, 'Times New Roman', serif;
    --font-body:    Helvetica, 'Helvetica Neue', Arial, sans-serif;
    --font-data:    'IBM Plex Mono', ui-monospace, SFMono-Regular, monospace;
}

/* ─── Reset ─── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--charcoal);
    background: #F8F9FA;
    min-height: 100vh;
}

/* ─── Page Layout ─── */
.page-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    background: var(--white);
    border-bottom: 1px solid var(--cool-grey-200);
    padding: 32px 0;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.logo svg {
    display: block;
}

.header-title h1 {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 600;
    color: var(--charcoal);
    margin-bottom: 4px;
}

.subtitle {
    font-size: 14px;
    color: var(--cool-grey-700);
}

.main-content {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 40px 24px;
}

/* ─── Overall Status Banner ─── */
.status-banner {
    background: var(--white);
    border: 1px solid var(--cool-grey-200);
    border-radius: 8px;
    padding: 32px;
    margin-bottom: 32px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 20px;
}

.status-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    flex-shrink: 0;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.status-dot.operational {
    background: var(--governance-green-600);
    animation: none; /* Stop pulse when operational */
}

.status-dot.degraded {
    background: #F59E0B; /* Amber/Warning */
}

.status-dot.outage {
    background: var(--risk-red-600);
}

.status-dot.unknown {
    background: var(--cool-grey-400);
}

.status-text h2 {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 600;
    color: var(--charcoal);
    margin-bottom: 4px;
}

.last-updated {
    font-size: 14px;
    color: var(--cool-grey-700);
}

/* ─── Deployments Grid ─── */
.deployments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.deployment-card {
    background: var(--white);
    border: 1px solid var(--cool-grey-200);
    border-radius: 8px;
    padding: 24px;
    transition: box-shadow 0.2s;
}

.deployment-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.deployment-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--cool-grey-200);
}

.deployment-name {
    display: flex;
    align-items: center;
    gap: 12px;
}

.deployment-name h3 {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 600;
    color: var(--charcoal);
    text-transform: uppercase;
}

/* Region display removed - internal AWS detail not relevant to customers */

.deployment-status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 16px;
    flex-shrink: 0;
}

.deployment-status-badge.operational {
    background: color-mix(in srgb, var(--governance-green-600) 15%, white);
    color: var(--governance-green-600);
}

.deployment-status-badge.degraded {
    background: color-mix(in srgb, #F59E0B 15%, white);
    color: #D97706;
}

.deployment-status-badge.outage {
    background: color-mix(in srgb, var(--risk-red-600) 15%, white);
    color: var(--risk-red-600);
}

.deployment-status-badge.unknown {
    background: color-mix(in srgb, var(--cool-grey-700) 15%, white);
    color: var(--cool-grey-700);
}

/* ─── Components List ─── */
.components-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.component-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.component-name {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--charcoal);
}

.component-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.component-dot.operational {
    background: var(--governance-green-600);
}

.component-dot.degraded {
    background: #F59E0B;
}

.component-dot.outage {
    background: var(--risk-red-600);
}

.component-dot.unknown {
    background: var(--cool-grey-400);
}

.component-status-text {
    font-size: 12px;
    color: var(--cool-grey-700);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ─── Legend ─── */
.legend {
    background: var(--white);
    border: 1px solid var(--cool-grey-200);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
}

.legend h3 {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    color: var(--charcoal);
    margin-bottom: 16px;
}

.legend-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--cool-grey-700);
}

/* ─── Components Info ─── */
.components-info {
    background: var(--white);
    border: 1px solid var(--cool-grey-200);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 40px;
}

.components-info h3 {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    color: var(--charcoal);
    margin-bottom: 16px;
}

.component-descriptions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.component-desc {
    font-size: 14px;
    color: var(--cool-grey-700);
    line-height: 1.5;
}

.component-desc strong {
    color: var(--charcoal);
    font-weight: 500;
}

/* ─── Loading State ─── */
.loading-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--cool-grey-700);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--cool-grey-200);
    border-top-color: var(--evidence-blue-600);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

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

/* ─── Footer ─── */
.footer {
    background: var(--white);
    border-top: 1px solid var(--cool-grey-200);
    padding: 24px 0;
    margin-top: auto;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 14px;
    color: var(--cool-grey-700);
}

.last-updated-time {
    font-family: var(--font-data);
    font-size: 13px;
}

.auto-refresh {
    margin-left: 16px;
    font-size: 12px;
    color: var(--cool-grey-400);
}

.footer-links {
    display: flex;
    gap: 8px;
    align-items: center;
}

.footer-links a {
    color: var(--evidence-blue-600);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--harbour-blue-600);
    text-decoration: underline;
}

.separator {
    color: var(--cool-grey-400);
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .deployments-grid {
        grid-template-columns: 1fr;
    }

    .legend-items {
        grid-template-columns: 1fr;
    }

    .component-descriptions {
        grid-template-columns: 1fr;
    }

    .footer-content {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }

    .auto-refresh {
        margin-left: 0;
        display: block;
        margin-top: 4px;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 20px 16px;
    }

    .main-content {
        padding: 24px 16px;
    }

    .status-banner {
        padding: 20px;
    }

    .deployment-card {
        padding: 20px;
    }

    .header-title h1 {
        font-size: 24px;
    }

    .status-text h2 {
        font-size: 20px;
    }
}
