:root {
  /* ==== Base Neutrals ==== */
  --color-background: #121212;
  --color-surface-1: #1a1a1a;
  --color-surface-2: #1e1e1e;
  --color-surface-3: #222222;
  --color-surface-4: #2a2a2a;
  --color-border: #333333;

  --color-text-primary: #ffffff;
  --color-text-secondary: #b3b3b3;
  --color-text-muted: #777777;
  --color-text-inverse: #000000;

  /* ==== Brand (Green Accent - Radix style 1 → 12) ==== */
  --brand-1: #0d1912;
  --brand-2: #0c1f17;
  --brand-3: #0f291e;
  --brand-4: #113123;
  --brand-5: #133929;
  --brand-6: #164430;
  --brand-7: #1b543a;
  --brand-8: #236e4a;
  --brand-9: #30a46c; /* Accent principal */
  --brand-10: #3cb179;
  --brand-11: #4cc38a;
  --brand-12: #e5fbeb;

  /* ==== Status Colors ==== */
  --success-9: #30a46c;
  --warning-9: #f5a623;
  --error-9: #e5484d;
  --info-9: #2680eb;

  /* ==== Gradients (optional for cards or CTA buttons) ==== */
  --gradient-brand: linear-gradient(135deg, var(--brand-9), var(--brand-7));
  --gradient-surface: linear-gradient(135deg, var(--color-surface-2), var(--color-surface-4));
}



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

body {
    font-family: 'Space Mono', 'Courier New', monospace;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 100%);
    color: #ffffff;
    min-height: 100vh;
    line-height: 1.6;
}

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

/* Header */
.header {
    text-align: center;
    margin-bottom: 40px;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(45deg, #4CAF50, #2196F3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
}

.header p {
    font-size: 1.2rem;
    opacity: 0.8;
}


.brand-logo {
    height: 48px;
    width: auto;
  }
  @media (min-width: 992px) {
    .brand-logo { height: 48px; }
  }
  footer.site-footer {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
  }
  footer.site-footer a { color: rgba(255,255,255,0.9); text-decoration: none; }
  footer.site-footer a:hover { text-decoration: underline; color: #fff; }
  .footer-link { display:block; margin-bottom:.25rem; }

/* Speed Test Section */
.speed-test {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 40px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar .btn.btn-outline-primary {
    background: rgba(76, 175, 80, 0.3);
    border-color: #4CAF50;
    color: white;
    padding: 12px 24px;
    border-radius: 99px;
}
.navbar .btn.btn-outline-primary:hover {
    color: var(--color-text-primary);
    background-color: #409a7b;
}


/* Metrics */
.metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

.metric {
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.metric .icon {
    display: block;
    font-size: 2rem;
    margin-bottom: 10px;
}

.metric .label {
    display: block;
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 5px;
}

.metric .value {
    font-size: 2.5rem;
    font-weight: 700;
    color: #4CAF50;
}

.metric .unit {
    font-size: 0.9rem;
    opacity: 0.6;
}

/* Speedometer */
.speedometer {
    position: relative;
    text-align: center;
    margin: 40px 0;
}

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

.main-speed {
    font-size: 3rem;
    font-weight: 700;
    color: #4CAF50;
}

.speed-unit {
    font-size: 1.2rem;
    opacity: 0.7;
}

/* Additional Metrics */
.additional-metrics {
    margin-bottom: 30px;
}

.ping-metric {
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.ping-label {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.ping-unit {
    font-size: 0.9rem;
    opacity: 0.6;
    margin-left: 5px;
}

.ping-value {
    font-size: 2rem;
    font-weight: 700;
    color: #FFD700;
}

.ping-indicators {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
}

.quality-indicators {
    display: flex;
    gap: 15px;
}

.indicator {
    font-size: 1.5rem;
    opacity: 0.3;
    transition: opacity 0.3s;
}

.indicator.active {
    opacity: 1;
}

/* Location Info */
.location-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
    text-align: center;
}

.provider {
    font-size: 1.2rem;
    font-weight: 700;
    word-break: break-word;
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.ip-info {
    font-size: 0.9rem;
    opacity: 0.9;
    word-break: break-all;
}

.location {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

/* Test Button */
.test-button {
    display: block;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    padding: 20px 40px;
    background: linear-gradient(45deg, #4CAF50, #45a049);
    border: none;
    border-radius: 50px;
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
}

.test-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(76, 175, 80, 0.4);
}

.test-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Rankings Section */
.rankings {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.tab {
    padding: 12px 24px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.3s;
}

.tab.active,
.tab:hover {
    background: rgba(76, 175, 80, 0.3);
    border-color: #4CAF50;
    color: white;
}

.ranking-content {
    position: relative;
}

.ranking-tab {
    display: none;
}

.ranking-tab.active {
    display: block;
}

.ranking-tab h3 {
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.ranking-list {
    display: grid;
    gap: 10px;
}

.ranking-item {
    display: grid;
    grid-template-columns: 80px 1fr 120px;
    align-items: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.ranking-position {
    font-weight: 700;
    font-size: 1.2rem;
    color: #4CAF50;
}

.ranking-name {
    font-size: 1rem;
}

.ranking-speed {
    font-weight: 700;
    color: #FFD700;
    text-align: right;
}

/* Loading Animation */
.loading-container {
    text-align: center;
    padding: 40px 0;
}

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

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

.loading-text {
    font-size: 1.2rem;
    margin-bottom: 20px;
    opacity: 0.8;
}

.loading-progress {
    width: 100%;
    max-width: 300px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin: 0 auto;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #45a049);
    width: 0%;
    transition: width 0.3s ease;
    animation: progress 8s ease-in-out infinite;
}

@keyframes progress {
    0% { width: 0%; }
    100% { width: 100%; }
}

/* Results Summary */
.results-summary {
    margin-top: 40px;
    text-align: center;
}

.results-summary h3 {
    font-size: 1.8rem;
    margin-bottom: 30px;
    color: #4CAF50;
}

.results-table {
    width: 100%;
    max-width: 600px;
    margin: 0 auto 30px;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    overflow: hidden;
}

.results-table th,
.results-table td {
    padding: 15px 20px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.results-table th {
    background: rgba(255, 255, 255, 0.1);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.results-table td {
    font-size: 1rem;
}

.results-table tr:last-child td {
    border-bottom: none;
}

.status-good {
    color: #4CAF50;
    font-weight: 600;
}

.status-fair {
    color: #FFD700;
    font-weight: 600;
}

.status-poor {
    color: #f44336;
    font-weight: 600;
}

.restart-button {
    margin-top: 20px;
    background: linear-gradient(45deg, #2196F3, #1976D2);
}

.restart-button:hover:not(:disabled) {
    box-shadow: 0 5px 20px rgba(33, 150, 243, 0.4);
}

/* Responsive */
@media (max-width: 768px) {
    .metrics {
        grid-template-columns: 1fr;
    }
    
    .location-info {
        grid-template-columns: 1fr;
    }
    
    .ranking-item {
        grid-template-columns: 60px 1fr 100px;
        font-size: 0.9rem;
    }
}





/* New mission banner styles */
.mission-banner {
    background: linear-gradient(90deg, rgba(76, 175, 80, 0.1), rgba(33, 150, 243, 0.1));
    border: 1px solid rgba(76, 175, 80, 0.3);
    border-radius: 15px;
    padding: 20px;
    margin-top: 20px;
}

.mission-text {
    display: block;
    font-size: 1.1rem;
    color: #8BC34A;
    margin-bottom: 10px;
}

.data-counter {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.counter-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #4CAF50;
}

.counter-label {
    font-size: 0.9rem;
    opacity: 0.8;
}


/* Add these new styles for the enhanced ping section */

.ping-details {
    margin-top: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.ping-quality {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.quality-label {
    font-size: 0.9rem;
    min-width: 80px;
}

.quality-bar {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.quality-fill {
    display: block;
    height: 100%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.quality-excellent .quality-fill { background: #4CAF50; width: 100%; }
.quality-good .quality-fill { background: #8BC34A; width: 75%; }
.quality-fair .quality-fill { background: #FFD700; width: 50%; }
.quality-poor .quality-fill { background: #FF9800; width: 25%; }
.quality-bad .quality-fill { background: #f44336; width: 10%; }

.ping-activities {
    display: grid;
    gap: 10px;
    margin-bottom: 20px;
}

.activity-item {
    display: grid;
    grid-template-columns: 24px 1fr 60px;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
}

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

.activity-name {
    font-size: 0.9rem;
    text-align: left;
}

.activity-status {
    font-size: 0.8rem;
    text-align: right;
    font-weight: 600;
}

.activity-status.excellent { color: #4CAF50; }
.activity-status.good { color: #8BC34A; }
.activity-status.fair { color: #FFD700; }
.activity-status.poor { color: #FF9800; }
.activity-status.bad { color: #f44336; }

.ping-info {
    display: grid;
    gap: 5px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    opacity: 0.8;
}

.details-toggle {
    margin-top: 15px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    color: white;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.details-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
}

.toggle-icon {
    display: inline-block;
    transition: transform 0.3s;
}

.details-toggle.expanded .toggle-icon {
    transform: rotate(180deg);
}

/* Responsive */
@media (max-width: 768px) {
    .metrics {
        grid-template-columns: 1fr;
    }
    
    .location-info {
        grid-template-columns: 1fr;
    }
    
    .ranking-item {
        grid-template-columns: 60px 1fr 100px;
        font-size: 0.9rem;
    }
    
    #speedometer-canvas {
        width: 250px;
        height: 166px;
    }
    
    .main-speed {
        font-size: 2rem;
    }
    
    .location-verification {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}