/* Copyright.sh Status Page Styles */

:root {
    --primary-color: #2563eb;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-600: #4b5563;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --border-radius: 8px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background-color: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
header {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 2rem 0;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.logo {
    margin-right: 0.5rem;
}

.subtitle {
    color: var(--gray-600);
    font-size: 1.1rem;
}

/* Main Content */
main {
    padding: 2rem 0;
}

section {
    margin-bottom: 3rem;
}

section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--gray-900);
}

/* Overall Status */
.overall-status {
    margin-bottom: 2rem;
}

.status-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.status-indicator {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    flex-shrink: 0;
}

.status-indicator.healthy {
    background-color: var(--success-color);
    color: white;
}

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

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

.status-indicator.loading {
    background-color: var(--gray-200);
    color: var(--gray-600);
}

.status-content h2 {
    margin-bottom: 0.5rem;
    font-size: 1.75rem;
}

.status-content p {
    color: var(--gray-600);
    margin-bottom: 0.5rem;
}

.status-content small {
    color: var(--gray-500);
    font-size: 0.9rem;
}

/* Services Grid */
.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

.service-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.service-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.service-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.service-status {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    flex-shrink: 0;
}

.service-status.healthy {
    background-color: var(--success-color);
}

.service-status.unhealthy,
.service-status.error,
.service-status.timeout {
    background-color: var(--error-color);
}

.service-status.loading {
    background-color: var(--gray-300);
    animation: pulse 2s infinite;
}

.service-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0;
}

.service-card p {
    color: var(--gray-600);
    font-size: 0.9rem;
}

.service-details {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
    font-size: 0.85rem;
    color: var(--gray-500);
}

.service-details div {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.25rem;
}

/* Test Grid */
.test-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.test-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1rem;
    border-left: 4px solid var(--gray-300);
}

.test-card.passed {
    border-left-color: var(--success-color);
}

.test-card.failed,
.test-card.error {
    border-left-color: var(--error-color);
}

.test-card.skipped {
    border-left-color: var(--warning-color);
}

.test-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.test-status {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.test-status.passed {
    background-color: var(--success-color);
}

.test-status.failed,
.test-status.error {
    background-color: var(--error-color);
}

.test-status.skipped {
    background-color: var(--warning-color);
}

.test-card h4 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.test-card p {
    font-size: 0.85rem;
    color: var(--gray-600);
}

.test-duration {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 0.5rem;
}

/* Uptime Stats */
.uptime-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.uptime-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    text-align: center;
}

.uptime-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 0.5rem;
}

.uptime-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--success-color);
}

/* Incidents */
.incident-list {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
}

.no-incidents {
    text-align: center;
    color: var(--gray-600);
}

.incident {
    padding: 1rem 0;
    border-bottom: 1px solid var(--gray-200);
}

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

.incident-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.incident-status {
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.incident-status.resolved {
    background-color: var(--success-color);
    color: white;
}

.incident-status.investigating {
    background-color: var(--warning-color);
    color: white;
}

/* Footer */
footer {
    background: white;
    border-top: 1px solid var(--gray-200);
    padding: 2rem 0;
    text-align: center;
    color: var(--gray-600);
    font-size: 0.9rem;
}

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

footer a:hover {
    text-decoration: underline;
}

.api-info {
    margin-top: 0.5rem;
    font-size: 0.8rem;
}

/* Loading Animations */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

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

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--gray-300);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .container {
        padding: 0 0.5rem;
    }
    
    .status-card {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .service-grid,
    .test-grid,
    .uptime-grid {
        grid-template-columns: 1fr;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --gray-50: #111827;
        --gray-100: #1f2937;
        --gray-200: #374151;
        --gray-300: #4b5563;
        --gray-600: #9ca3af;
        --gray-800: #f3f4f6;
        --gray-900: #ffffff;
    }
    
    body {
        background-color: var(--gray-50);
        color: var(--gray-800);
    }
    
    .status-card,
    .service-card,
    .test-card,
    .uptime-card,
    .incident-list,
    header,
    footer {
        background-color: var(--gray-100);
        border-color: var(--gray-200);
    }
}