/* ========================================
   RTV GLOBAL SPEED TEST - Modern Dark Theme
   ======================================== */

:root {
    --primary-cyan: #00D4FF;
    --primary-purple: #7B2FFF;
    --primary-pink: #FF006E;
    --bg-dark: #0a0a0f;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.06);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.6);
    --text-muted: rgba(255, 255, 255, 0.4);
    --border-color: rgba(255, 255, 255, 0.08);
    --glow-cyan: 0 0 30px rgba(0, 212, 255, 0.3);
    --glow-purple: 0 0 30px rgba(123, 47, 255, 0.3);
    --glow-pink: 0 0 30px rgba(255, 0, 110, 0.3);
}

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

html {
    font-size: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* ========================================
   Background Effects
   ======================================== */

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

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 20s ease-in-out infinite;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--primary-cyan) 0%, transparent 70%);
    top: -200px;
    left: -200px;
    animation-delay: 0s;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--primary-purple) 0%, transparent 70%);
    top: 50%;
    right: -150px;
    animation-delay: -7s;
}

.orb-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--primary-pink) 0%, transparent 70%);
    bottom: -100px;
    left: 30%;
    animation-delay: -14s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    25% {
        transform: translate(30px, -30px) scale(1.05);
    }

    50% {
        transform: translate(-20px, 20px) scale(0.95);
    }

    75% {
        transform: translate(20px, 30px) scale(1.02);
    }
}

/* ========================================
   Container
   ======================================== */

.container {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ========================================
   Header
   ======================================== */

.header {
    text-align: center;
    margin-bottom: 0.5rem;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.logo-image {
    width: 80px;
    height: 80px;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.2));
}

.logo-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-cyan), var(--primary-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
}

.logo-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 400;
    letter-spacing: 0.05em;
}

/* ========================================
   IP Info Section
   ======================================== */

.ip-info-section {
    width: 100%;
    max-width: 500px;
    margin: 0 auto 0.75rem;
}

.ip-info-card {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.05), rgba(123, 47, 255, 0.05));
    border: 1px solid rgba(0, 212, 255, 0.15);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    text-align: center;
}

.ip-main {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.ip-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 500;
}

.ip-address {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    background: linear-gradient(135deg, var(--primary-cyan), var(--primary-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ip-details {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
}

.ip-detail-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.ip-detail-icon {
    width: 16px;
    height: 16px;
    color: var(--primary-cyan);
    flex-shrink: 0;
}

/* ========================================
   Main Content
   ======================================== */

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

/* ========================================
   Speedometer
   ======================================== */

.speedometer-container {
    position: relative;
    width: 100%;
    max-width: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.speedometer {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 0 20px rgba(0, 212, 255, 0.2));
}

.speedometer-progress {
    transition: stroke-dashoffset 0.3s ease-out;
}

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

.speed-value {
    display: block;
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-cyan), var(--primary-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    transition: all 0.3s ease;
}

.speed-unit {
    display: block;
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-top: 0.25rem;
}

.test-type {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 500;
}

/* ========================================
   Start Button
   ======================================== */

.start-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    color: white;
    background: linear-gradient(135deg, var(--primary-cyan), var(--primary-purple));
    border: none;
    border-radius: 50px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: var(--glow-cyan);
}

.start-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-btn:hover::before {
    left: 100%;
}

.start-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 50px rgba(0, 212, 255, 0.5);
}

.start-btn:active {
    transform: scale(0.98);
}

.start-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

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

.btn-icon svg {
    width: 20px;
    height: 20px;
}

.start-btn.testing .btn-icon svg {
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
}

/* ========================================
   Results Grid
   ======================================== */

.results-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    width: 100%;
    max-width: 500px;
}

.result-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem 0.75rem;
    text-align: center;
    transition: all 0.3s ease;
}

.result-card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-2px);
}

.result-card.active {
    border-color: var(--primary-cyan);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.2);
}

.result-icon {
    width: 36px;
    height: 36px;
    margin: 0 auto 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
}

.result-icon svg {
    width: 18px;
    height: 18px;
}

.ping-icon {
    color: var(--primary-cyan);
}

.download-icon {
    color: var(--primary-purple);
}

.upload-icon {
    color: var(--primary-pink);
}

.result-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.result-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 500;
}

.result-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.result-unit {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* ========================================
   Progress Bar
   ======================================== */

.progress-container {
    width: 100%;
    max-width: 400px;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.progress-container.visible {
    display: flex;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary-cyan), var(--primary-purple), var(--primary-pink));
    border-radius: 3px;
    transition: width 0.3s ease;
}

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

/* ========================================
   Server Info & Security Badges
   ======================================== */

.server-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

.server-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(123, 47, 255, 0.1));
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 30px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary-cyan);
    letter-spacing: 0.05em;
}

.server-icon {
    width: 20px;
    height: 20px;
}

.security-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}

.security-badge {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.security-badge svg {
    width: 14px;
    height: 14px;
    color: #22c55e;
}

/* ========================================
   Footer
   ======================================== */

.footer {
    text-align: center;
    padding: 0.5rem 0;
}

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

.footer-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.lock-icon {
    width: 14px;
    height: 14px;
    color: #22c55e;
}

/* ========================================
   Animations
   ======================================== */

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-card {
    animation: fadeIn 0.5s ease forwards;
}

.result-card:nth-child(1) {
    animation-delay: 0.1s;
}

.result-card:nth-child(2) {
    animation-delay: 0.2s;
}

.result-card:nth-child(3) {
    animation-delay: 0.3s;
}

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 600px) {
    .container {
        padding: 1.5rem;
    }

    .logo {
        flex-direction: column;
        gap: 0.5rem;
    }

    .logo-image {
        width: 60px;
        height: 60px;
    }

    .logo-text {
        align-items: center;
    }

    .logo h1 {
        font-size: 1.5rem;
    }

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

    .results-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
    }

    .result-card {
        padding: 1rem 0.5rem;
    }

    .result-icon {
        width: 40px;
        height: 40px;
        margin-bottom: 0.75rem;
    }

    .result-icon svg {
        width: 20px;
        height: 20px;
    }

    .result-value {
        font-size: 1.25rem;
    }

    .start-btn {
        padding: 0.875rem 2rem;
        font-size: 1rem;
    }

    .server-badge {
        font-size: 0.75rem;
        padding: 0.5rem 1rem;
    }

    .security-badges {
        gap: 0.5rem;
    }

    .security-badge {
        font-size: 0.625rem;
        padding: 0.375rem 0.625rem;
    }
}

@media (max-width: 400px) {
    .results-grid {
        grid-template-columns: 1fr;
    }

    .result-card {
        display: flex;
        align-items: center;
        text-align: left;
        padding: 1rem;
        gap: 1rem;
    }

    .result-icon {
        margin: 0;
    }

    .result-info {
        flex: 1;
        flex-direction: row;
        align-items: baseline;
        gap: 0.5rem;
    }

    .result-value {
        font-size: 1.5rem;
    }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}