:root {
    --container-5xl: 47.5rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family:
        -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", system-ui,
        sans-serif;
    background: #000;
    color: #fff;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    /* Prevent zoom and horizontal scroll on mobile */
    touch-action: pan-y;
    overscroll-behavior-x: none;
}

.container {
    max-width: calc(var(--container-5xl) - 40px);
    margin: 0 auto;
    padding: 0 20px;
}

header {
    padding: 16px 0 16px 0;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.home-link {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    text-decoration: none;
}

.home-link svg {
    width: 20px;
    height: 20px;
    stroke: #fff;
}

.repo-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 9px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    text-decoration: none;
    color: #fff;
    font-size: 10px;
    font-weight: 500;
}

.repo-link:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

h1 {
    font-size: 48px;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin: 0;
    display: none; /* Hide the "Status" title */
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px;
    width: 100%;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    transition: all 0.3s ease;
    margin: 0 0 12px 0;
}

.status-badge.degraded {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

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

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    animation: pulse 2s ease-in-out infinite;
}

.status-badge.degraded .status-dot {
    background: #f59e0b;
}

.status-badge.down .status-dot {
    background: #ef4444;
}

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

.metadata {
    display: flex;
    gap: 24px;
    margin: 0 0 20px 0;
    font-size: 13px;
    color: #666;
}

.metadata-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.metadata-label {
    color: #666;
}

.metadata-value {
    color: #aaa;
    font-variant-numeric: tabular-nums;
}

.services {
    margin: 20px 0 40px 0;
    overflow: visible;
}

.service-item {
    padding: 20px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
}

.service-item:first-child {
    padding-top: 0;
}

.service-item:last-child {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.service-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.service-name {
    font-size: 16px;
    font-weight: 400;
    color: #fff;
    text-transform: capitalize;
}

.service-name.error {
    color: #ef4444;
}

.service-status-text {
    font-size: 13px;
    color: #10b981;
    font-weight: 500;
    text-transform: capitalize;
}

.service-status-text.down {
    color: #ef4444;
}

.service-status-text.degraded {
    color: #f59e0b;
}

.uptime-container {
    position: relative;
    width: 100%;
    overflow: visible;
}

.uptime-bar {
    display: grid;
    grid-template-columns: repeat(60, 1fr);
    gap: 5px;
    height: 32px;
    width: 100%;
    position: relative;
    overflow: visible;
}

.uptime-day {
    background: #1a1a1a;
    border-radius: 2px;
    transition: all 0.2s ease;
    position: relative;
    cursor: default;
    min-width: 0;
}

/* Extended hover area to include gaps */
.uptime-day::before {
    content: "";
    position: absolute;
    top: -2px;
    bottom: -2px;
    left: -2.5px;
    right: -2.5px;
    z-index: 1;
}

.uptime-day.up {
    background: #10b981;
}

.uptime-day.down {
    background: #ef4444;
}

.uptime-day.degraded {
    background: #f59e0b;
}

.uptime-day.partial {
    background: linear-gradient(to top, #10b981 70%, #f59e0b 70%);
}

.uptime-day.unknown {
    background: #4b5563;
}

.uptime-day:hover {
    z-index: 100;
    filter: brightness(1.2);
}

.uptime-day:hover .uptime-tooltip {
    opacity: 1;
    visibility: visible;
    z-index: 9998;
    pointer-events: auto;
}

.uptime-tooltip {
    position: absolute;
    top: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%);
    background: #000;
    border: 1px solid #1f1f1f;
    border-radius: 0;
    padding: 12px 14px;
    font-size: 12px;
    min-width: 240px;
    min-height: 50px;
    max-width: 300px;
    opacity: 0;
    visibility: hidden;
    transition: none;
    pointer-events: none;
    z-index: 9999;
    text-align: left;
    white-space: normal;
    user-select: text;
    cursor: text;
}

.uptime-tooltip:hover {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.uptime-tooltip::before,
.uptime-tooltip::after {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 10px solid transparent;
    border-bottom-color: #1f1f1f;
    pointer-events: none;
}

.tooltip-date {
    font-weight: 500;
    color: #fff;
    margin-bottom: 4px;
}

.tooltip-status {
    color: #888;
}

.tooltip-status.up {
    color: #10b981;
}

.tooltip-status.down {
    color: #ef4444;
}

.tooltip-layout {
    padding: 6px 0;
    margin-top: 6px;
}

.uptime-labels {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #666;
    margin-top: 5px;
}

.response-time {
    font-size: 12px;
    color: #666;
    font-variant-numeric: tabular-nums;
}

.history-section {
    margin: 24px 0 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.history-section h2 {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 16px;
    letter-spacing: 0;
}

.incident-date {
    margin-bottom: 24px;
}

.incident-date-header {
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.incident-date-header h3 {
    font-size: 15px;
    font-weight: 500;
    color: #fff;
    margin: 0;
}

.incident-date {
    margin-bottom: 24px;
}

.incident-date-header {
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.incident-date-header h3 {
    font-size: 15px;
    font-weight: 500;
    color: #fff;
    margin: 0;
}

.incident-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.incident-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}

.incident-item:last-child {
    border-bottom: none;
}

.incident-service {
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    flex-shrink: 0;
}

.incident-separator {
    font-size: 12px;
    color: #fff;
    flex-shrink: 0;
}

.incident-details {
    font-size: 10px;
    font-weight: 400;
    color: #fff;
    flex: 1;
}

/* Specific styles for history page */
.history-page .incident-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.history-page .incident-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    align-items: flex-start;
}

.history-page .incident-item-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.show-more-container {
    margin: 10px 0;
    text-align: center;
}

.show-more-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.show-more-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.history-page .incident-item:last-child {
    border-bottom: none;
}

.history-page .incident-service {
    font-size: 12px;
    font-weight: 500;
}

.history-page .incident-separator {
    font-size: 12px;
    color: #fff;
    flex-shrink: 0;
}

.history-page .incident-details {
    font-size: 11px;
    font-weight: 400;
}

.history-page .incident-date {
    font-size: 10px;
    color: #666;
    margin-top: 6px;
}

.no-incidents-today {
    color: #aaa; /* Muted white/light gray color, not dark */
    font-style: normal; /* No italic */
}

.no-incidents {
    font-size: 14px;
    color: #666;
    text-align: center;
    padding: 20px 0;
}

.history-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s ease;
}

.history-link:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.history-link-text-only {
    background: none !important;
    border: none !important;
    padding: 5px 9px !important;
    font-size: 10px !important;
    font-weight: 500;
}

.history-link-text-only:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    border: none !important;
    border-radius: 5px;
}

.loading {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

footer {
    color: #666;
    font-size: 12px;
    margin: 50px 0 50px 0;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    width: 100%;
}

.history-nav {
    margin: 0;
}

footer p {
    margin: 0;
    text-align: center;
    color: #666;
    font-size: 12px;
    width: 100%;
}

.incident-month-header {
    font-size: 20px;
    font-weight: 500;
    margin: 24px 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .footer-content p {
        display: none; /* Hide the refresh text on mobile to maintain consistency */
    }

    .uptime-tooltip {
        min-width: 200px;
        max-width: calc(100vw - 40px);
        padding: 10px 12px;
    }

    /* On mobile, adjust tooltip positioning for first items */
    .uptime-day:nth-child(-n + 10) .uptime-tooltip {
        left: 0;
        transform: translateX(0);
    }

    .uptime-day:nth-child(-n + 10) .uptime-tooltip::before,
    .uptime-day:nth-child(-n + 10) .uptime-tooltip::after {
        left: 15px;
        transform: translateX(0);
    }

    /* On mobile, adjust tooltip positioning for last items */
    .uptime-day:nth-last-child(-n + 10) .uptime-tooltip {
        left: auto;
        right: 0;
        transform: translateX(0);
    }

    .uptime-day:nth-last-child(-n + 10) .uptime-tooltip::before,
    .uptime-day:nth-last-child(-n + 10) .uptime-tooltip::after {
        left: auto;
        right: 15px;
        transform: translateX(0);
    }
}
