/* Professional Theme Variables */
:root {
    --primary-bg: #fafbfc;
    --secondary-bg: #ffffff;
    --tertiary-bg: #f1f3f4;
    --card-bg: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #5f6368;
    --text-tertiary: #80868b;
    --accent-primary: #1a73e8;
    --accent-secondary: #34a853;
    --accent-tertiary: #ea4335;
    --accent-gradient: linear-gradient(135deg, #1a73e8 0%, #4285f4 50%, #34a853 100%);
    --shadow-xs: 0 1px 3px rgba(60, 64, 67, 0.08);
    --shadow-sm: 0 2px 6px rgba(60, 64, 67, 0.15);
    --shadow-md: 0 4px 12px rgba(60, 64, 67, 0.15);
    --shadow-lg: 0 8px 25px rgba(60, 64, 67, 0.15);
    --shadow-xl: 0 16px 40px rgba(60, 64, 67, 0.2);
    --border: #dadce0;
    --border-light: #e8eaed;
    --meter-bg: #f1f3f4;
    --meter-fill: linear-gradient(90deg, #1a73e8 0%, #34a853 100%);
    --success: #34a853;
    --warning: #fbbc04;
    --danger: #ea4335;
    --info: #4285f4;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
}

/* Dark Theme Variables */
[data-theme="dark"] {
    --primary-bg: #121212;
    --secondary-bg: #1e1e1e;
    --tertiary-bg: #2d2d2d;
    --card-bg: #1e1e1e;
    --text-primary: #e8eaed;
    --text-secondary: #9aa0a6;
    --text-tertiary: #80868b;
    --accent-primary: #8ab4f8;
    --accent-secondary: #81c995;
    --accent-tertiary: #f28b82;
    --accent-gradient: linear-gradient(135deg, #8ab4f8 0%, #aecbfa 50%, #81c995 100%);
    --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 25px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 16px 40px rgba(0, 0, 0, 0.6);
    --border: #3c4043;
    --border-light: #5f6368;
    --meter-bg: #3c4043;
    --meter-fill: linear-gradient(90deg, #8ab4f8 0%, #81c995 100%);
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: fadeOut 1s ease-out 2s forwards;
}

.loading-content {
    text-align: center;
    color: white;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.loading-content h2 {
    font-size: 2rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.loading-content p {
    opacity: 0.9;
    font-size: 1.1rem;
}

@keyframes fadeOut {
    to {
        opacity: 0;
        visibility: hidden;
    }
}

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

/* Professional Typography */
body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--primary-bg);
    color: var(--text-primary);
    line-height: 1.6;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.3s ease, color 0.3s ease;
    opacity: 0;
    animation: fadeInBody 0.5s ease-out 3s forwards;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-primary);
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
}

.section-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    text-align: center;
    margin-bottom: 2rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

code, pre {
    font-family: 'Roboto Mono', 'Courier New', monospace;
    font-weight: 500;
}

@keyframes fadeInBody {
    to { opacity: 1; }
}

/* Navigation Styles */
.top-nav {
    margin-bottom: 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--secondary-bg);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    backdrop-filter: blur(10px);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.nav-tabs {
    display: flex;
    gap: 0;
    background: var(--tertiary-bg);
    border-radius: var(--radius-lg);
    padding: 0.25rem;
    overflow: hidden;
}

.nav-tab {
    flex: 1;
    background: transparent;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.nav-tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.nav-tab:hover::before {
    left: 100%;
}

.nav-tab.active {
    background: var(--accent-gradient);
    color: white;
    box-shadow: var(--shadow-sm);
    transform: scale(1.02);
}

.nav-icon {
    font-size: 1rem;
}

/* Content Sections */
.main-content {
    position: relative;
}

.content-section {
    display: none;
    animation: fadeInSection 0.5s ease-out;
}

.content-section.active {
    display: block;
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.header {
    text-align: center;
    padding: 4rem 0 3rem;
    background: var(--accent-gradient);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 40%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    animation: pulse-bg 8s ease-in-out infinite;
}

@keyframes pulse-bg {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.header-content {
    position: relative;
    z-index: 2;
}

.main-title {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    animation: title-float 3s ease-in-out infinite;
}

@keyframes title-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.tagline {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    font-weight: 400;
    opacity: 0.95;
    font-style: italic;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 0.01em;
}

.theme-toggle {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    padding: 0.75rem 1rem;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-weight: 500;
    font-size: 0.9rem;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

/* Section Styles */
section {
    margin-bottom: 40px;
}

h2 {
    font-size: 2rem;
    margin-bottom: 20px;
    text-align: center;
    color: var(--text-primary);
}

/* Network Info Grid */
.network-info {
    margin-bottom: 4rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.info-card, .premium-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: slideInUp 0.8s ease-out forwards;
    opacity: 0;
    position: relative;
    overflow: hidden;
}

.premium-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--accent-gradient);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.info-card:nth-child(1) { animation-delay: 0.1s; }
.info-card:nth-child(2) { animation-delay: 0.2s; }
.info-card:nth-child(3) { animation-delay: 0.3s; }
.info-card:nth-child(4) { animation-delay: 0.4s; }
.info-card:nth-child(5) { animation-delay: 0.5s; }
.info-card:nth-child(6) { animation-delay: 0.6s; }

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.info-card:hover, .premium-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: var(--accent-primary);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.info-card h3, .premium-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    letter-spacing: 0.01em;
}

.card-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-primary);
    font-family: 'Roboto Mono', monospace;
    letter-spacing: 0.02em;
    margin-bottom: 0.25rem;
}

.card-subtitle {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Speed Test Section */
.speed-test {
    margin-bottom: 4rem;
}

.speed-meters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.meter-container, .premium-meter {
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.premium-meter {
    background: linear-gradient(135deg, var(--secondary-bg) 0%, var(--tertiary-bg) 100%);
}

.meter-container:hover, .premium-meter:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-4px);
}

.meter-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.meter-container h3, .premium-meter h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.real-time-indicator {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    background: var(--success);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.real-time-indicator.active {
    opacity: 1;
}

.rt-dot {
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
    animation: pulse-dot 1.5s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.speed-stats {
    margin-top: 1.5rem;
}

.speed-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--accent-primary);
    font-family: 'Roboto Mono', monospace;
    letter-spacing: 0.02em;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.speed-unit {
    font-size: 1rem;
    font-weight: 600;
    opacity: 0.8;
}

.speed-details {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Bullet Meter Styles */
.bullet-meter {
    margin-bottom: 1.5rem;
    position: relative;
}

.meter-bar {
    position: relative;
    height: 32px;
    background: var(--meter-bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 1rem;
    box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.12);
    border: 2px solid var(--border);
    background: linear-gradient(135deg, var(--meter-bg) 0%, rgba(255, 255, 255, 0.05) 100%);
}

.meter-fill {
    height: 100%;
    background: var(--meter-fill);
    border-radius: var(--radius-lg);
    width: 0%;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 0 20px rgba(26, 115, 232, 0.4);
}

.meter-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.4) 20%,
        rgba(255, 255, 255, 0.6) 50%,
        rgba(255, 255, 255, 0.4) 80%,
        transparent 100%);
    animation: shimmer 3s ease-in-out infinite;
    border-radius: var(--radius-lg);
}

@keyframes shimmer {
    0% { transform: translateX(-150%); }
    100% { transform: translateX(150%); }
}

.meter-glow {
    position: absolute;
    top: -2px;
    left: 0%;
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 100%);
    border-radius: var(--radius-lg);
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.meter-pointer {
    position: absolute;
    top: -12px;
    left: 0%;
    transform: translateX(-50%);
    background: var(--secondary-bg);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    font-weight: 700;
    font-family: 'Roboto Mono', monospace;
    box-shadow: var(--shadow-lg);
    transition: left 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    border: 2px solid var(--accent-primary);
    backdrop-filter: blur(10px);
    animation: pointerPulse 2s ease-in-out infinite;
}

@keyframes pointerPulse {
    0%, 100% {
        box-shadow: var(--shadow-lg);
        transform: translateX(-50%) scale(1);
    }
    50% {
        box-shadow: 0 6px 20px rgba(26, 115, 232, 0.3);
        transform: translateX(-50%) scale(1.05);
    }
}

.meter-scale {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 5px;
}

.speed-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-primary);
    margin-top: 10px;
}

/* Test Controls */
.test-controls {
    text-align: center;
    margin-top: 2rem;
}

.start-test-btn, .premium-btn {
    background: var(--accent-gradient);
    color: white;
    border: none;
    padding: 1.25rem 2.5rem;
    border-radius: var(--radius-xl);
    font-size: 1.125rem;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 25px rgba(26, 115, 232, 0.3);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.premium-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.start-test-btn:hover, .premium-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 35px rgba(26, 115, 232, 0.4);
}

.premium-btn:hover::before {
    left: 100%;
}

.start-test-btn:active, .premium-btn:active {
    transform: translateY(-2px);
}

.btn-icon {
    font-size: 1.5rem;
    animation: rocketPulse 2s ease-in-out infinite;
}

@keyframes rocketPulse {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-2px) rotate(1deg); }
    75% { transform: translateY(2px) rotate(-1deg); }
}

.btn-text {
    font-weight: 800;
}

/* Progress Bar */
.progress-container {
    margin-top: 2rem;
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: var(--meter-bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 1.5rem;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border);
}

.progress-fill {
    height: 100%;
    background: var(--accent-gradient);
    width: 0%;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: var(--radius-lg);
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: progressShimmer 2s ease-in-out infinite;
}

@keyframes progressShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-text {
    color: var(--text-primary);
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.progress-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Roboto Mono', monospace;
    font-weight: 600;
}

.progress-stats span {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Map Section */
.map-section {
    margin-bottom: 40px;
}

.map-container {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

#map {
    height: 400px;
    border-radius: 10px;
    width: 100%;
}

/* Quotes Section */
.quotes-section {
    margin-bottom: 40px;
}

.quotes-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.quote-card {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 25px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    text-align: center;
    transition: transform 0.3s ease;
    animation: slideInLeft 0.6s ease-out forwards;
    opacity: 0;
}

.quote-card:nth-child(1) { animation-delay: 0.1s; }
.quote-card:nth-child(2) { animation-delay: 0.3s; }
.quote-card:nth-child(3) { animation-delay: 0.5s; }

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.quote-card:hover {
    transform: translateY(-5px);
}

.quote-card blockquote {
    font-size: 1.1rem;
    font-style: italic;
    margin-bottom: 10px;
    color: var(--text-primary);
    position: relative;
}

.quote-card blockquote::before {
    content: '"';
    font-size: 3rem;
    position: absolute;
    left: -20px;
    top: -10px;
    color: var(--accent-primary);
    opacity: 0.3;
}

.quote-card cite {
    color: var(--text-secondary);
    font-weight: 500;
}

/* Gaming Header */
.gaming-header {
    text-align: center;
    padding: 3rem 0 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: var(--radius-xl);
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.gaming-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 40%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    animation: pulse-bg 8s ease-in-out infinite;
}

.gaming-header-content {
    position: relative;
    z-index: 2;
}

.gaming-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.gaming-tagline {
    font-size: clamp(1rem, 2vw, 1.2rem);
    opacity: 0.95;
    font-style: italic;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1.5rem;
}

.gaming-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.stat-item {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    padding: 0.75rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    opacity: 0.8;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
}

/* Gaming Ping Tester */
.gaming-ping-tester {
    margin-bottom: 3rem;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.game-card {
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--accent-gradient);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.game-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: var(--accent-primary);
}

.game-card:hover::before {
    transform: scaleX(1);
}

.game-image {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.game-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.game-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.game-card p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.game-ping {
    font-size: 1.125rem;
    font-weight: 700;
    font-family: 'Roboto Mono', monospace;
    color: var(--accent-primary);
    padding: 0.5rem 1rem;
    background: var(--tertiary-bg);
    border-radius: var(--radius-lg);
    display: inline-block;
    min-width: 80px;
}

/* Gaming Controls */
.gaming-controls {
    text-align: center;
}

.gaming-test-btn {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: var(--radius-xl);
    font-size: 1.125rem;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.3);
    position: relative;
    overflow: hidden;
}

.gaming-test-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.gaming-test-btn:hover::before {
    left: 100%;
}

.gaming-test-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 35px rgba(255, 107, 53, 0.4);
}

/* Gaming Results */
.gaming-results {
    margin-top: 2rem;
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
}

.ping-overview h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
    color: var(--text-primary);
}

.ping-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.ping-stat {
    background: var(--tertiary-bg);
    padding: 1rem;
    border-radius: var(--radius-lg);
    text-align: center;
}

.ping-stat .stat-label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ping-stat .stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent-primary);
    font-family: 'Roboto Mono', monospace;
}

/* Network Latency */
.network-latency {
    margin-bottom: 3rem;
}

.latency-tester {
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
}

.latency-display {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2rem;
    align-items: center;
    margin-bottom: 2rem;
}

.latency-meter {
    text-align: center;
}

.latency-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: conic-gradient(var(--accent-primary) 0deg, var(--accent-primary) var(--progress, 0deg), var(--tertiary-bg) var(--progress, 0deg), var(--tertiary-bg) 360deg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    box-shadow: var(--shadow-lg);
    position: relative;
}

.latency-circle::before {
    content: '';
    position: absolute;
    inset: 8px;
    border-radius: 50%;
    background: var(--card-bg);
}

.latency-value {
    font-size: 2rem;
    font-weight: 800;
    font-family: 'Roboto Mono', monospace;
    color: var(--accent-primary);
    position: relative;
    z-index: 1;
}

.latency-unit {
    font-size: 0.875rem;
    color: var(--text-secondary);
    position: relative;
    z-index: 1;
}

.latency-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.latency-details {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.latency-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--tertiary-bg);
    border-radius: var(--radius-lg);
}

.latency-stat .stat-label {
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.latency-stat .stat-value {
    font-weight: 700;
    font-family: 'Roboto Mono', monospace;
    color: var(--accent-primary);
}

.latency-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.latency-test-btn {
    background: linear-gradient(135deg, #4285f4 0%, #34a853 100%);
    color: white;
    border: none;
    padding: 0.875rem 1.5rem;
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(66, 133, 244, 0.3);
}

.latency-test-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(66, 133, 244, 0.4);
}

.latency-quality {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quality-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--text-tertiary);
    transition: background 0.3s ease;
}

.quality-text {
    font-weight: 500;
    color: var(--text-secondary);
}

/* Gaming Tips */
.gaming-tips {
    margin-bottom: 2rem;
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.tip-card {
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tip-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.tip-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    display: block;
}

.tip-card h4 {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.tip-card p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Downloader Header */
.downloader-header {
    text-align: center;
    padding: 3rem 0 2rem;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
    border-radius: var(--radius-xl);
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.downloader-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 40%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    animation: pulse-bg 8s ease-in-out infinite;
}

.downloader-header-content {
    position: relative;
    z-index: 2;
}

.downloader-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.downloader-tagline {
    font-size: clamp(1rem, 2vw, 1.2rem);
    opacity: 0.95;
    font-style: italic;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1.5rem;
}

.downloader-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

/* URL Input Section */
.url-input-section {
    margin-bottom: 3rem;
}

.url-input-container {
    max-width: 800px;
    margin: 0 auto;
}

.input-group {
    display: flex;
    align-items: center;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 0.5rem;
    box-shadow: var(--shadow-md);
    border: 2px solid var(--border-light);
    transition: all 0.3s ease;
}

.input-group:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.input-icon {
    font-size: 1.5rem;
    margin: 0 1rem;
    color: var(--text-secondary);
}

.url-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 1rem;
    font-size: 1.1rem;
    font-family: 'Inter', sans-serif;
    background: transparent;
    color: var(--text-primary);
}

.url-input::placeholder {
    color: var(--text-tertiary);
}

.analyze-btn {
    background: var(--accent-gradient);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.3);
}

.analyze-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(26, 115, 232, 0.4);
}

.url-validation {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    display: none;
}

.url-validation.error {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    color: var(--danger);
}

.url-validation.success {
    background: rgba(40, 167, 69, 0.1);
    border: 1px solid rgba(40, 167, 69, 0.3);
    color: var(--success);
}

.cors-info {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background-color: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.2);
    border-radius: var(--radius-md);
    text-align: center;
}

.cors-info small {
    color: var(--warning-color);
    font-size: 0.85rem;
    line-height: 1.4;
}

/* File Details Section */
.file-details-section {
    margin-bottom: 3rem;
}

.file-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.file-info-card {
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    transition: all 0.3s ease;
}

.file-info-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.info-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.file-info-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.info-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-primary);
    font-family: 'Roboto Mono', monospace;
}

/* Download Options */
.download-options-section {
    margin-bottom: 3rem;
}

.download-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.download-option-card {
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    text-align: center;
    box-shadow: var(--shadow-md);
    border: 2px solid var(--border-light);
    transition: all 0.3s ease;
    cursor: pointer;
}

.download-option-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: var(--accent-primary);
}

.pro-option {
    background: linear-gradient(135deg, var(--secondary-bg) 0%, var(--tertiary-bg) 100%);
    border-color: var(--accent-secondary);
}

.pro-option:hover {
    border-color: var(--accent-secondary);
    box-shadow: 0 16px 40px rgba(34, 197, 94, 0.2);
}

.option-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    display: block;
}

.download-option-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.download-option-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

.option-features {
    list-style: none;
    padding: 0;
    margin-bottom: 2rem;
    text-align: left;
}

.option-features li {
    padding: 0.25rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.option-btn {
    background: var(--accent-gradient);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(26, 115, 232, 0.3);
}

.pro-btn {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.pro-btn:hover {
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
}

.option-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(26, 115, 232, 0.4);
}

/* Pro Download Progress */
.pro-download-section {
    margin-bottom: 3rem;
}

.download-progress-container {
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    padding: 3rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
}

.download-status {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.status-icon {
    font-size: 3rem;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--tertiary-bg);
    border-radius: 50%;
    border: 3px solid var(--accent-primary);
}

.status-text h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.status-text p {
    color: var(--text-secondary);
    font-size: 1rem;
}

.progress-display {
    margin-bottom: 2rem;
}

.progress-bar-container {
    margin-bottom: 1.5rem;
}

.progress-bar-bg {
    width: 100%;
    height: 16px;
    background: var(--meter-bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border);
}

.progress-bar-fill {
    height: 100%;
    background: var(--accent-gradient);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: var(--radius-lg);
    position: relative;
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: progressShimmer 2s ease-in-out infinite;
}

.progress-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    font-family: 'Roboto Mono', monospace;
    font-weight: 600;
    color: var(--text-secondary);
}

.speed-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.speed-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--tertiary-bg);
    border-radius: var(--radius-lg);
}

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

.speed-value {
    font-weight: 700;
    font-family: 'Roboto Mono', monospace;
    color: var(--accent-primary);
}

.download-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.control-btn {
    background: var(--secondary-bg);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-lg);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.control-btn:hover {
    background: var(--tertiary-bg);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.pause-btn {
    background: var(--warning);
    color: white;
}

.resume-btn {
    background: var(--success);
    color: white;
}

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

/* Download History */
.download-history-section {
    margin-bottom: 2rem;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.history-item {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-info h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.history-info p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.history-status {
    font-weight: 600;
    font-family: 'Roboto Mono', monospace;
}

.history-status.completed {
    color: var(--success);
}

.history-status.failed {
    color: var(--danger);
}

/* Popup Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Popup Styles */
.popup-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.popup-content h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.popup-content p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.popup-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.popup-btn {
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-lg);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.popup-btn.primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(26, 115, 232, 0.3);
}

.popup-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(26, 115, 232, 0.4);
}

.popup-btn.secondary {
    background: var(--tertiary-bg);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.popup-btn.secondary:hover {
    background: var(--secondary-bg);
    transform: translateY(-1px);
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 0;
    min-width: 300px;
    max-width: 400px;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
}

.notification-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.notification-message {
    flex: 1;
    font-size: 0.875rem;
    line-height: 1.4;
    color: var(--text-primary);
}

.notification.success {
    border-color: var(--success);
    background: rgba(34, 197, 94, 0.1);
}

.notification.success .notification-icon {
    color: var(--success);
}

.notification.error {
    border-color: var(--danger);
    background: rgba(220, 53, 69, 0.1);
}

.notification.error .notification-icon {
    color: var(--danger);
}

.notification.warning {
    border-color: var(--warning);
    background: rgba(245, 158, 11, 0.1);
}

.notification.warning .notification-icon {
    color: var(--warning);
}

.notification.info {
    border-color: var(--info);
    background: rgba(26, 115, 232, 0.1);
}

.notification.info .notification-icon {
    color: var(--info);
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem 0;
    color: var(--text-secondary);
    border-top: 1px solid var(--border);
    margin-top: 3rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-title {
        font-size: 2rem;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .speed-meters {
        grid-template-columns: 1fr;
    }

    .quotes-container {
        grid-template-columns: 1fr;
    }

    .theme-toggle {
        position: static;
        margin: 20px auto 0;
        display: inline-flex;
    }

    .header {
        padding: 30px 20px;
    }
}

/* Loading Animation */
.loading {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Success Animation */
.success {
    animation: successPulse 0.6s ease-out;
}

@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Test Running State */
.testing .meter-fill {
    animation: testingPulse 1s infinite;
}

@keyframes testingPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}
