/* CSS Reset & Variables */
:root {
    --bg-dark: #09090b;
    --bg-card: rgba(20, 20, 23, 0.65);
    --bg-card-hover: rgba(28, 28, 32, 0.85);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.18);
    
    /* Neon Theme Colors */
    --color-green: #10b981;
    --color-blue: #3b82f6;
    --color-cyan: #06b6d4;
    --color-purple: #a855f7;
    --color-orange: #f97316;
    --color-red: #ef4444;
    
    /* Glow Shadows */
    --glow-green: 0 0 20px rgba(16, 185, 129, 0.25);
    --glow-blue: 0 0 20px rgba(59, 82, 246, 0.25);
    --glow-cyan: 0 0 20px rgba(6, 182, 212, 0.25);
    --glow-purple: 0 0 20px rgba(168, 85, 247, 0.25);
    
    /* Fonts */
    --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

body {
    background-color: var(--bg-dark);
    color: #f4f4f5;
    font-family: var(--font-main);
    overflow-x: hidden;
    min-height: 100vh;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.24);
}

/* Fluid Neon Glow Background */
.glow-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.glow-sphere {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.15;
    mix-blend-mode: screen;
}

.glow-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--color-blue) 0%, transparent 80%);
    top: -10%;
    right: 5%;
    animation: floatGlow1 25s infinite alternate ease-in-out;
}

.glow-2 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--color-purple) 0%, transparent 80%);
    bottom: -15%;
    left: -5%;
    animation: floatGlow2 30s infinite alternate ease-in-out;
}

@keyframes floatGlow1 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-80px, 50px) scale(1.1); }
}

@keyframes floatGlow2 {
    0% { transform: translate(0, 0) scale(1.1); }
    100% { transform: translate(100px, -60px) scale(0.9); }
}

/* Main Dashboard Wrapper */
.dashboard-wrapper {
    max-width: 1600px;
    margin: 0 auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-height: 100vh;
}

/* Header Section */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
    margin-top: 10px;
}

.header-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 4px 12px;
    border-radius: 20px;
    width: fit-content;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.pulse-dot.green {
    background-color: var(--color-green);
    box-shadow: 0 0 8px var(--color-green);
    animation: pulseGlow 1.8s infinite;
}

.pulse-dot.red {
    background-color: var(--color-red);
    box-shadow: 0 0 8px var(--color-red);
    animation: pulseGlow 1.2s infinite;
}

@keyframes pulseGlow {
    0% { transform: scale(0.95); opacity: 0.5; box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
    70% { transform: scale(1.1); opacity: 1; box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); opacity: 0.5; box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.status-text {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-green);
}

.main-title {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #ffffff 30%, #a1a1aa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 13px;
    color: #71717a;
    font-weight: 400;
}

.header-right {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    padding: 12px 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
}

.time-block {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.time-display {
    font-family: var(--font-mono);
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #ffffff;
}

.date-display {
    font-size: 11px;
    color: #a1a1aa;
    font-weight: 600;
    letter-spacing: 0.05em;
}

/* KPI Cards Layout */
.kpi-grid {
    display: grid;
    grid-template-cols: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.kpi-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.kpi-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
}

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

.kpi-title {
    font-size: 13px;
    color: #a1a1aa;
    font-weight: 600;
}

.kpi-icon {
    font-size: 20px;
}

.kpi-value {
    font-family: var(--font-mono);
    font-size: 32px;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 12px;
    transition: color 0.3s;
}

.kpi-footer {
    display: flex;
    align-items: center;
    gap: 8px;
}

.trend-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    color: #a1a1aa;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.trend-badge.green {
    background: rgba(16, 185, 129, 0.08);
    color: var(--color-green);
    border: 1px solid rgba(16, 185, 129, 0.15);
}

.trend-badge.cyan {
    background: rgba(6, 182, 212, 0.08);
    color: var(--color-cyan);
    border: 1px solid rgba(6, 182, 212, 0.15);
}

.trend-badge.orange {
    background: rgba(249, 115, 22, 0.08);
    color: var(--color-orange);
    border: 1px solid rgba(249, 115, 22, 0.15);
}

.trend-badge.red {
    background: rgba(239, 68, 68, 0.08);
    color: var(--color-red);
    border: 1px solid rgba(239, 68, 68, 0.15);
}

.footer-desc {
    font-size: 11px;
    color: #52525b;
}

/* Glow Text effects */
.text-glow-green { text-shadow: 0 0 12px rgba(16, 185, 129, 0.4); color: var(--color-green); }
.text-glow-blue { text-shadow: 0 0 12px rgba(59, 82, 246, 0.4); color: var(--color-blue); }
.text-glow-purple { text-shadow: 0 0 12px rgba(168, 85, 247, 0.4); color: var(--color-purple); }
.text-glow-cyan { text-shadow: 0 0 12px rgba(6, 182, 212, 0.4); color: var(--color-cyan); }
.text-glow-red { text-shadow: 0 0 12px rgba(239, 68, 68, 0.4); color: var(--color-red); }

/* Main Grid Content - Chart and Alerts */
.main-content-layout {
    display: grid;
    grid-template-cols: 1.4fr 1fr;
    gap: 20px;
}

.content-section {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    padding-bottom: 16px;
}

.header-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title-icon {
    font-size: 20px;
}

.section-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: -0.01em;
}

/* Chart Styles */
.legend-group {
    display: flex;
    gap: 16px;
    font-size: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #a1a1aa;
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.legend-dot.cpu { background-color: var(--color-blue); }
.legend-dot.memory { background-color: var(--color-purple); }

.chart-container {
    position: relative;
    width: 100%;
    height: 280px;
}

/* Alert Section Styles */
.live-tag {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--color-red);
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 2px 8px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.alert-list-wrapper {
    height: 280px;
    overflow-y: auto;
    padding-right: 4px;
}

.alert-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    list-style: none;
}

.alert-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    transition: all 0.2s;
}

.alert-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

/* Alert Levels styling */
.alert-item.info { border-left: 3px solid var(--color-blue); }
.alert-item.warning { border-left: 3px solid var(--color-orange); }
.alert-item.critical { border-left: 3px solid var(--color-red); }

.alert-icon-wrapper {
    font-size: 16px;
    margin-top: 2px;
}

.alert-item.info .alert-icon-wrapper { color: var(--color-blue); }
.alert-item.warning .alert-icon-wrapper { color: var(--color-orange); }
.alert-item.critical .alert-icon-wrapper { color: var(--color-red); }

.alert-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex-grow: 1;
}

.alert-time {
    font-family: var(--font-mono);
    font-size: 11px;
    color: #52525b;
}

.alert-msg {
    font-size: 12.5px;
    color: #e4e4e7;
    line-height: 1.4;
}

/* Bell Shake Animation */
.animate-bell {
    animation: bellShake 3s infinite;
    transform-origin: top center;
}

@keyframes bellShake {
    0%, 100% { transform: rotate(0); }
    15% { transform: rotate(10deg); }
    30% { transform: rotate(-10deg); }
    45% { transform: rotate(5deg); }
    60% { transform: rotate(-5deg); }
    75% { transform: rotate(0); }
}

/* Footer Section */
.footer-layout {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: auto;
}

/* Notice Board */
.notice-board-section {
    background: rgba(249, 115, 22, 0.04);
    border: 1px solid rgba(249, 115, 22, 0.15);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.notice-header {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--color-orange);
    flex-shrink: 0;
}

.notice-icon {
    font-size: 18px;
}

.notice-header h3 {
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-right: 1px solid rgba(249, 115, 22, 0.25);
    padding-right: 16px;
}

.notice-ticker-container {
    overflow: hidden;
    flex-grow: 1;
    position: relative;
    height: 20px;
}

.notice-ticker {
    display: flex;
    white-space: nowrap;
    position: absolute;
    animation: ticker 40s linear infinite;
    gap: 40px;
}

.notice-item {
    font-size: 12px;
    color: #e4e4e7;
    font-weight: 500;
}

@keyframes ticker {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.ticker-loading {
    font-size: 12px;
    color: #71717a;
    font-style: italic;
}

/* Footer Meta values */
.footer-meta {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    padding-top: 16px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.meta-label {
    font-size: 11px;
    color: #52525b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.meta-value {
    font-family: var(--font-mono);
    font-size: 12px;
    color: #a1a1aa;
    font-weight: 700;
}

.meta-divider {
    width: 1px;
    height: 12px;
    background-color: rgba(255, 255, 255, 0.08);
}

.meta-copyright {
    font-size: 11px;
    color: #3f3f46;
    margin-left: auto;
}

/* Skeleton Loading Animation */
.skeleton {
    position: relative;
    overflow: hidden;
}

.skeleton::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.04) 20%,
        rgba(255, 255, 255, 0.08) 60%,
        rgba(255, 255, 255, 0) 100%
    );
    animation: skeletonShimmer 1.5s infinite;
    transform: translateX(-100%);
}

@keyframes skeletonShimmer {
    100% { transform: translateX(100%); }
}

.skeleton-line {
    display: block;
    height: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
    width: 80%;
}

/* Responsive Media Queries */
@media (max-width: 1024px) {
    .main-content-layout {
        grid-template-cols: 1fr;
    }
    
    .chart-container {
        height: 240px;
    }
}

@media (max-width: 768px) {
    .dashboard-wrapper {
        padding: 16px;
        gap: 16px;
    }

    .main-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .header-right {
        width: 100%;
        justify-content: flex-start;
    }

    .time-block {
        align-items: flex-start;
    }

    .notice-board-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .notice-header h3 {
        border-right: none;
        padding-right: 0;
    }

    .footer-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .meta-copyright {
        margin-left: 0;
        margin-top: 4px;
    }

    .meta-divider {
        display: none;
    }
}
