:root {
    --bg-color: #0b0f1a;
    --glass-bg: rgba(255, 255, 255, 0.04);
    --glass-border: rgba(255, 255, 255, 0.1);
    --accent: #38bdf8;
    --text-main: #f8fafc;
    --text-dim: #94a3b8;
    --online: #10b981;
    --offline: #ef4444;
    --pending: #f59e0b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
    scroll-behavior: smooth; /* Added for smooth scrolling to speed test */
}

.background-blob {
    position: fixed;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
    filter: blur(120px);
    opacity: 0.07;
    z-index: -1;
    top: -10%;
    left: -10%;
}

.glass-nav {
    position: fixed;
    top: 0;
    width: 100%;
    height: 72px;
    background: rgba(11, 15, 26, 0.5);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: center;
    z-index: 100;
}

.nav-content {
    width: 90%;
    max-width: 1000px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-logo {
    height: 38px;
    width: auto;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-indicator.online {
    width: 8px;
    height: 8px;
    background-color: var(--online);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--online);
}

.nav-status {
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
}

.container {
    margin-top: 140px;
    width: 90%;
    max-width: 1000px;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.hero-section {
    margin-bottom: 4rem;
}

header h1 {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    margin-bottom: 0.75rem;
    background: linear-gradient(to right, #fff, var(--text-dim));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    color: var(--text-dim);
    font-size: 1.1rem;
    max-width: 500px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
    width: 100%;
    margin-bottom: 6rem;
}

.glass-card {
    position: relative;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 28px;
    padding: 2.5rem 1.5rem;
    text-decoration: none;
    color: var(--text-main);
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.card-status {
    position: absolute;
    top: 20px;
    right: 20px;
}

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

.dot.pending { background: var(--pending); box-shadow: 0 0 8px var(--pending); }
.dot.online { background: var(--online); box-shadow: 0 0 8px var(--online); }
.dot.offline { background: var(--offline); box-shadow: 0 0 8px var(--offline); }

.icon-box {
    background: rgba(255, 255, 255, 0.03);
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    margin-bottom: 1.5rem;
    border: 1px solid var(--glass-border);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.glass-card i {
    width: 28px;
    height: 28px;
    color: var(--accent);
}

.glass-card span {
    font-weight: 600;
    font-size: 1rem;
}

.glass-card:hover {
    background: rgba(255, 255, 255, 0.07);
    transform: translateY(-10px);
    border-color: rgba(56, 189, 248, 0.4);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.glass-card:hover .icon-box {
    transform: scale(1.15) rotate(8deg);
    background: rgba(56, 189, 248, 0.15);
    border-color: var(--accent);
}

/* Speed Test Section Styles */
.speed-section {
    width: 100%;
    margin-bottom: 6rem;
}

.section-header {
    margin-bottom: 2rem;
}

.section-header h2 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.section-header p {
    color: var(--text-dim);
    font-size: 0.9rem;
}

.speed-embed-container {
    width: 100%;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 32px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    min-height: 400px;
}

.speed-embed-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.glass-footer {
    width: 100%;
    padding: 2.5rem 0;
    text-align: center;
    border-top: 1px solid var(--glass-border);
    background: rgba(11, 15, 26, 0.3);
}

.glass-footer p {
    color: var(--text-dim);
    font-size: 0.85rem;
    font-weight: 500;
}

@media (max-width: 600px) {
    header h1 { font-size: 2.5rem; }
    .grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    .glass-card {
        padding: 1.5rem 1rem;
    }
    .icon-box {
        width: 50px;
        height: 50px;
        margin-bottom: 1rem;
    }
    .speed-embed-container {
        aspect-ratio: 1 / 1.2;
    }
}


/* Centered Horizontal Diagnostic Panel */
.diagnostics-section {
    width: 100%;
    margin-bottom: 6rem;
}

.bottom-diagnostics {
    width: 100%;
    display: flex;
    justify-content: center;
}

.minimal-speed-panel {
    width: 100%;
    max-width: 1000px;
    height: 450px; /* Slightly taller for better rendering */
    background: #1a1a1a; /* Matches OST default gray to prevent white flash */
    border: 1px solid var(--glass-border);
    border-radius: 32px;
    overflow: hidden;
    backdrop-filter: blur(10px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    /* Standard fix for iframe rendering on mobile */
    -webkit-overflow-scrolling: touch;
}

.speed-frame {
    width: 100%;
    height: 100%;
    border: none;
    overflow: hidden;
    /* This ensures the iframe fills the container without internal gaps */
    display: block; 
}

/* IMPORTANT: Mobile Specific Fix */
@media (max-width: 600px) {
    .minimal-speed-panel {
        height: 480px; /* Phones need more vertical space for the mobile gauges */
        border-radius: 24px;
    }
    
    .speed-frame {
        /* On very small screens, we slightly zoom the frame so the gauge fills the width */
        transform: scale(1.1); 
        transform-origin: center top;
    }
}



/* Container for the diagnostics */
.diagnostics-section {
    width: 100%;
    max-width: 1000px;
    margin-bottom: 6rem;
}

.bottom-diagnostics {
    width: 100%;
    display: flex;
    justify-content: center;
}

/* Updated to be the <a> tag */
.minimal-speed-panel {
    position: relative; 
    display: block; /* Important: makes the anchor behave like a container */
    text-decoration: none;
    width: 100%;
    height: 420px;
    background: #1a1a1a;
    border: 1px solid var(--glass-border);
    border-radius: 32px;
    overflow: hidden;
    backdrop-filter: blur(10px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    cursor: pointer;
}

/* The Invisible Clickable Layer */
.iframe-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    z-index: 999; /* Force it to the very top */
    background-color: rgba(0,0,0,0); /* Transparent but physically there for the browser */
}

/* Hover effects */
.minimal-speed-panel:hover {
    background: rgba(255, 255, 255, 0.07);
    transform: translateY(-10px);
    border-color: var(--accent);
}

.speed-frame {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    pointer-events: none; /* Tells the mouse to ignore the iframe entirely */
}

/* Mobile Adjustments */
@media (max-width: 600px) {
    .minimal-speed-panel {
        height: 500px;
        border-radius: 24px;
    }
}


/* Add to the bottom of style.css */

/* The "Data Traffic" Blink Animation */
@keyframes status-flicker {
    0% { opacity: 1; transform: scale(1); }
    30% { opacity: 0.4; transform: scale(0.9); }
    35% { opacity: 1; transform: scale(1.05); }
    45% { opacity: 0.8; transform: scale(1); }
    100% { opacity: 1; transform: scale(1); }
}

/* Apply animation only when active/pending, not when offline */
.dot.online.blinking, 
.dot.pending.blinking {
    animation: status-flicker var(--blink-speed, 2s) infinite;
    animation-delay: var(--blink-delay, 0s);
}

/* Smooth transition for color changes */
.dot {
    transition: background-color 0.8s ease, box-shadow 0.8s ease;
}