/* Core Styling & Design System */

:root {
    /* Color Palette - Dark Mode (Default) */
    --bg-base: #08090d;
    --bg-surface: #0f111a;
    --bg-surface-elevated: #161924;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    --accent: #6366f1; /* Indigo */
    --accent-glow: rgba(99, 102, 241, 0.2);
    --accent-light: #818cf8;
    
    --success: #10b981; /* Emerald */
    --success-glow: rgba(16, 185, 129, 0.25);
    
    --warning: #f59e0b; /* Amber */
    
    --card-bg: rgba(15, 17, 26, 0.7);
    --nav-bg: rgba(8, 9, 13, 0.75);
    --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
    
    --transition-speed: 0.3s;
}

[data-theme="light"] {
    /* Color Palette - Light Mode */
    --bg-base: #f8fafc;
    --bg-surface: #ffffff;
    --bg-surface-elevated: #f1f5f9;
    --border-color: rgba(0, 0, 0, 0.08);
    --border-hover: rgba(0, 0, 0, 0.15);
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --accent: #4f46e5;
    --accent-glow: rgba(79, 70, 229, 0.15);
    --accent-light: #6366f1;
    
    --success: #059669;
    --success-glow: rgba(5, 150, 105, 0.15);
    
    --warning: #d97706;
    
    --card-bg: rgba(255, 255, 255, 0.75);
    --nav-bg: rgba(248, 250, 252, 0.8);
    --card-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.06);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-base);
    color: var(--text-primary);
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

body {
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Background Grid Overlay */
.grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(var(--border-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--border-color) 1px, transparent 1px);
    background-size: 50px 50px;
    opacity: 0.25;
    pointer-events: none;
    z-index: -1;
}

/* Utility Styles */
.text-accent {
    color: var(--accent);
}

.animate-spin {
    animation: spin 2s linear infinite;
}

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

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
    transition: background var(--transition-speed), border var(--transition-speed);
}

.nav-container {
    max-width: 1200px;
    height: 100%;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: 1px;
}

.logo-icon {
    color: var(--accent);
    width: 24px;
    height: 24px;
}

.accent-text {
    color: var(--accent);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color var(--transition-speed);
    position: relative;
    padding: 0.25rem 0;
}

.nav-link:hover {
    color: var(--accent-light);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent);
    transition: width var(--transition-speed);
}

.nav-link:hover::after {
    width: 100%;
}

.theme-toggle-btn {
    background: none;
    border: 1px solid var(--border-color);
    padding: 0.5rem;
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color var(--transition-speed), background var(--transition-speed);
}

.theme-toggle-btn:hover {
    border-color: var(--accent);
    background: rgba(99, 102, 241, 0.05);
}

.theme-toggle-btn i {
    width: 18px;
    height: 18px;
}

/* Light / Dark Mode Toggle Visibility */
[data-theme="dark"] .sun-icon { display: block; }
[data-theme="dark"] .moon-icon { display: none; }
[data-theme="light"] .sun-icon { display: none; }
[data-theme="light"] .moon-icon { display: block; }

/* Hero Section */
.hero-section {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding-top: 70px;
}

#hero-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    text-align: center;
    padding: 0 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: fadeIn var(--transition-speed) ease-out;
}

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

.badge-container {
    margin-bottom: 1.5rem;
}

.pulse-badge {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: var(--card-shadow);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: var(--success);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 0 var(--success-glow);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    letter-spacing: -1px;
}

.hero-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    color: var(--text-secondary);
    max-width: 600px;
    margin-bottom: 2.5rem;
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* Buttons */
.btn {
    text-decoration: none;
    padding: 0.8rem 1.8rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-primary {
    background-color: var(--accent);
    color: white;
    box-shadow: 0 4px 14px var(--accent-glow);
}

.btn-primary:hover {
    background-color: var(--accent-light);
    box-shadow: 0 6px 20px var(--accent-glow);
}

.btn-secondary {
    background-color: var(--bg-surface-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--accent-light);
    background-color: var(--bg-surface);
}

.hero-scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    opacity: 0.7;
    animation: bounce 2s infinite;
}

.scroll-text {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
}

.scroll-icon {
    color: var(--text-muted);
    width: 18px;
    height: 18px;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translate(-50%, 0); }
    40% { transform: translate(-50%, -10px); }
    60% { transform: translate(-50%, -5px); }
}

/* Sections General */
.dashboard-section, .features-section {
    padding: 6rem 2rem;
    position: relative;
    border-top: 1px solid var(--border-color);
}

.section-container {
    max-width: 1200px;
    margin: 0 auto;
}

.section-header {
    margin-bottom: 3.5rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.section-title-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-icon {
    width: 32px;
    height: 32px;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.section-desc {
    color: var(--text-secondary);
    max-width: 600px;
    font-size: 1.05rem;
    line-height: 1.6;
}

/* Server Status Pill */
.server-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    box-shadow: var(--card-shadow);
}

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

.online .status-indicator {
    background-color: var(--success);
    box-shadow: 0 0 10px var(--success-glow);
}

.status-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

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

.stat-card {
    position: relative;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    overflow: hidden;
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    box-shadow: var(--card-shadow);
    transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    min-height: 260px;
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: var(--border-hover);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.card-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle 100px at var(--mouse-x, 0px) var(--mouse-y, 0px), var(--accent-glow), transparent 80%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.stat-card:hover .card-glow {
    opacity: 1;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.card-icon {
    width: 20px;
    height: 20px;
    color: var(--text-muted);
}

.card-body {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Uptime specific styles */
.uptime-display-wrap {
    flex-direction: column;
    gap: 1rem;
}

.uptime-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    text-align: center;
}

.refresh-spinner {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

/* Circular Progress Rings */
.progress-ring-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring-bar {
    stroke-dasharray: 314.16;
    stroke-dashoffset: 314.16;
    transition: stroke-dashoffset 0.8s ease-out;
    stroke-linecap: round;
}

.progress-value {
    position: absolute;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.card-footer {
    margin-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

.card-footer-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Features Grid Section */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2.2rem;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: var(--card-shadow);
    transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    box-shadow: 0 12px 40px rgba(99, 102, 241, 0.1);
}

.feature-icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.feature-icon {
    width: 24px;
    height: 24px;
    color: white;
}

/* Icon Colors */
.bg-indigo { background: linear-gradient(135deg, #6366f1, #4f46e5); }
.bg-green { background: linear-gradient(135deg, #10b981, #059669); }
.bg-orange { background: linear-gradient(135deg, #f97316, #ea580c); }
.bg-pink { background: linear-gradient(135deg, #ec4899, #db2777); }
.bg-purple { background: linear-gradient(135deg, #a855f7, #7c3aed); }

.feature-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.feature-card-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    flex-grow: 1;
}

.feature-btn {
    text-decoration: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    padding: 0.8rem 1.2rem;
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 0.2s, border-color 0.2s;
}

.feature-card:hover .feature-btn {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.feature-btn i {
    width: 16px;
    height: 16px;
    transition: transform 0.2s;
}

.feature-btn:hover i {
    transform: translate(2px, -2px);
}

/* Footer Section */
.footer {
    background: var(--nav-bg);
    border-top: 1px solid var(--border-color);
    padding: 4rem 2rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: background var(--transition-speed);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    text-align: center;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

.footer-logo-icon {
    color: var(--accent);
    width: 20px;
    height: 20px;
}

.server-meta {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    justify-content: center;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    padding: 1rem 2rem;
    border-radius: 12px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.meta-item i {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.meta-item span {
    font-family: 'JetBrains Mono', monospace;
}

.footer-copy {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .nav-links {
        display: none; /* simple hidden links on small screens */
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .server-status-pill {
        align-self: flex-start;
    }
    
    .server-meta {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
        padding: 1rem 1.5rem;
    }
}
