:root {
    --bg-base: #050508;
    --bg-panel: rgba(12, 16, 25, 0.4);
    --cyan-primary: #00f0ff;
    --cyan-secondary: #008b99;
    --cyan-glow: rgba(0, 240, 255, 0.6);
    --text-main: #ffffff;
    --text-muted: #8892b0;
    --border-glass: rgba(0, 240, 255, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-base);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(0, 240, 255, 0.05), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(0, 240, 255, 0.05), transparent 25%);
}

/* Luxury Grid Background */
.bg-grid {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-size: 50px 50px;
    background-image: 
        linear-gradient(to right, rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255,255,255,0.02) 1px, transparent 1px);
    z-index: 0;
    pointer-events: none;
}

.glow-bg {
    position: absolute;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, var(--cyan-glow) 0%, transparent 50%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.15;
    z-index: 0;
    pointer-events: none;
    animation: pulse-bg 10s infinite alternate ease-in-out;
    mix-blend-mode: screen;
}

@keyframes pulse-bg {
    0% { transform: translate(-50%, -50%) scale(0.8); opacity: 0.1; }
    100% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.25; }
}

.container {
    width: 100%;
    max-width: 1100px;
    padding: 2rem;
    z-index: 1;
    display: flex;
    flex-direction: column;
    min-height: 95vh;
}

/* Glassmorphism utility */
.glass-panel {
    background: var(--bg-panel);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: 24px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5), inset 0 0 20px rgba(0, 240, 255, 0.05);
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    padding: 1.5rem 2rem;
    border-radius: 20px;
    background: linear-gradient(90deg, rgba(255,255,255,0.03) 0%, transparent 100%);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo .icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--cyan-primary), #005f66);
    border-radius: 50%;
    box-shadow: 0 0 15px var(--cyan-glow), inset 0 0 10px rgba(255,255,255,0.5);
    position: relative;
    animation: spin 10s linear infinite;
}

@keyframes spin { 100% { transform: rotate(360deg); } }

.logo .icon::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 12px; height: 12px;
    background-color: var(--bg-base);
    border-radius: 50%;
}

.logo h1 {
    font-weight: 800;
    font-size: 1.8rem;
    letter-spacing: 1px;
}

.logo h1 .brand-name {
    color: var(--cyan-primary);
    text-shadow: 0 0 15px var(--cyan-glow);
    font-weight: 400;
    font-style: italic;
    font-size: 1.4rem;
}

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

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 0.5rem 1rem;
    border-radius: 8px;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--cyan-primary);
    background: rgba(0, 240, 255, 0.05);
    text-shadow: 0 0 10px var(--cyan-glow);
}

/* Dashboard Layout */
.dashboard {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    animation: fadeIn 0.5s ease;
}

.dashboard.hidden {
    display: none;
}

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

/* Results Panel */
.results-panel {
    display: flex;
    width: 100%;
    justify-content: space-around;
    padding: 2.5rem;
    margin-bottom: 2rem;
}

.result-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    padding: 0 3rem;
    transition: opacity 0.5s ease;
}

.result-item:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 10%;
    height: 80%;
    width: 1px;
    background: linear-gradient(to bottom, transparent, var(--border-glass), transparent);
}

.result-item .label {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 1.5px;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.result-item .unit {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.4);
}

.result-item .value {
    font-size: 3.5rem;
    font-weight: 300;
    color: var(--text-main);
    line-height: 1;
    margin-bottom: 0.5rem;
    font-variant-numeric: tabular-nums;
}

.result-item.active .value {
    color: var(--cyan-primary);
    text-shadow: 0 0 25px var(--cyan-glow);
}

.icon-indicator {
    color: var(--cyan-primary);
    opacity: 0.3;
    transition: all 0.3s ease;
}

.result-item.active .icon-indicator {
    opacity: 1;
    filter: drop-shadow(0 0 8px var(--cyan-primary));
}

/* Gauge Section */
.gauge-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 4rem 0;
    position: relative;
}

.gauge-wrapper {
    position: relative;
    width: 380px;
    height: 380px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.gauge-svg {
    position: absolute;
    width: 100%;
    height: 100%;
    transform: rotate(180deg);
}

.gauge-track {
    stroke: rgba(255, 255, 255, 0.03);
    stroke-width: 12;
    stroke-linecap: round;
}

.gauge-progress {
    stroke: var(--cyan-primary);
    stroke-width: 12;
    stroke-linecap: round;
    filter: drop-shadow(0 0 12px var(--cyan-primary));
    transition: stroke-dashoffset 0.1s linear;
}

/* GO Button */
.start-btn-wrapper {
    position: absolute;
    z-index: 10;
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.start-btn-wrapper.hidden {
    transform: scale(0);
    opacity: 0;
    pointer-events: none;
}

.go-btn {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0,240,255,0.1) 0%, rgba(12,16,25,0.8) 100%);
    border: 2px solid rgba(0, 240, 255, 0.5);
    color: var(--cyan-primary);
    font-size: 2.8rem;
    font-weight: 800;
    cursor: pointer;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.15), inset 0 0 20px rgba(0, 240, 255, 0.1);
}

.go-btn::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, var(--cyan-primary), #005f66);
    border-radius: 50%;
    transform: scale(0);
    transition: transform 0.4s ease;
    z-index: 0;
}

.go-btn:hover {
    box-shadow: 0 0 50px rgba(0, 240, 255, 0.6), inset 0 0 30px rgba(0, 240, 255, 0.4);
    border-color: #fff;
    transform: scale(1.05);
}

.go-btn:hover::before {
    transform: scale(1);
}

.go-btn .btn-text {
    position: relative;
    z-index: 1;
    transition: color 0.3s ease;
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

.go-btn:hover .btn-text {
    color: var(--bg-base);
    text-shadow: none;
}

/* Current Speed Display */
.current-speed-display {
    position: absolute;
    text-align: center;
    z-index: 10;
    transition: all 0.5s ease;
}

.current-speed-display.hidden {
    opacity: 0;
    transform: scale(0.5);
    pointer-events: none;
}

.speed-value {
    font-size: 5rem;
    font-weight: 300;
    color: var(--text-main);
    line-height: 1;
    text-shadow: 0 0 30px rgba(0,240,255,0.3);
    font-variant-numeric: tabular-nums;
}

.speed-unit {
    font-size: 1.2rem;
    color: var(--cyan-primary);
    font-weight: 600;
    margin-top: 10px;
    letter-spacing: 1px;
}

.speed-type {
    font-size: 1rem;
    color: var(--text-muted);
    margin-top: 15px;
    text-transform: uppercase;
    letter-spacing: 3px;
}

/* Network Info */
.network-info {
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding: 2rem 3rem;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 15px;
}

.info-icon {
    color: var(--cyan-primary);
    background: rgba(0, 240, 255, 0.1);
    padding: 10px;
    border-radius: 12px;
    display: flex;
}

.info-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 5px;
}

.info-value {
    font-size: 1.2rem;
    color: var(--text-main);
    font-weight: 400;
}

.cyan-text {
    color: var(--cyan-primary);
    font-size: 0.95rem;
    margin-left: 5px;
    font-weight: 300;
}

/* Settings & Results Panels */
.settings-panel, .results-history-panel {
    width: 100%;
    max-width: 600px;
    padding: 3rem;
    margin: auto;
}
.results-history-panel { max-width: 800px; }

.settings-panel h2, .results-history-panel h2 {
    color: var(--cyan-primary);
    margin-bottom: 2rem;
    font-weight: 600;
    text-shadow: 0 0 10px var(--cyan-glow);
}

.form-group {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-group label {
    color: var(--text-muted);
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.glass-input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-glass);
    color: white;
    padding: 1rem;
    border-radius: 12px;
    outline: none;
    font-size: 1rem;
}
.glass-input:focus {
    border-color: var(--cyan-primary);
    box-shadow: 0 0 10px rgba(0,240,255,0.2);
}

.save-btn {
    background: var(--cyan-primary);
    color: var(--bg-base);
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 1rem;
    transition: all 0.3s;
    width: 100%;
}
.save-btn:hover {
    background: #fff;
    box-shadow: 0 0 20px var(--cyan-glow);
}

/* Table */
.history-table-wrapper {
    overflow-x: auto;
}
.history-table {
    width: 100%;
    border-collapse: collapse;
}
.history-table th {
    text-align: left;
    color: var(--text-muted);
    padding: 1rem;
    border-bottom: 1px solid var(--border-glass);
}
.history-table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.history-table .empty-msg {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
}

/* Animations & Responsiveness */
@media (max-width: 768px) {
    .results-panel {
        flex-direction: column;
        gap: 2rem;
        padding: 1.5rem;
    }
    .result-item:not(:last-child)::after { display: none; }
    .gauge-wrapper { width: 280px; height: 280px; }
    .go-btn { width: 130px; height: 130px; font-size: 2.2rem; }
    .speed-value { font-size: 3.5rem; }
    .network-info { flex-direction: column; gap: 1.5rem; }
}
