/* Reset & Variables */
:root {
    --primary: #6366f1;
    --secondary: #8b5cf6;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --dark: #1e293b;
    --light: #f1f5f9;
    --gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --shadow: 0 10px 30px rgba(0,0,0,0.1);
    --shadow-lg: 0 20px 60px rgba(0,0,0,0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--dark);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    color: var(--dark);
}

.logo img {
    width: 50px;
    height: 50px;
    animation: rotate 10s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.logo h1 {
    font-size: 1.5rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

nav ul {
    display: flex;
    gap: 2rem;
    list-style: none;
}

nav a {
    text-decoration: none;
    color: var(--dark);
    font-weight: 500;
    transition: color 0.3s;
}

nav a:hover {
    color: var(--primary);
}

/* Hero Section */
.hero-section {
    text-align: center;
    padding: 3rem 0 2rem;
    animation: fadeInDown 0.8s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-section h1 {
    font-size: 3rem;
    color: white;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 10px rgba(0,0,0,0.2);
}

.subtitle {
    font-size: 1.3rem;
    color: rgba(255,255,255,0.9);
}

/* Speed Test Container */
.speed-test-container {
    background: white;
    border-radius: 30px;
    padding: 3rem;
    box-shadow: var(--shadow-lg);
    margin: 2rem 0;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Speedometer */
.speedometer {
    width: 300px;
    height: 300px;
    margin: 0 auto 2rem;
    position: relative;
}

#speedCanvas {
    width: 100%;
    height: 100%;
}

.speed-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

#speedNumber {
    font-size: 4rem;
    font-weight: bold;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.unit {
    font-size: 1.5rem;
    color: #64748b;
    display: block;
}

.speed-label {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.1rem;
    color: #64748b;
    font-weight: 500;
}

/* Start Button */
.start-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 2rem auto;
    padding: 1.2rem 3rem;
    font-size: 1.3rem;
    font-weight: bold;
    border: none;
    border-radius: 50px;
    background: var(--gradient);
    color: white;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
    transition: all 0.3s;
}

.start-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.5);
}

.start-btn:active {
    transform: translateY(0);
}

.start-btn.testing {
    background: var(--gradient-2);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 10px 30px rgba(245, 87, 108, 0.4);
    }
    50% {
        box-shadow: 0 10px 50px rgba(245, 87, 108, 0.7);
    }
}

/* Results Grid */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 3rem 0;
}

.result-card {
    background: linear-gradient(135deg, #f6f8fb 0%, #ffffff 100%);
    padding: 2rem;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    transition: all 0.3s;
    border: 2px solid transparent;
}

.result-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
    border-color: var(--primary);
}

.result-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.result-label {
    font-size: 0.9rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.result-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--dark);
}

/* Connection Info */
.connection-info {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 15px;
    margin-top: 2rem;
}

.connection-info p {
    margin: 0.5rem 0;
    color: #475569;
}

/* Content Section */
.content-section {
    background: white;
    border-radius: 30px;
    padding: 3rem;
    margin: 2rem 0;
    box-shadow: var(--shadow);
}

.content-block {
    margin-bottom: 3rem;
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.content-block h2 {
    color: var(--dark);
    font-size: 2rem;
    margin-bottom: 1rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.content-block h3 {
    color: var(--dark);
    font-size: 1.5rem;
    margin: 1.5rem 0 1rem;
}

.content-block p {
    color: #475569;
    margin-bottom: 1rem;
    font-size: 1.05rem;
}

.content-block ul,
.content-block ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.content-block li {
    margin: 0.5rem 0;
    color: #475569;
}

.speed-table ul {
    list-style: none;
    margin-left: 1rem;
}

.speed-table li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #e2e8f0;
}

/* Footer */
footer {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 2rem 0;
    margin-top: 3rem;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.1);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--dark);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--primary);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .speed-test-container {
        padding: 2rem 1rem;
    }
    
    .speedometer {
        width: 250px;
        height: 250px;
    }
    
    #speedNumber {
        font-size: 3rem;
    }
    
    .results-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .result-card {
        padding: 1.5rem 1rem;
    }
    
    .content-section {
        padding: 2rem 1rem;
    }
    
    .content-block h2 {
        font-size: 1.5rem;
    }
    
    nav ul {
        flex-direction: column;
        gap: 1rem;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .start-btn {
        padding: 1rem 2rem;
        font-size: 1.1rem;
    }
}