/* ======================================================
   CSS STYLESHEET - ENHANCED VERSION
   Modern design with dark mode support
====================================================== */

/* ======================================================
   CSS VARIABLES & THEME SYSTEM
====================================================== */
:root {
    color-scheme: light dark;
    
    /* Light theme (default) */
    --background: #ffffff;
    --foreground: #111111;
    --card: #f5f5f5;
    --card-hover: #efefef;
    --muted: #666666;
    --border: #e0e0e0;
    --success: #16a34a;
    --warning: #f59e0b;
    --error: #dc2626;
    --navbar-bg: rgba(255, 255, 255, 0.95);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
}

:root[data-theme="dark"] {
    color-scheme: dark;
    
    /* Dark theme */
    --background: #111111;
    --foreground: #fafafa;
    --card: #1a1a1a;
    --card-hover: #222222;
    --muted: #888888;
    --border: #2a2a2a;
    --success: #22c55e;
    --warning: #fbbf24;
    --error: #ef4444;
    --navbar-bg: rgba(17, 17, 17, 0.95);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
}

/* Auto dark mode based on system preference */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        --background: #111111;
        --foreground: #fafafa;
        --card: #1a1a1a;
        --card-hover: #222222;
        --muted: #888888;
        --border: #2a2a2a;
        --success: #22c55e;
        --warning: #fbbf24;
        --error: #ef4444;
        --navbar-bg: rgba(17, 17, 17, 0.95);
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
        --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    }
}

/* ======================================================
   GLOBAL STYLES
====================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
}

body {
    background: var(--background);
    color: var(--foreground);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ======================================================
   HEADER STYLES
====================================================== */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--navbar-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    transition: all 0.3s ease;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo {
    width: 28px;
    height: 28px;
    background: var(--foreground);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--background);
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.logo:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.company-name {
    font-weight: 700;
    font-size: 17px;
    color: var(--foreground);
    letter-spacing: -0.01em;
}

.status-type {
    font-size: 12px;
    color: var(--muted);
    font-weight: 500;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 24px;
    font-size: 13px;
    color: var(--muted);
    font-weight: 500;
}

/* ======================================================
   MAIN CONTENT
====================================================== */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 40px 80px;
}

/* ======================================================
   HERO SECTION
====================================================== */
.hero {
    margin-bottom: 80px;
}

.hero h1 {
    font-size: 52px;
    font-weight: 800;
    color: var(--foreground);
    margin-bottom: 20px;
    line-height: 1.15;
    letter-spacing: -0.03em;
}

.hero p {
    font-size: 19px;
    color: var(--muted);
    margin-bottom: 40px;
    max-width: 620px;
    line-height: 1.6;
}

.hero-meta {
    display: flex;
    align-items: center;
    gap: 40px;
    padding: 28px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.meta-label {
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}

.meta-value {
    font-size: 17px;
    color: var(--foreground);
    font-weight: 600;
}

/* ======================================================
   STATUS SECTION
====================================================== */
.status-section {
    margin-bottom: 70px;
}

.section-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--foreground);
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
    letter-spacing: -0.01em;
}

.services-grid {
    display: grid;
    gap: 24px;
}

.service {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    padding: 36px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--card);
    transition: all 0.3s ease;
}

.service:hover {
    background: var(--card-hover);
    border-color: var(--muted);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.service-info h3 {
    font-size: 19px;
    font-weight: 700;
    color: var(--foreground);
    margin-bottom: 24px;
    letter-spacing: -0.01em;
}

.service-stats {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

.stat-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.stat-label {
    font-size: 14px;
    color: var(--muted);
    font-weight: 500;
}

.stat-value {
    font-size: 15px;
    font-weight: 700;
    color: var(--foreground);
}

/* ======================================================
   STATUS BADGES
====================================================== */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    transition: all 0.2s ease;
}

.badge-operational {
    background: rgba(34, 197, 94, 0.12);
    color: var(--success);
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.badge-degraded {
    background: rgba(251, 191, 36, 0.12);
    color: var(--warning);
    border: 1px solid rgba(251, 191, 36, 0.2);
}

.badge-outage {
    background: rgba(239, 68, 68, 0.12);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* ======================================================
   UPTIME DISPLAY
====================================================== */
.uptime-display {
    text-align: center;
    padding: 20px;
    background: var(--background);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.uptime-percentage {
    font-size: 56px;
    font-weight: 800;
    color: var(--foreground);
    line-height: 1;
    letter-spacing: -0.02em;
}

.uptime-label {
    font-size: 11px;
    color: var(--muted);
    margin-top: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}

/* ======================================================
   CHART CONTAINER
====================================================== */
.chart-container {
    position: relative;
    height: 200px;
    background: var(--background);
    border-radius: 8px;
    border: 1px solid var(--border);
    padding: 20px;
}

/* ======================================================
   STATUS DOTS
====================================================== */
.status-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    margin-right: 9px;
    position: relative;
}

.status-dot::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    animation: pulse-dot 2s ease-in-out infinite;
}

.dot-up {
    background: var(--success);
}

.dot-up::after {
    background: var(--success);
}

.dot-degraded {
    background: var(--warning);
}

.dot-degraded::after {
    background: var(--warning);
}

.dot-down {
    background: var(--error);
}

.dot-down::after {
    background: var(--error);
}

@keyframes pulse-dot {
    0%, 100% {
        opacity: 0.3;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(2);
    }
}

/* ======================================================
   FOOTER
====================================================== */
footer {
    max-width: 1200px;
    margin: 0 auto;
    padding: 48px 40px;
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-left {
    display: flex;
    gap: 24px;
}

.footer-left a {
    color: var(--muted);
    text-decoration: none;
    transition: color 0.2s ease;
    font-weight: 500;
}

.footer-left a:hover {
    color: var(--foreground);
}

/* ======================================================
   THEME TOGGLE BUTTON (Optional)
====================================================== */
.theme-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 1000;
    box-shadow: var(--shadow-md);
}

.theme-toggle:hover {
    background: var(--card-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
    stroke: var(--foreground);
    fill: none;
    stroke-width: 2;
}

/* ======================================================
   RESPONSIVE - TABLET
====================================================== */
@media (max-width: 768px) {
    .header-content {
        padding: 16px 24px;
        flex-wrap: wrap;
        gap: 12px;
    }

    .header-left {
        width: 100%;
    }

    .header-right {
        width: 100%;
        gap: 16px;
        font-size: 12px;
    }

    main {
        padding: 40px 24px;
    }

    .hero {
        margin-bottom: 48px;
    }

    .hero h1 {
        font-size: 38px;
        margin-bottom: 16px;
    }

    .hero p {
        font-size: 17px;
        margin-bottom: 32px;
    }

    .hero-meta {
        flex-direction: column;
        gap: 20px;
        padding: 20px 0;
        align-items: flex-start;
    }

    .meta-item {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }

    .section-title {
        font-size: 19px;
        margin-bottom: 24px;
    }

    .service {
        grid-template-columns: 1fr;
        gap: 28px;
        padding: 28px;
    }

    .service-info h3 {
        font-size: 17px;
        margin-bottom: 20px;
    }

    .service-stats {
        gap: 16px;
    }

    .stat-row {
        padding-bottom: 10px;
    }

    .uptime-display {
        padding: 16px;
    }

    .uptime-percentage {
        font-size: 42px;
    }

    .chart-container {
        height: 180px;
        margin-top: 20px;
        padding: 16px;
    }

    footer {
        flex-direction: column;
        gap: 20px;
        text-align: center;
        padding: 32px 24px;
    }

    .footer-left {
        flex-direction: column;
        gap: 16px;
        width: 100%;
    }
}

/* ======================================================
   RESPONSIVE - MOBILE
====================================================== */
@media (max-width: 480px) {
    .header-content {
        padding: 14px 16px;
    }

    .header-right {
        display: none;
    }

    .logo {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }

    .company-name {
        font-size: 15px;
    }

    .status-type {
        font-size: 11px;
    }

    main {
        padding: 28px 16px;
    }

    .hero {
        margin-bottom: 36px;
    }

    .hero h1 {
        font-size: 30px;
        margin-bottom: 12px;
    }

    .hero p {
        font-size: 15px;
        margin-bottom: 28px;
    }

    .hero-meta {
        gap: 16px;
        padding: 16px 0;
    }

    .meta-label {
        font-size: 10px;
    }

    .meta-value {
        font-size: 15px;
    }

    .status-section {
        margin-bottom: 48px;
    }

    .section-title {
        font-size: 17px;
        margin-bottom: 20px;
        padding-bottom: 12px;
    }

    .service {
        padding: 20px;
        gap: 20px;
        border-radius: 10px;
    }

    .service-info h3 {
        font-size: 16px;
        margin-bottom: 16px;
    }

    .service-stats {
        gap: 14px;
    }

    .stat-row {
        padding-bottom: 10px;
    }

    .stat-label {
        font-size: 13px;
    }

    .stat-value {
        font-size: 14px;
    }

    .uptime-display {
        padding: 14px;
    }

    .uptime-percentage {
        font-size: 36px;
    }

    .uptime-label {
        font-size: 10px;
    }

    .chart-container {
        height: 150px;
        padding: 14px;
    }

    .status-badge {
        font-size: 10px;
        padding: 6px 11px;
    }

    footer {
        padding: 28px 16px;
        font-size: 12px;
    }

    .theme-toggle {
        bottom: 16px;
        right: 16px;
        width: 44px;
        height: 44px;
    }

    .theme-toggle svg {
        width: 18px;
        height: 18px;
    }
}

/* ======================================================
   RESPONSIVE - EXTRA SMALL
====================================================== */
@media (max-width: 360px) {
    main {
        padding: 20px 12px;
    }

    .hero h1 {
        font-size: 26px;
    }

    .hero p {
        font-size: 14px;
    }

    .service {
        padding: 16px;
        gap: 16px;
    }

    .service-info h3 {
        font-size: 15px;
    }

    .uptime-percentage {
        font-size: 32px;
    }

    .chart-container {
        height: 130px;
        padding: 12px;
    }
}

/* ======================================================
   UTILITY CLASSES
====================================================== */
.fade-in {
    animation: fadeIn 0.6s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ======================================================
   PRINT STYLES
====================================================== */
@media print {
    header {
        position: relative;
        border-bottom: 2px solid #000;
    }

    .theme-toggle {
        display: none;
    }

    .service {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    body {
        background: white;
        color: black;
    }
}