/* Resolve Status Page - Dark Theme (matching Atlassian Statuspage) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

:root {
    --color-background: #1A2549;
    --color-font-primary: #CFCFCF;
    --color-font-secondary: #FFFFFF;
    --color-border: #E0E0E0;
    --color-link: #42A5F5;
    --color-green: #66BB6A;
    --color-yellow: #F1C40F;
    --color-red: #DE2F1B;
    --color-gray: #9E9E9E;
    --color-no-data: #B3BAC5;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    font-family: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, #000000 0%, #0d1637 50%, #1a2549 100%);
    background-attachment: fixed;
    color: var(--color-font-primary);
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

a {
    color: var(--color-link);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Status Page Layout */
.status-page {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.masthead {
    padding: 40px 0 30px;
    text-align: center;
}

.masthead .logo {
    height: 64px;
    width: auto;
}

/* Overall Status Banner */
.page-status {
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 30px;
    text-align: center;
}

.page-status.status-up {
    background-color: var(--color-green);
}

.page-status.status-down {
    background-color: var(--color-red);
}

.page-status.status-degraded {
    background-color: var(--color-yellow);
}

.page-status.status-maintenance {
    background-color: var(--color-gray);
}

.page-status h2 {
    color: white;
    margin: 0;
    font-size: 1.5rem;
    font-weight: 500;
}

/* Components Section */
.components-section {
    margin-bottom: 30px;
}

.components-header {
    color: var(--color-font-secondary);
    font-size: 0.85rem;
    margin-bottom: 15px;
    opacity: 0.8;
}

.component-container {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(224, 224, 224, 0.1);
    border-radius: 4px;
    margin-bottom: 2px;
}

.component-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
}

.component-name {
    flex: 1;
    font-size: 0.95rem;
    color: var(--color-font-primary);
    opacity: 0.9;
}

.component-name .infrastructure {
    font-size: 0.75rem;
    color: var(--color-font-secondary);
    opacity: 0.5;
    margin-left: 10px;
}

.component-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.status-indicator.up {
    background-color: var(--color-green);
}

.status-indicator.down {
    background-color: var(--color-red);
}

.status-indicator.degraded {
    background-color: var(--color-yellow);
}

.status-indicator.maintenance {
    background-color: var(--color-gray);
}

.status-text.up { color: var(--color-green); }
.status-text.down { color: var(--color-red); }
.status-text.degraded { color: var(--color-yellow); }
.status-text.maintenance { color: var(--color-gray); }

/* Uptime Graph */
.uptime-section {
    margin-top: 20px;
}

.uptime-graph-container {
    margin-bottom: 25px;
}

.uptime-service-name {
    font-size: 0.85rem;
    color: var(--color-font-primary);
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.uptime-percentage {
    font-size: 0.8rem;
    color: var(--color-font-secondary);
    opacity: 0.7;
}

.uptime-graph {
    display: flex;
    gap: 2px;
    height: 34px;
}

.uptime-day-wrapper {
    flex: 1;
    min-width: 3px;
    position: relative;
}

.uptime-day {
    width: 100%;
    height: 100%;
    border-radius: 2px;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
}

.uptime-day-wrapper:hover .uptime-day {
    opacity: 0.7;
    transform: scaleY(1.1);
}

.uptime-day.up { background-color: var(--color-green); }
.uptime-day.down { background-color: var(--color-red); }
.uptime-day.degraded { background-color: var(--color-yellow); }
.uptime-day.maintenance { background-color: var(--color-gray); }
.uptime-day.no-data { background-color: var(--color-no-data); }

/* Uptime Tooltip */
.uptime-tooltip {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: #2a3a5c;
    border: 1px solid rgba(224, 224, 224, 0.3);
    border-radius: 6px;
    padding: 12px 16px;
    min-width: 200px;
    max-width: 280px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s, visibility 0.15s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.uptime-day-wrapper:hover .uptime-tooltip {
    opacity: 1;
    visibility: visible;
}

/* Tooltip arrow */
.uptime-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: #2a3a5c;
}

.uptime-tooltip::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 9px solid transparent;
    border-top-color: rgba(224, 224, 224, 0.3);
}

.uptime-tooltip .tooltip-date {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-font-secondary);
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(224, 224, 224, 0.15);
}

.uptime-tooltip .tooltip-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    margin-bottom: 6px;
}

.uptime-tooltip .tooltip-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.uptime-tooltip .tooltip-status-dot.up { background-color: var(--color-green); }
.uptime-tooltip .tooltip-status-dot.down { background-color: var(--color-red); }
.uptime-tooltip .tooltip-status-dot.degraded { background-color: var(--color-yellow); }
.uptime-tooltip .tooltip-status-dot.maintenance { background-color: var(--color-gray); }

.uptime-tooltip .tooltip-no-incidents {
    font-size: 0.8rem;
    color: var(--color-font-primary);
    opacity: 0.8;
}

.uptime-tooltip .tooltip-incidents {
    margin-top: 8px;
}

.uptime-tooltip .tooltip-incident {
    font-size: 0.75rem;
    color: var(--color-font-primary);
    padding: 4px 0;
    padding-left: 14px;
    position: relative;
}

.uptime-tooltip .tooltip-incident::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--color-font-secondary);
    opacity: 0.6;
}

/* Adjust tooltip position for edge cases */
.uptime-day-wrapper:first-child .uptime-tooltip {
    left: 0;
    transform: translateX(0);
}

.uptime-day-wrapper:first-child .uptime-tooltip::after,
.uptime-day-wrapper:first-child .uptime-tooltip::before {
    left: 12px;
    transform: translateX(0);
}

.uptime-day-wrapper:last-child .uptime-tooltip {
    left: auto;
    right: 0;
    transform: translateX(0);
}

.uptime-day-wrapper:last-child .uptime-tooltip::after,
.uptime-day-wrapper:last-child .uptime-tooltip::before {
    left: auto;
    right: 12px;
    transform: translateX(0);
}

.uptime-legend {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--color-font-secondary);
    opacity: 0.6;
    margin-top: 5px;
}

/* Active Incidents */
.incidents-section {
    margin-top: 40px;
}

.incidents-header {
    font-size: 1rem;
    color: var(--color-font-secondary);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(224, 224, 224, 0.1);
}

.incident-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(224, 224, 224, 0.1);
    border-radius: 4px;
    padding: 15px 20px;
    margin-bottom: 10px;
}

.incident-card.down {
    border-left: 3px solid var(--color-red);
}

.incident-card.degraded {
    border-left: 3px solid var(--color-yellow);
}

.incident-card.maintenance {
    border-left: 3px solid var(--color-gray);
}

.incident-title {
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 5px;
}

.incident-title.down { color: var(--color-red); }
.incident-title.degraded { color: var(--color-yellow); }
.incident-title.maintenance { color: var(--color-gray); }

.incident-description {
    font-size: 0.85rem;
    color: var(--color-font-primary);
    opacity: 0.8;
    margin-bottom: 8px;
}

.incident-meta {
    font-size: 0.75rem;
    color: var(--color-font-secondary);
    opacity: 0.5;
}

/* Footer */
.page-footer {
    text-align: center;
    padding: 40px 0;
    font-size: 0.8rem;
    color: var(--color-font-secondary);
    opacity: 0.5;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--color-font-secondary);
    opacity: 0.6;
}

/* Error State */
.error-message {
    background: rgba(222, 47, 27, 0.1);
    border: 1px solid var(--color-red);
    border-radius: 4px;
    padding: 15px;
    color: var(--color-red);
    text-align: center;
}

/* Tooltip */
.tooltip {
    position: absolute;
    background: #2a3a5c;
    border: 1px solid rgba(224, 224, 224, 0.2);
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 0.75rem;
    color: var(--color-font-secondary);
    z-index: 1000;
    pointer-events: none;
    white-space: nowrap;
}

/* Blazor Error UI */
#blazor-error-ui {
    background: #b32121;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    color: white;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

/* Uptime/History Page */
.uptime-page {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 20px;
}

.uptime-page-header {
    margin-bottom: 30px;
}

.uptime-page-header h1 {
    color: var(--color-font-secondary);
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.uptime-page-header p {
    color: var(--color-font-primary);
    opacity: 0.7;
    margin: 0;
    font-size: 0.9rem;
}

.no-incidents {
    text-align: center;
    padding: 60px 20px;
    color: var(--color-font-primary);
    opacity: 0.6;
}

/* Incident Timeline */
.incident-timeline {
    margin-bottom: 40px;
}

.month-group {
    margin-bottom: 30px;
}

.month-header {
    color: var(--color-font-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(224, 224, 224, 0.1);
}

.timeline-incident {
    display: flex;
    gap: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(224, 224, 224, 0.1);
    border-radius: 6px;
    padding: 20px 24px;
    margin-bottom: 12px;
    transition: background 0.15s ease;
}

.timeline-incident:hover {
    background: rgba(255, 255, 255, 0.05);
}

.timeline-incident.down {
    border-left: 4px solid var(--color-red);
}

.timeline-incident.degraded {
    border-left: 4px solid var(--color-yellow);
}

.timeline-incident.maintenance {
    border-left: 4px solid var(--color-gray);
}

.incident-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 55px;
    padding-right: 20px;
    margin-right: 5px;
    border-right: 1px solid rgba(224, 224, 224, 0.15);
}

.incident-date .day {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-font-secondary);
    line-height: 1;
}

.incident-date .weekday {
    font-size: 0.65rem;
    color: var(--color-font-primary);
    opacity: 0.5;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 6px;
}

.incident-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.incident-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 2px;
}

.status-badge {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-badge.down {
    background: rgba(222, 47, 27, 0.15);
    color: var(--color-red);
    border: 1px solid rgba(222, 47, 27, 0.3);
}

.status-badge.degraded {
    background: rgba(241, 196, 15, 0.15);
    color: var(--color-yellow);
    border: 1px solid rgba(241, 196, 15, 0.3);
}

.status-badge.maintenance {
    background: rgba(158, 158, 158, 0.15);
    color: var(--color-gray);
    border: 1px solid rgba(158, 158, 158, 0.3);
}

.incident-service {
    font-size: 0.75rem;
    color: var(--color-link);
    opacity: 0.9;
    font-weight: 500;
}

.timeline-incident .incident-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-font-secondary);
    margin: 0;
    line-height: 1.4;
}

.timeline-incident .incident-description {
    font-size: 0.85rem;
    color: var(--color-font-primary);
    opacity: 0.75;
    margin: 0;
    line-height: 1.5;
}

.incident-timing {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--color-font-primary);
    opacity: 0.5;
    margin-top: 4px;
    padding-top: 10px;
    border-top: 1px solid rgba(224, 224, 224, 0.08);
}

.incident-timing::before {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23CFCFCF'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z'/%3E%3C/svg%3E") no-repeat center;
    background-size: contain;
    opacity: 0.5;
}

.incident-timing .duration {
    margin-left: 4px;
    padding-left: 8px;
    border-left: 1px solid rgba(224, 224, 224, 0.2);
    opacity: 1;
}

.incident-timing .ongoing {
    color: var(--color-red);
    font-weight: 600;
    animation: pulse 2s infinite;
}

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