/* ============================================= */
/* CEA - TESTE DE INTERNET - ESTILOS             */
/* Tema: Black & Gold Premium                    */
/* ============================================= */

:root {
    --gold: #b8860b;
    --gold-bright: #d4a017;
    --gold-transparent: rgba(184, 134, 11, 0.15);
    --black: #f5f5f5;
    --dark-grey: #e8e8e8;
    --medium-grey: #e0e0e0;
    --white: #1a1a1a;
    --text-primary: #1a1a1a;
    --text-secondary: #666;
    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;
}

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

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    background: #f5f5f5;
    color: #1a1a1a;
    font-family: 'Montserrat', 'Inter', sans-serif;
    overflow: hidden;
}

/* ========== CONTAINER ========== */
.speedtest-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    background: radial-gradient(circle at top, #f0f0f0, #f5f5f5);
}

/* ========== BODY ========== */
.speedtest-body {
    flex: 1;
    padding: 30px 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.speedtest-body::-webkit-scrollbar { width: 4px; }
.speedtest-body::-webkit-scrollbar-track { background: transparent; }
.speedtest-body::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 10px; }

/* ========== MEDIDOR CIRCULAR ========== */
.gauge-container {
    position: relative;
    width: 180px;
    height: 180px;
    flex-shrink: 0;
}

.gauge-ring {
    position: absolute;
    inset: 10px;
    border-radius: 50%;
    background: conic-gradient(var(--gold) 0deg, var(--gold-transparent) 0deg);
    transition: background 0.5s ease;
}

.gauge-inner {
    position: absolute;
    inset: 25px;
    border-radius: 50%;
    background: #f5f5f5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.gauge-value {
    font-size: 36px;
    font-weight: 800;
    color: var(--gold);
    line-height: 1;
    transition: all 0.3s;
}

.gauge-unit {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.gauge-circle {
    position: absolute;
    inset: 0;
    transform: rotate(-90deg);
}

.gauge-bg {
    fill: none;
    stroke: rgba(0,0,0,0.08);
    stroke-width: 8;
}

.gauge-fill {
    fill: none;
    stroke: var(--gold);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 534;
    stroke-dashoffset: 534;
    transition: stroke-dashoffset 0.5s ease;
}

/* ========== STATUS ========== */
.speedtest-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.status-icon { font-size: 18px; }

/* ========== MÉTRICAS ========== */
.metrics-row {
    display: flex;
    gap: 12px;
    width: 100%;
    max-width: 500px;
}

.metric-card {
    flex: 1;
    background: var(--dark-grey);
    border: 1px solid rgba(184, 134, 11, 0.2);
    border-radius: 12px;
    padding: 14px 10px;
    text-align: center;
    transition: all 0.3s;
}

.metric-icon { font-size: 20px; margin-bottom: 4px; }
.metric-label { font-size: 9px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.metric-value { font-size: 20px; font-weight: 700; color: var(--gold); }
.metric-unit { font-size: 8px; color: var(--text-secondary); }

/* ========== BARRA DE PROGRESSO ========== */
.test-progress {
    width: 100%;
    max-width: 500px;
    text-align: center;
}

.progress-info-text {
    font-size: 10px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.progress-bar-container {
    height: 4px;
    background: rgba(0,0,0,0.05);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold), var(--gold-bright));
    border-radius: 2px;
    width: 0%;
    transition: width 0.3s ease;
}

/* ========== HISTÓRICO ========== */
.history-section {
    width: 100%;
    max-width: 500px;
}

.history-title {
    font-size: 10px;
    font-weight: 700;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--dark-grey);
    border: 1px solid rgba(184, 134, 11, 0.1);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 9px;
}

.history-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--gold);
    flex-shrink: 0;
}

.history-date { color: var(--text-secondary); flex-shrink: 0; }
.history-ping { color: var(--text-primary); flex: 1; text-align: right; }

/* ========== FOOTER ========== */
.speedtest-footer {
    flex-shrink: 0;
    padding: 12px 20px;
    background: var(--dark-grey);
    border-top: 1px solid rgba(184, 134, 11, 0.2);
    display: flex;
    justify-content: center;
}

.btn-test {
    background: var(--gold);
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 800;
    transition: all 0.3s;
}

.btn-test:hover {
    background: var(--gold-bright);
    transform: scale(1.03);
    box-shadow: 0 4px 20px rgba(184, 134, 11, 0.3);
}

.btn-test:active { transform: scale(0.97); }
.btn-test:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* ========== TEMA DARK ========== */
body.tema-dark {
    --gold: #D4AF37;
    --gold-bright: #f1c40f;
    --gold-transparent: rgba(212, 175, 55, 0.15);
    --black: #0a0a0a;
    --dark-grey: #1a1a1a;
    --medium-grey: #2a2a2a;
    --white: #ffffff;
    --text-primary: #ffffff;
    --text-secondary: #999;
    background: #0a0a0a;
    color: #ffffff;
}

body.tema-dark .speedtest-container {
    background: radial-gradient(circle at top, #111, #000);
}

body.tema-dark .speedtest-footer {
    background: #1a1a1a;
    border-top: 1px solid rgba(212, 175, 55, 0.2);
}

body.tema-dark .gauge-inner { background: #0a0a0a; }
body.tema-dark .gauge-bg { stroke: rgba(255,255,255,0.08); }

body.tema-dark .metric-card {
    background: #1a1a1a;
    border-color: rgba(212, 175, 55, 0.15);
}

body.tema-dark .history-item {
    background: #1a1a1a;
    border-color: rgba(212, 175, 55, 0.1);
}

body.tema-dark .progress-bar-container { background: rgba(255,255,255,0.05); }

body.tema-dark .btn-test { color: #000; }
body.tema-dark .btn-test:hover { color: #000; }

/* ========== RESPONSIVO ========== */
@media (max-width: 480px) {
    .speedtest-body { padding: 20px 14px; gap: 16px; }
    .gauge-container { width: 140px; height: 140px; }
    .gauge-value { font-size: 28px; }
    .metrics-row { gap: 8px; }
    .metric-card { padding: 10px 6px; }
    .metric-value { font-size: 16px; }
}
/* ========== CLASSIFICAÇÃO ========== */
.metric-classificacao {
    font-size: 7px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

.classificacao-badge {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 1px solid;
    transition: all 0.3s;
}

/* ========== BOTÃO LIMPAR HISTÓRICO ========== */
.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.btn-limpar {
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    opacity: 0.5;
}

.btn-limpar:hover {
    opacity: 1;
    background: rgba(239, 68, 68, 0.1);
}

body.tema-dark .btn-limpar {
    border-color: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}