/* ============================================================================
   Status Page Theme - Enhanced to match FlatlyPage CMS
   Author: WebOrbiton Team
   Colors: Dark[Bg:#0a0a0a, Fg:#ffffff] | Light[Bg:#f4f4f4, Fg:#0a0a0a]
   ============================================================================ */

/* ======================================================
   CSS VARIABLES & THEME SYSTEM
====================================================== */
:root {
    /* Dark theme (default) */
    --background: #0a0a0a;
    --foreground: #ffffff;
    --card: rgba(255, 255, 255, 0.04);
    --card-hover: rgba(255, 255, 255, 0.10);
    --muted: #a0a0a0;
    --border: rgba(255, 255, 255, 0.12);
    --success: #ffffff;
    --warning: #ffffff;
    --error: #ffffff;
    --navbar-bg: rgba(12, 12, 12, 0.75);
    --glass-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    --grid-line: rgba(255, 255, 255, 0.06);
    --orb-color: rgba(255, 255, 255, 0.06);
}

:root[data-theme="light"] {
    /* Light theme */
    --background: #f4f4f4;
    --foreground: #0a0a0a;
    --card: rgba(255, 255, 255, 0.7);
    --card-hover: rgba(255, 255, 255, 0.95);
    --muted: #6b6b6b;
    --border: rgba(0, 0, 0, 0.10);
    --success: #0a0a0a;
    --warning: #0a0a0a;
    --error: #0a0a0a;
    --navbar-bg: rgba(244, 244, 244, 0.85);
    --glass-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
    --grid-line: rgba(0, 0, 0, 0.06);
    --orb-color: rgba(0, 0, 0, 0.04);
}

/* Auto light mode based on system preference */
@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) {
        --background: #f4f4f4;
        --foreground: #0a0a0a;
        --card: rgba(255, 255, 255, 0.7);
        --card-hover: rgba(255, 255, 255, 0.95);
        --muted: #6b6b6b;
        --border: rgba(0, 0, 0, 0.10);
        --success: #0a0a0a;
        --warning: #0a0a0a;
        --error: #0a0a0a;
        --navbar-bg: rgba(244, 244, 244, 0.85);
        --glass-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
        --grid-line: rgba(0, 0, 0, 0.06);
        --orb-color: rgba(0, 0, 0, 0.04);
    }
}

/* ======================================================
   GLOBAL STYLES
====================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html,
body {
    width: 100%;
    height: 100%;
}

body {
    background: var(--background);
    color: var(--foreground);
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    transition: background-color 0.4s ease, color 0.4s ease;
    position: relative;
    overflow-x: hidden;
}

/* Noise texture overlay */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 1000;
    opacity: 0.5;
    mix-blend-mode: overlay;
}

/* Ambient orbs background */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 20% 30%, var(--orb-color) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, var(--orb-color) 0%, transparent 50%);
    z-index: -1;
    pointer-events: none;
}

/* Typography */
h1, h2, h3 {
    font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
    letter-spacing: -0.04em;
}

/* Selection */
::selection {
    background: var(--foreground);
    color: var(--background);
}

::-moz-selection {
    background: var(--foreground);
    color: var(--background);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--background);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 5px;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--foreground);
}

/* ======================================================
   HEADER STYLES
====================================================== */
header {
    position: sticky;
    top: 24px;
    z-index: 100;
    margin: 24px auto 0;
    max-width: calc(100% - 48px);
    width: 1152px;
    background: var(--navbar-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 30px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--glass-shadow);
}

header:hover {
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.55);
}

.header-content {
    max-width: 100%;
    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;
    font-family: 'Space Grotesk', sans-serif;
}

.company-name {
    font-weight: 700;
    font-size: 17px;
    color: var(--foreground);
    letter-spacing: -0.02em;
}

.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;
    position: relative;
}

.hero h1 {
    font-size: clamp(3rem, 8vw, 5.5rem);
    font-weight: 800;
    margin-bottom: 20px;
    line-height: 1.15;
    letter-spacing: -0.04em;
    background: linear-gradient(180deg, var(--foreground) 30%, var(--muted) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.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;
    transition: transform 0.3s ease;
}

.meta-item:hover {
    transform: scale(1.05);
}

.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: 700;
    font-family: 'Space Grotesk', sans-serif;
}

/* ======================================================
   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.02em;
}

.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: 16px;
    background: var(--card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: visible;
}

.service:hover {
    background: var(--card-hover);
    border-color: var(--foreground);
    transform: translateY(-4px);
    box-shadow: var(--glass-shadow);
}

.service-info h3 {
    font-size: 19px;
    font-weight: 700;
    color: var(--foreground);
    margin-bottom: 24px;
    letter-spacing: -0.02em;
}

.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);
    transition: transform 0.2s ease, padding-left 0.2s ease;
}

.stat-row:hover {
    transform: translateX(4px);
    padding-left: 4px;
}

.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.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
}

.badge-operational {
    color: var(--success);
}

.badge-operational:hover {
    border-color: var(--foreground);
    background: var(--card-hover);
}

.badge-degraded {
    color: var(--warning);
}

.badge-degraded:hover {
    border-color: var(--foreground);
    background: var(--card-hover);
}

.badge-outage {
    color: var(--error);
}

.badge-outage:hover {
    border-color: var(--foreground);
    background: var(--card-hover);
}

/* ======================================================
   UPTIME DISPLAY
====================================================== */
.uptime-display {
    text-align: center;
    padding: 20px;
    background: var(--card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 12px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.uptime-display:hover {
    background: var(--card-hover);
    border-color: var(--foreground);
}

.uptime-percentage {
    font-size: 56px;
    font-weight: 800;
    color: var(--foreground);
    line-height: 1;
    letter-spacing: -0.04em;
    font-family: 'Space Grotesk', sans-serif;
    transition: transform 0.3s ease;
}

.uptime-display:hover .uptime-percentage {
    transform: scale(1.05);
}

.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(--card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 20px;
    margin-top: 16px;
    transition: all 0.3s ease;
}

.chart-container:hover {
    background: var(--card-hover);
    border-color: var(--foreground);
}

/* ======================================================
   STATUS DOTS
====================================================== */
.status-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    margin-right: 9px;
    position: relative;
    background: var(--foreground);
}

.status-dot::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: inherit;
    animation: pulse-ring 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.dot-up {
    background: var(--success);
}

.dot-up::before {
    background: var(--success);
}

.dot-degraded {
    background: var(--warning);
    opacity: 0.7;
}

.dot-degraded::before {
    background: var(--warning);
}

.dot-down {
    background: var(--error);
    opacity: 0.5;
}

.dot-down::before {
    background: var(--error);
}

@keyframes pulse-ring {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.5;
    }
    50% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0;
    }
}

/* ======================================================
   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);
}

/* ======================================================
   RESPONSIVE - TABLET
====================================================== */
@media (max-width: 768px) {
    header {
        top: 10px;
        margin: 10px;
        max-width: calc(100% - 20px);
        border-radius: 30px;
    }

    header:hover {
        border-color: var(--border);
        box-shadow: var(--glass-shadow);
    }

    .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: clamp(2.5rem, 8vw, 3.5rem);
        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%;
    }

    body::after {
        background:
            radial-gradient(circle at 20% 10%, var(--orb-color) 0%, transparent 40%),
            radial-gradient(circle at 80% 90%, var(--orb-color) 0%, transparent 40%);
    }
}

/* ======================================================
   RESPONSIVE - MOBILE
====================================================== */
@media (max-width: 480px) {
    header {
        top: 8px;
        margin: 8px;
        max-width: calc(100% - 16px);
        border-radius: 24px;
    }

    .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: clamp(2rem, 7vw, 2.5rem);
        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: 12px;
    }

    .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;
    }
}

/* ======================================================
   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);
    }
}

/* ======================================================
   ACCESSIBILITY
====================================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ======================================================
   PRINT STYLES
====================================================== */
@media print {
    body::before,
    body::after {
        display: none;
    }

    header {
        position: relative;
        top: 0;
        margin: 0;
        max-width: 100%;
        border: 2px solid #000;
        border-radius: 0;
        box-shadow: none;
    }

    .service {
        break-inside: avoid;
        page-break-inside: avoid;
        border: 1px solid #ccc;
    }

    body {
        background: white;
        color: black;
    }
}