/*
 * Copyright (C) 2025 Micr0Byte <micr0@micr0.dev>
 * Licensed under the Overworked License (OWL) v2.0
 */

:root {
    /* Light theme */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border: rgba(148, 163, 184, 0.1);
    --accent: #6366f1;
    --success: #22c55e;
    --warning: #eab308;
    --error: #ef4444;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --gradient: linear-gradient(135deg, #6366f1, #8b5cf6);
}

/* Dark theme */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #0f172a;
        --bg-secondary: #1e293b;
        --card-bg: #1e293b;
        --text-primary: #f1f5f9;
        --text-secondary: #94a3b8;
        --border: rgba(148, 163, 184, 0.1);
        --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
    }
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    transition: background-color 0.3s ease;
}

.last-updated {
    font-size: 0.875rem;
    color: white;
    display: block;
    margin-top: 0.5rem;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Status Header */
.status-header {
    background: var(--gradient);
    padding: 3rem 0;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.status-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="40" fill="none" stroke="white" stroke-width="0.5" stroke-opacity="0.1"/></svg>') 0 0/50px 50px;
    opacity: 0.1;
}

.status-header h1 {
    color: white;
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    position: relative;
}

.system-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    backdrop-filter: blur(8px);
    width: fit-content;
    color: white;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    position: relative;
}

.status-indicator.operational {
    background: var(--success);
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.2);
}

/* Status Grid */
.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.status-card {
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.status-card h3 {
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.status-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.status-info .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

/* Stats Section */
.quick-stats {
    margin: 3rem 0;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: transform 0.2s ease;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

/* Charts Section */
.detailed-analytics {
    margin: 3rem 0;
}

/* Responsive Design */
@media (max-width: 400px) {
    .status-header {
        padding: 2rem 0;
    }

    .status-header h1 {
        font-size: 2rem;
    }

    .stat-value {
        font-size: 2rem;
    }
}

/* Animations */
@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.3);
    }

    100% {
        transform: scale(1);
    }
}

.status-indicator.operational {
    animation: pulse 2s infinite;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--text-secondary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* Timeline styles */
.event-timeline {
    margin: 3rem 0;
    padding-bottom: 2rem;
}

.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 100%;
    background: var(--gradient);
    opacity: 0.3;
}

.timeline-item {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    margin: 2rem 0;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 0.5s ease forwards;
}

.timeline-content {
    width: 45%;
    position: relative;
    padding: 1.5rem;
    background: var(--card-bg);
    border-radius: 1rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.timeline-item:nth-child(odd) .timeline-content {
    margin-right: 55%;
}

.timeline-item:nth-child(even) .timeline-content {
    margin-left: 55%;
}

.timeline-content::before {
    content: '';
    position: absolute;
    top: 50%;
    width: 20px;
    height: 20px;
    background: var(--gradient);
    border-radius: 50%;
    transform: translateY(-50%);
}

.timeline-item:nth-child(odd) .timeline-content::before {
    right: -60px;
}

.timeline-item:nth-child(even) .timeline-content::before {
    left: -60px;
}

.timeline-time {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.timeline-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.timeline-details {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.timeline-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-top: 0.5rem;
    background: var(--gradient);
    color: white;
}

@keyframes fadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .timeline::before {
        left: 0;
    }

    .timeline-item {
        justify-content: flex-start;
    }

    .timeline-content {
        width: calc(100% - 40px);
        margin-left: 40px !important;
        margin-right: 0 !important;
    }

    .timeline-content::before {
        left: -30px !important;
    }
}

.section-title {
    padding: 0 1.5rem;
    /* Add padding to section titles */
    margin-bottom: 2rem;
}

.detailed-analytics {
    margin: 3rem 0;
}

.analytics-container {
    display: grid;
    grid-template-columns: 40% 28% 28%;
    gap: 2%;
    width: 100%;
    margin: 0 auto;
}

.chart-card {
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 1.5rem;
    border: 1px solid var(--border);
    transition: transform 0.2s ease;
}


.chart-card h3 {
    margin: 0 0 1rem 0;
    color: var(--text-secondary);
    font-size: 1rem;
}

.chart-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .analytics-container {
        grid-template-columns: 1fr
    }

    .chart-card {
        width: 100% !important;
    }

    .chart-wrapper canvas {
        width: 100% !important;
        height: auto !important;
    }

    /* Adjust heights for mobile */
    .chart-card:first-child .chart-wrapper canvas {
        height: 300px !important;
    }

    .chart-card:not(:first-child) .chart-wrapper canvas {
        height: 250px !important;
    }
}

.load-more-container {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

.load-more-btn {
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow);
}

.load-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.load-more-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.status-header {
    position: relative;
    height: 400px;
    width: 100%;
    margin-bottom: 0;
    padding: 1rem;
    overflow: hidden;
}

.banner-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;

}

.banner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    z-index: 2;
}

.status-header .container {
    position: relative;
    z-index: 3;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding-bottom: 2rem;
}

.system-status {
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(8px);
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    color: white;
    width: fit-content;
    margin-top: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

body {
    margin: 0;
    padding: 0;
    background: var(--bg-primary);
    min-height: 100vh;
    position: relative;
}


.main-content {
    position: relative;
    background: var(--bg-primary);
    margin-top: -1rem;
    /* Pull up to overlap banner */
    border-radius: 1rem 1rem 0 0;
    padding-top: 1rem;
    z-index: 2;
}

.status-header {
    position: relative;
    height: 400px;
    width: 100%;
    margin-bottom: 0;
    padding: 1rem;
    overflow: hidden;
}

.banner-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

.banner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    z-index: 2;
}

.banner-content {
    position: relative;
    z-index: 3;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding-bottom: 0rem;
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-left: auto;
}

.social-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(8px);
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    color: white;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.social-button:hover {
    background: rgba(30, 41, 59, 0.8);
    transform: translateY(-2px);
}

.social-icon {
    width: 1.2rem;
    height: 1.2rem;
}

.system-status {
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(8px);
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    color: white;
    width: fit-content;
    margin-top: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

@media (max-width: 768px) {
    .status-header {
        height: auto;
        padding: 0;
        margin-bottom: 0rem;
        background: var(--bg-primary);
    }

    .status-header .container {
        padding-bottom: 0;
    }

    .banner-image {
        height: 200px;
    }

    .banner-content {
        flex-direction: column;
        align-items: stretch;
        padding: 0;
        padding-top: 220px;

    }

    .system-status {
        background: var(--card-bg);
        backdrop-filter: none;
        border: 1px solid var(--border);
        margin: 0;
        width: 100%;
        text-align: center;
        color: var(--text-primary);
    }

    .social-links {
        display: flex;
        gap: 0.5rem;
        margin-top: 0.5rem;
        margin-left: 0;
    }

    .social-button {
        flex: 1;
        background: var(--card-bg);
        backdrop-filter: none;
        border: 1px solid var(--border);
        color: var(--text-primary);
        justify-content: center;
    }

    .main-content {
        margin-top: -1.5rem;
        border-radius: 0;
        padding-top: 0;
    }
}