/* ================================
   CSS Variables & Reset
================================ */
:root {
    --primary: #00d4ff;
    --primary-dark: #0099cc;
    --secondary: #ff6b35;
    --bg-dark: #0a0a1a;
    --bg-card: #12122a;
    --bg-card-hover: #1a1a3e;
    --text-primary: #ffffff;
    --text-secondary: #b0b0cc;
    --text-muted: #6a6a8a;
    --border-color: #2a2a4a;
    --success: #00e676;
    --danger: #ff4444;
    --warning: #ffbb33;
    --gradient-primary: linear-gradient(135deg, #00d4ff, #0099cc);
    --gradient-bg: linear-gradient(180deg, #0a0a1a 0%, #1a1a3e 100%);
    --shadow-card: 0 10px 40px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 30px rgba(0, 212, 255, 0.3);
    --radius: 16px;
    --radius-sm: 8px;
    --transition: all 0.3s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.7;
    min-height: 100vh;
}

/* ================================
   Typography
================================ */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.5rem); margin-bottom: 1.5rem; }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.4rem); }
h4 { font-size: 1.1rem; }

p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* ================================
   Layout
================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

.hidden {
    display: none !important;
}

/* ================================
   Header & Navigation
================================ */
.header {
    background: rgba(10, 10, 26, 0.95);
    backdrop-filter: blur(20px);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-brand a {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.nav-brand a:hover {
    color: var(--primary);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 8px;
}

.nav-menu li a {
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition);
}

.nav-menu li a:hover,
.nav-menu li a.active {
    background: var(--bg-card);
    color: var(--primary);
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-btn span {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: var(--transition);
}

/* ================================
   Hero Section
================================ */
.hero {
    padding: 140px 20px 60px;
    text-align: center;
    background: var(--gradient-bg);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0, 212, 255, 0.05) 0%, transparent 50%);
    animation: pulse 8s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 1; }
}

.hero h1 {
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
}

.hero .subtitle {
    font-size: clamp(1.1rem, 3vw, 1.5rem);
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
}

.hero .hero-description {
    max-width: 700px;
    margin: 0 auto;
    font-size: 1rem;
    position: relative;
    z-index: 1;
}

/* ================================
   Speed Test Card
================================ */
.main-content {
    padding: 40px 20px;
}

.speed-test-section {
    margin-bottom: 60px;
}

.speed-test-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 40px 30px;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-color);
    max-width: 800px;
    margin: 0 auto;
}

.speed-test-card h2 {
    text-align: center;
    margin-bottom: 10px;
}

.instructions {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 30px;
}

/* ================================
   Display Mode Toggle
================================ */
.display-toggle {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
}

.display-btn {
    padding: 12px 24px;
    border: 2px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.display-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.display-btn.active {
    background: var(--gradient-primary);
    border-color: var(--primary);
    color: var(--bg-dark);
}

.display-icon {
    font-size: 1.2rem;
}

/* ================================
   Digital Speedometer
================================ */
.speedometer-container {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.speedometer {
    text-align: center;
}

.digital-speedometer {
    background: radial-gradient(circle, #1a1a3e 0%, #0a0a1a 100%);
    border-radius: 50%;
    width: 280px;
    height: 280px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 4px solid var(--primary);
    box-shadow: var(--shadow-glow), inset 0 0 50px rgba(0, 212, 255, 0.1);
    position: relative;
}

.digital-speedometer::before {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 2px solid rgba(0, 212, 255, 0.2);
}

.speed-display {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.speed-value {
    font-size: clamp(3rem, 10vw, 5rem);
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
    text-shadow: 0 0 30px rgba(0, 212, 255, 0.5);
}

.speed-unit {
    font-size: 1.2rem;
    color: var(--text-secondary);
    font-weight: 600;
    margin-top: 5px;
}

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

/* ================================
   Analog Speedometer
================================ */
.analog-speedometer {
    width: 320px;
    height: 320px;
}

.gauge-svg {
    width: 100%;
    height: 100%;
}

.speed-arc-bg {
    opacity: 0.3;
}

.speed-arc {
    transition: stroke-dashoffset 0.3s ease;
}

.analog-speed-value {
    font-size: 48px;
    font-weight: 800;
    fill: var(--primary);
}

.analog-speed-unit {
    font-size: 18px;
    fill: var(--text-secondary);
}

/* ================================
   Speed Unit Toggle
================================ */
.unit-toggle {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.unit-toggle label {
    color: var(--text-secondary);
    font-weight: 600;
}

.unit-btn {
    padding: 10px 20px;
    border: 2px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: var(--transition);
}

.unit-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.unit-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--bg-dark);
}

/* ================================
   Speed Stats
================================ */
.speed-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.stat {
    text-align: center;
    padding: 20px 10px;
    background: rgba(0, 212, 255, 0.05);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.stat-label {
    display: block;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.stat-value {
    display: block;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary);
}

.stat-unit {
    display: block;
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: 4px;
}

/* ================================
   Buttons
================================ */
.controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.btn {
    padding: 14px 32px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--bg-dark);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.btn-secondary {
    background: var(--danger);
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #cc3333;
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 2px solid var(--border-color);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.status-message {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    padding: 10px;
    background: rgba(0, 212, 255, 0.05);
    border-radius: var(--radius-sm);
}

/* ================================
   Features Section
================================ */
.features-section {
    padding: 60px 0;
}

.features-section h2 {
    text-align: center;
    margin-bottom: 40px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.feature-card {
    background: var(--bg-card);
    padding: 35px 25px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    text-align: center;
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.feature-card h3 {
    margin-bottom: 10px;
    color: var(--primary);
}

.feature-card p {
    font-size: 0.9rem;
}

/* ================================
   Units Section
================================ */
.units-section {
    padding: 60px 0;
    background: var(--bg-card);
}

.units-section h2 {
    text-align: center;
    margin-bottom: 40px;
}

.units-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.unit-card {
    background: var(--bg-dark);
    padding: 30px 25px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.unit-card:hover {
    border-color: var(--primary);
}

.unit-card h3 {
    color: var(--primary);
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.unit-card p {
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.unit-example {
    background: rgba(0, 212, 255, 0.1);
    padding: 10px 15px;
    border-radius: var(--radius-sm);
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--primary);
}

/* ================================
   How It Works
================================ */
.how-it-works {
    padding: 60px 0;
}

.how-it-works h2 {
    text-align: center;
    margin-bottom: 40px;
}

.steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    position: relative;
}

.steps::before {
    content: '';
    position: absolute;
    top: 45px;
    left: 10%;
    right: 10%;
    height: 2px;
    background: var(--border-color);
}

.step {
    text-align: center;
    position: relative;
}

.step-number {
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--bg-dark);
    margin: 0 auto 20px;
    position: relative;
    z-index: 1;
}

.step h3 {
    margin-bottom: 10px;
}

.step p {
    font-size: 0.9rem;
}

/* ================================
   FAQ Section
================================ */
.faq-section {
    padding: 60px 0;
    background: var(--bg-card);
}

.faq-section h2 {
    text-align: center;
    margin-bottom: 40px;
}

.faq-item {
    max-width: 800px;
    margin: 0 auto 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: var(--transition);
}

.faq-item:hover {
    border-color: var(--primary);
}

.faq-question {
    width: 100%;
    padding: 20px 25px;
    background: var(--bg-dark);
    border: none;
    color: var(--text-primary);
    text-align: left;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.faq-question:hover {
    background: var(--bg-card-hover);
}

.faq-toggle {
    font-size: 1.5rem;
    color: var(--primary);
    transition: transform 0.3s ease;
}

.faq-item.active .faq-toggle {
    transform: rotate(45deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    background: var(--bg-dark);
}

.faq-item.active .faq-answer {
    max-height: 300px;
    padding: 0 25px 20px;
}

.faq-answer p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ================================
   Comparison Table
================================ */
.comparison-section {
    padding: 60px 0;
}

.comparison-section h2 {
    text-align: center;
    margin-bottom: 10px;
}

.section-desc {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 30px;
}

.comparison-table {
    overflow-x: auto;
}

.comparison-table table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
}

.comparison-table th,
.comparison-table td {
    padding: 15px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.comparison-table th {
    background: rgba(0, 212, 255, 0.1);
    color: var(--primary);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.comparison-table tr:hover td {
    background: rgba(0, 212, 255, 0.05);
}

.comparison-table td {
    color: var(--text-secondary);
}

.comparison-table td:first-child {
    font-weight: 600;
    color: var(--text-primary);
}

/* ================================
   Content Pages (About, Contact, etc.)
================================ */
.page-content {
    padding: 120px 20px 60px;
    max-width: 900px;
    margin: 0 auto;
}

.page-content h1 {
    margin-bottom: 30px;
    color: var(--primary);
}

.page-content h2 {
    margin-top: 40px;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.page-content p {
    margin-bottom: 15px;
}

.page-content ul, .page-content ol {
    margin: 15px 0;
    padding-left: 30px;
}

.page-content li {
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.page-content strong {
    color: var(--text-primary);
}

/* ================================
   Contact Form
================================ */
.contact-form {
    background: var(--bg-card);
    padding: 40px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    margin-top: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-weight: 600;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 14px 18px;
    background: var(--bg-dark);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.2);
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

/* ================================
   Footer
================================ */
.footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 60px 0 20px;
    margin-top: 60px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h4 {
    color: var(--text-primary);
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.footer-section p {
    font-size: 0.9rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul li a {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-section ul li a:hover {
    color: var(--primary);
}

.footer-link {
    display: inline-block;
    margin-top: 10px;
    padding: 10px 20px;
    background: var(--gradient-primary);
    color: var(--bg-dark);
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.footer-bottom p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ================================
   Responsive - Tablet (max-width: 992px)
================================ */
@media (max-width: 992px) {
    .features-grid,
    .units-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .steps {
        grid-template-columns: repeat(2, 1fr);
    }

    .steps::before {
        display: none;
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ================================
   Responsive - Mobile (max-width: 768px)
================================ */
@media (max-width: 768px) {
    /* Mobile Menu */
    .mobile-menu-btn {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: rgba(10, 10, 26, 0.98);
        flex-direction: column;
        padding: 20px;
        gap: 5px;
        transform: translateY(-150%);
        transition: transform 0.3s ease;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-menu.active {
        transform: translateY(0);
    }

    .nav-menu li a {
        display: block;
        padding: 12px 20px;
    }

    /* Hero */
    .hero {
        padding: 120px 15px 40px;
    }

    .hero h1 {
        font-size: 2rem;
    }

    /* Speed Test Card */
    .speed-test-card {
        padding: 25px 15px;
    }

    .display-toggle {
        flex-direction: column;
        align-items: center;
    }

    .display-btn {
        width: 100%;
        justify-content: center;
    }

    /* Digital Speedometer */
    .digital-speedometer {
        width: 220px;
        height: 220px;
    }

    .speed-value {
        font-size: 3rem;
    }

    /* Analog Speedometer */
    .analog-speedometer {
        width: 280px;
        height: 280px;
    }

    .analog-speed-value {
        font-size: 36px;
    }

    .analog-speed-unit {
        font-size: 14px;
    }

    /* Unit Toggle */
    .unit-toggle {
        flex-direction: column;
        gap: 10px;
    }

    .unit-btn {
        width: 100%;
    }

    /* Stats */
    .speed-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .stat {
        padding: 15px 8px;
    }

    .stat-value {
        font-size: 1.3rem;
    }

    /* Buttons */
    .controls {
        flex-direction: column;
        align-items: stretch;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    /* Features */
    .features-grid,
    .units-grid {
        grid-template-columns: 1fr;
    }

    .feature-card {
        padding: 25px 20px;
    }

    /* Steps */
    .steps {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    /* FAQ */
    .faq-question {
        padding: 15px 20px;
        font-size: 0.95rem;
    }

    /* Comparison Table */
    .comparison-table th,
    .comparison-table td {
        padding: 10px 12px;
        font-size: 0.85rem;
    }

    /* Contact Form */
    .contact-form {
        padding: 25px 20px;
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .footer-section {
        text-align: center;
    }
}

/* ================================
   Responsive - Small Mobile (max-width: 480px)
================================ */
@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .hero h1 {
        font-size: 1.7rem;
    }

    .hero .subtitle {
        font-size: 1rem;
    }

    .digital-speedometer {
        width: 180px;
        height: 180px;
    }

    .speed-value {
        font-size: 2.5rem;
    }

    .speed-unit {
        font-size: 1rem;
    }

    .analog-speedometer {
        width: 250px;
        height: 250px;
    }

    .analog-speed-value {
        font-size: 30px;
    }

    .stat {
        padding: 12px 6px;
    }

    .stat-label {
        font-size: 0.7rem;
    }

    .stat-value {
        font-size: 1.1rem;
    }

    .comparison-table {
        font-size: 0.8rem;
    }

    .page-content {
        padding: 100px 15px 40px;
    }
}

/* ================================
   Animations
================================ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.feature-card,
.unit-card,
.step,
.faq-item {
    animation: fadeIn 0.5s ease forwards;
}

/* ================================
   Scrollbar Styling
================================ */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* ================================
   Selection
================================ */
::selection {
    background: var(--primary);
    color: var(--bg-dark);
}