:root {
    --bg-color: #141526;
    --card-bg: transparent;
    --card-border: rgba(255, 255, 255, 0.05);
    --text-primary: #ffffff;
    --text-secondary: #8b8b9b;
    --accent: #00f2fe;
    --accent-glow: rgba(0, 242, 254, 0.5);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.background-effects {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1; pointer-events: none;
}

.glow { position: absolute; border-radius: 50%; filter: blur(120px); opacity: 0.4; }
.glow-1 { width: 500px; height: 500px; background: rgba(79, 172, 254, 0.15); top: -200px; left: -100px; }
.glow-2 { width: 400px; height: 400px; background: rgba(0, 242, 254, 0.1); bottom: -100px; right: -50px; }

.app-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 3rem;
    border-bottom: 1px solid var(--card-border);
    background: rgba(10, 10, 16, 0.5);
    backdrop-filter: blur(10px);
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -1px;
}
.logo span { color: var(--accent); }

nav a {
    color: var(--text-secondary);
    text-decoration: none;
    margin-left: 2rem;
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.3s;
}
nav a:hover, nav a.active { color: var(--text-primary); }

.container {
    flex: 1;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 3rem 2rem;
    display: flex;
    flex-direction: column;
}

/* Start Screen and GO Button */
.start-screen {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 60vh;
    gap: 3rem;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.server-selection {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: slideUp 0.8s ease-out forwards;
    animation-delay: 0.2s;
    opacity: 0;
}

.server-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.server-dropdown {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--accent);
    color: var(--accent);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
}

.server-dropdown:hover {
    box-shadow: 0 4px 10px rgba(0, 242, 254, 0.2);
}

.server-dropdown option {
    background: var(--bg-color);
    color: var(--text-primary);
}

.go-btn {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    background: transparent;
    border: 4px solid var(--accent);
    color: var(--accent);
    font-size: 3.5rem;
    font-weight: 800;
    cursor: pointer;
    position: relative;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: 0 0 30px var(--accent-glow), inset 0 0 20px var(--accent-glow);
    animation: goPulse 2.5s infinite;
    display: flex;
    justify-content: center;
    align-items: center;
}

.go-btn:hover {
    background: rgba(0, 242, 254, 0.1);
    transform: scale(1.05);
    box-shadow: 0 0 50px var(--accent-glow), inset 0 0 30px var(--accent-glow);
}

@keyframes goPulse {
    0% { box-shadow: 0 0 20px var(--accent-glow), inset 0 0 10px var(--accent-glow); }
    50% { box-shadow: 0 0 50px var(--accent-glow), inset 0 0 30px var(--accent-glow); }
    100% { box-shadow: 0 0 20px var(--accent-glow), inset 0 0 10px var(--accent-glow); }
}

/* Dashboard Layout */
.dashboard {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: opacity 0.5s ease;
}

.metrics {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 1.5rem;
}

.metric-card {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 1rem;
    background: transparent;
    border: none;
    backdrop-filter: none;
}

.metric-icon svg {
    opacity: 0.8;
}

.metric-data {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.metric-title {
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    margin-bottom: 0.2rem;
}

.metric-value {
    font-size: 2.2rem;
    font-weight: 300;
    font-family: 'Inter', sans-serif;
}

.metric-unit {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.chart-container {
    background: transparent;
    border: none;
    padding: 0;
    margin-bottom: 2rem;
    position: relative;
    height: 350px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.current-speed {
    position: absolute;
    top: 55%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
}

#mainSpeed {
    font-size: 5rem;
    font-weight: 200;
    color: var(--text-primary);
    text-shadow: none;
    font-family: 'Comic Sans MS', 'Comic Sans', cursive;
}

.status-panel {
    text-align: center;
    margin-bottom: 2rem;
}

.status-panel h2 {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-weight: 400;
}

.connection-info {
    display: flex;
    justify-content: space-between;
    border-top: 1px solid var(--card-border);
    padding-top: 1.5rem;
}

.info-col {
    display: flex;
    flex-direction: column;
}

.info-label {
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.3rem;
}

.info-val {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-primary);
}

canvas#speedChart {
    width: 100% !important;
    height: 100% !important;
    margin-top: 2rem;
}

.app-footer {
    border-top: 1px solid var(--card-border);
    padding: 2rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
    background: transparent;
}

.test-files {
    margin-top: 3rem;
    text-align: center;
    animation: slideUp 0.8s ease-out forwards;
    animation-delay: 0.8s;
    opacity: 0;
}

.test-files h3 {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.file-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.file-link {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    text-decoration: none;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.file-link:hover {
    background: rgba(0, 242, 254, 0.1);
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 242, 254, 0.15);
}
