/**
 * Cloud Gaming Map - Simulador de Latência
 * Estilos para o simulador baseado em medições reais do overlay
 */

/* ===============================================
   CONTAINER GERAL E HEADER
   =============================================== */

.cgm-container {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(250, 251, 252, 0.98) 100%);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(37, 40, 36, 0.08);
    padding: 24px;
    margin: 16px 0;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(37, 40, 36, 0.06);
}

.cgm-header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 8px 0 24px; /* respiro superior para afastar do topo */
    padding: 8px 0 16px;
    border-bottom: 1px solid rgba(37, 40, 36, 0.08);
}

.cgm-page-title {
    font-size: 32px;
    font-weight: 700;
    margin: 6px 0 8px; /* aumenta espaçamento superior e inferior */
    background: linear-gradient(135deg, var(--cgm-dark) 0%, rgba(37, 40, 36, 0.8) 100%);
    -webkit-background-clip: unset !important;
    -webkit-text-fill-color: #ffffff !important;
    background-clip: unset !important;
}

.cgm-leaderboard-icon {
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    /* Remover qualquer estilo de bolinha ou círculo */
    background: none !important;
    border-radius: 0 !important;
    width: auto !important;
    height: auto !important;
    display: inline-block !important;
    flex-direction: row !important;
}

.cgm-leaderboard-label {
    background: rgba(37, 40, 36, 0.04) !important;
    color: var(--cgm-text-muted) !important;
    padding: 8px 16px !important;
    border-radius: 20px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    border: 1px solid rgba(37, 40, 36, 0.08) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    white-space: nowrap !important;
    display: inline-block !important;
}

.cgm-leaderboard-icon:hover .cgm-leaderboard-label {
    /* Apenas sombra leve, sem mudança de cor */
    background: rgba(37, 40, 36, 0.04) !important;
    color: var(--cgm-text-muted) !important;
    border-color: rgba(37, 40, 36, 0.08) !important;
    transform: none !important;
    box-shadow: 0 2px 8px rgba(37, 40, 36, 0.1) !important;
}

/* ===============================================
   SIMULADOR DE LATÊNCIA
   =============================================== */

.cgm-simulator {
    background: linear-gradient(135deg, 
        rgba(118, 255, 3, 0.03) 0%, 
        rgba(37, 40, 36, 0.04) 50%, 
        rgba(105, 152, 36, 0.06) 100%);
    border: 1px solid rgba(37, 40, 36, 0.1);
    border-radius: 24px;
    padding: 32px;
    margin: 24px 0;
    color: var(--cgm-dark);
    box-shadow: 0 12px 40px rgba(37, 40, 36, 0.1);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.cgm-simulator::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(118, 255, 3, 0.3) 50%, 
        transparent 100%);
}

.cgm-simulator-header h3 {
    margin: 0 0 12px 0;
    font-size: 28px;
    font-weight: 600;
    color: var(--cgm-dark);
    text-align: center;
    background: linear-gradient(135deg, var(--cgm-dark) 0%, rgba(37, 40, 36, 0.8) 100%);
    -webkit-background-clip: unset !important;
    -webkit-text-fill-color: #ffffff !important;
    background-clip: unset !important;
}

.cgm-simulator-header p {
    margin: 0 0 20px 0;
    color: var(--cgm-text-muted);
    font-size: 15px;
    line-height: 1.6;
    text-align: center;
}

/* Campo CEP + botão Buscar (injetados pelo map.js) */
.cgm-address-input {
    display: flex;
    gap: 12px;
    align-items: center;
    margin: 12px 0 0;
}
.cgm-address-input input#cgm-address {
    flex: 1;
    padding: 12px 14px;
    border: 2px solid var(--cgm-border);
    border-radius: 10px;
    font-size: 14px;
}
.cgm-address-input button#cgm-search-btn {
    background: var(--cgm-text) !important; /* solicitado: azul escuro do projeto */
    color: var(--cgm-bg-light) !important;
    border: 1px solid rgba(37, 40, 36, 0.25) !important;
    padding: 10px 18px !important;
    border-radius: 12px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    transition: box-shadow .2s ease !important;
}
.cgm-address-input button#cgm-search-btn:hover {
    box-shadow: 0 2px 10px rgba(37, 40, 36, 0.25) !important;
}

.cgm-simulator-header code {
    background: rgba(37, 40, 36, 0.08);
    color: var(--cgm-secondary);
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 13px;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
    font-weight: 500;
}

.cgm-simulator-info {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
    justify-content: center;
}

.cgm-info-badge {
    background: rgba(118, 255, 3, 0.1);
    color: var(--cgm-secondary);
    border: 1px solid rgba(118, 255, 3, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    backdrop-filter: blur(5px);
}

.cgm-simulator-controls {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.cgm-controls-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 12px; /* linhas/colunas mais compactas */
    align-items: center;
    justify-content: center;
}

/* Row especial para o botão principal */
.cgm-simulate-row {
    justify-content: center !important;
    margin-bottom: 30px !important;
}

/* Estilo do botão principal centralizado */
.cgm-simulate-btn-main {
    min-width: 200px !important;
    padding: 14px 28px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
}

.cgm-provider-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    align-items: center; /* alinha base */
}

.cgm-filter-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    background: rgba(37, 40, 36, 0.04);
    color: var(--cgm-dark);
    padding: 10px 20px;
    border-radius: 25px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    border: 1px solid rgba(37, 40, 36, 0.08);
    font-weight: 500;
}

.cgm-filter-label:hover {
    background: rgba(37, 40, 36, 0.08);
    border-color: rgba(37, 40, 36, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(37, 40, 36, 0.12);
}

.cgm-filter-label input[type="radio"] {
    display: none;
}

/* Bolinha indicadora */
.cgm-filter-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: transparent;
    border: 2px solid rgba(37, 40, 36, 0.3);
    transition: all 0.3s ease;
    margin-right: 4px;
}

.cgm-filter-label input[type="radio"]:checked + .cgm-filter-indicator {
    background: var(--cgm-secondary);
    border-color: var(--cgm-secondary);
    box-shadow: 0 0 0 2px rgba(118, 255, 3, 0.3);
}

.cgm-filter-label input[type="radio"]:checked ~ .cgm-filter-text {
    font-weight: 600;
}

.cgm-filter-label:has(input:checked) {
    background: rgba(118, 255, 3, 0.15);
    color: var(--cgm-secondary);
    border-color: rgba(118, 255, 3, 0.3);
    box-shadow: 0 4px 16px rgba(118, 255, 3, 0.2);
}

.cgm-filter-text {
    font-size: 14px;
    transition: font-weight 0.2s ease;
}

/* ===============================================
   BOTÕES DE SIMULAÇÃO
   =============================================== */

#cgm-simulate-latency {
    background: var(--cgm-primary) !important;
    color: var(--cgm-dark) !important;
    border: 1px solid rgba(118, 255, 3, 0.3) !important;
    padding: 14px 32px !important;
    border-radius: 25px !important;
    font-weight: 600 !important;
    font-size: 15px !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    text-transform: none !important;
    letter-spacing: 0.3px !important;
    min-width: 180px !important;
}

#cgm-simulate-latency:hover:not(:disabled) {
    background: var(--cgm-primary) !important;
    color: var(--cgm-dark) !important;
    border-color: rgba(118, 255, 3, 0.3) !important;
    transform: none !important;
    box-shadow: 0 2px 8px rgba(118, 255, 3, 0.2) !important;
}

#cgm-simulate-latency:disabled {
    background: rgba(37, 40, 36, 0.1) !important;
    color: var(--cgm-text-muted) !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
    opacity: 0.5 !important;
}

/* Estado pronto para simular */
#cgm-simulate-latency.cgm-location-ready {
    background: var(--cgm-primary) !important;
    color: var(--cgm-dark) !important;
    border-color: rgba(118, 255, 3, 0.5) !important;
    box-shadow: 0 2px 12px rgba(118, 255, 3, 0.3) !important;
    animation: pulse-ready 2s ease-in-out infinite;
}

@keyframes pulse-ready {
    0%, 100% { box-shadow: 0 2px 12px rgba(118, 255, 3, 0.3); }
    50% { box-shadow: 0 4px 20px rgba(118, 255, 3, 0.5); }
}

.cgm-force-location-btn {
    background: var(--cgm-text) !important;
    color: #ffffff !important;
    border: 1px solid rgba(37, 40, 36, 0.15);
    padding: 12px 24px;
    border-radius: 20px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cgm-force-location-btn:hover:not(:disabled) {
    background: #B8FA10 !important;
    color: var(--cgm-text) !important;
    border-color: rgba(37, 40, 36, 0.25) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(37, 40, 36, 0.12);
}

.cgm-force-location-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: rgba(37, 40, 36, 0.02);
}

.cgm-force-location-btn.success {
    background: rgba(118, 255, 3, 0.15);
    color: var(--cgm-secondary);
    border-color: rgba(118, 255, 3, 0.3);
}

/* ===============================================
   WI-FI TOGGLE
   =============================================== */

.cgm-wifi-container {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center; /* centraliza junto aos filtros */
    width: 100%;
}

.cgm-wifi-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    user-select: none;
    background: rgba(37, 40, 36, 0.04);
    color: var(--cgm-dark);
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid rgba(37, 40, 36, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cgm-wifi-label:hover {
    background: rgba(37, 40, 36, 0.08);
    border-color: rgba(37, 40, 36, 0.15);
    transform: translateY(-1px);
}

#cgm-wifi-toggle {
    width: 18px;
    height: 18px;
    accent-color: var(--cgm-primary);
}

/* ===============================================
   RESULTADOS DA SIMULAÇÃO
   =============================================== */

.cgm-simulation-results {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.8) 0%, 
        rgba(250, 251, 252, 0.9) 100%);
    border: 1px solid rgba(37, 40, 36, 0.08);
    border-radius: 20px;
    padding: 24px;
    margin-top: 24px;
    backdrop-filter: blur(15px);
    box-shadow: 0 8px 32px rgba(37, 40, 36, 0.08);
    position: relative;
    overflow: hidden;
}

.cgm-simulation-results::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        rgba(118, 255, 3, 0.3) 0%, 
        rgba(37, 40, 36, 0.2) 50%, 
        rgba(118, 255, 3, 0.3) 100%);
}

.cgm-simulation-header {
    text-align: center;
    margin-bottom: 24px;
}

.cgm-simulation-header h4 {
    margin: 0 0 12px 0;
    font-size: 20px;
    font-weight: 600;
    background: linear-gradient(135deg, var(--cgm-dark) 0%, rgba(37, 40, 36, 0.8) 100%);
    -webkit-background-clip: unset !important;
    -webkit-text-fill-color: #ffffff !important;
    background-clip: unset !important;
}

.cgm-simulation-info {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.cgm-info-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--cgm-text-muted);
    background: rgba(37, 40, 36, 0.04);
    padding: 6px 12px;
    border-radius: 15px;
    border: 1px solid rgba(37, 40, 36, 0.06);
    font-weight: 500;
}

.cgm-results-table-container {
    overflow-x: auto;
    max-height: 600px;
    overflow-y: auto;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(37, 40, 36, 0.06);
}

.cgm-results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.cgm-results-table thead {
    background: rgba(255,255,255,0.98);
    border-bottom: 1px solid rgba(37, 40, 36, 0.1);
    position: sticky;
    top: 0;
    z-index: 10;
}

.cgm-results-table th {
    padding: 12px 12px 8px; /* menos espaço inferior, mais equilíbrio */
    text-align: left;
    font-weight: 600;
    color: var(--cgm-dark);
    border-bottom: 1px solid rgba(37, 40, 36, 0.08);
    font-size: 13px;
    letter-spacing: 0.3px;
    vertical-align: middle;
}

.cgm-results-table td {
    padding: 12px 12px 14px; /* reduz top, aumenta bottom levemente */
    border-bottom: 1px solid rgba(37, 40, 36, 0.04);
    vertical-align: middle;
}

/* Localização: cidade em cima, país abaixo (muted) */
.cgm-results-table .cgm-location { display: flex; flex-direction: column; }
.cgm-results-table .cgm-location .cgm-region { font-size: 14px; color: var(--cgm-text); }
.cgm-results-table .cgm-location .cgm-country { font-size: 12px; color: var(--cgm-text-muted); }

.cgm-provider-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
    border: 1px solid;
}

.cgm-provider-xcloud {
    background: rgba(16, 124, 16, 0.1);
    color: #0D5C0D;
    border-color: rgba(16, 124, 16, 0.2);
}

.cgm-provider-gfn {
    background: rgba(118, 185, 0, 0.1);
    color: #5A8A00;
    border-color: rgba(118, 185, 0, 0.2);
}

.cgm-provider-boosteroid {
    background: rgba(139, 92, 246, 0.1);
    color: #7C3AED;
    border-color: rgba(139, 92, 246, 0.2);
}

.cgm-provider-default {
    background: rgba(37, 40, 36, 0.08);
    color: var(--cgm-dark);
    border-color: rgba(37, 40, 36, 0.15);
}

.cgm-latency-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 15px;
    font-weight: 600;
    font-size: 13px;
    min-width: 50px;
    text-align: center;
    border: 1px solid;
}

.cgm-latency.excellent,
.cgm-latency-excellent {
    background: rgba(118, 255, 3, 0.15);
    color: var(--cgm-secondary);
    border-color: rgba(118, 255, 3, 0.3);
}

.cgm-latency.good,
.cgm-latency-good {
    background: rgba(245, 158, 11, 0.1);
    color: #B45309;
    border-color: rgba(245, 158, 11, 0.2);
}

.cgm-latency.warn,
.cgm-latency-warn {
    background: rgba(234, 88, 12, 0.12);
    color: #9A3412;
    border-color: rgba(234, 88, 12, 0.25);
}

.cgm-latency.poor,
.cgm-latency-poor {
    background: rgba(239, 68, 68, 0.1);
    color: #B91C1C;
    border-color: rgba(239, 68, 68, 0.2);
}

.cgm-position-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-weight: 400;
    font-size: 11px;
    border: 1px solid;
}

.cgm-position-1 {
    background: rgba(118, 255, 3, 0.15);
    color: var(--cgm-secondary);
    border-color: rgba(118, 255, 3, 0.4);
}

.cgm-position-2 {
    background: rgba(37, 40, 36, 0.08);
    color: var(--cgm-dark);
    border-color: rgba(37, 40, 36, 0.2);
}

.cgm-position-3 {
    background: rgba(245, 158, 11, 0.1);
    color: #B45309;
    border-color: rgba(245, 158, 11, 0.3);
}

.cgm-position-default {
    background: rgba(37, 40, 36, 0.04);
    color: var(--cgm-text-muted);
    border-color: rgba(37, 40, 36, 0.1);
}

.cgm-distance-text {
    font-size: 13px;
    opacity: 0.9;
}

.cgm-margin-text {
    font-size: 12px;
    opacity: 0.8;
    font-weight: 500;
}

/* ===============================================
   AÇÕES DA SIMULAÇÃO
   =============================================== */

.cgm-simulation-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(37, 40, 36, 0.08);
    flex-wrap: wrap;
}

.cgm-action-btn {
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Botões padronizados com paleta do projeto */
.cgm-btn-primary {
    background: var(--cgm-primary) !important;
    color: var(--cgm-dark) !important;
    border: 1px solid rgba(118, 255, 3, 0.3) !important;
}

.cgm-btn-primary:hover {
    background: var(--cgm-primary) !important;
    color: var(--cgm-dark) !important;
    border-color: rgba(118, 255, 3, 0.3) !important;
    transform: none !important;
    box-shadow: 0 2px 8px rgba(118, 255, 3, 0.2) !important;
}

.cgm-btn-secondary {
    background: var(--cgm-primary) !important;
    color: var(--cgm-dark) !important;
    border: 1px solid rgba(118, 255, 3, 0.3) !important;
}

.cgm-btn-secondary:hover {
    background: var(--cgm-primary) !important;
    color: var(--cgm-dark) !important;
    border-color: rgba(118, 255, 3, 0.3) !important;
    transform: none !important;
    box-shadow: 0 2px 8px rgba(118, 255, 3, 0.2) !important;
}

.cgm-btn-tertiary {
    background: var(--cgm-primary) !important;
    color: var(--cgm-dark) !important;
    border: 1px solid rgba(118, 255, 3, 0.3) !important;
}

.cgm-btn-tertiary:hover {
    background: var(--cgm-primary) !important;
    color: var(--cgm-dark) !important;
    border-color: rgba(118, 255, 3, 0.3) !important;
    transform: none !important;
    box-shadow: 0 2px 8px rgba(118, 255, 3, 0.2) !important;
}

/* Botão de resetar - cor diferente (vermelho) */
.cgm-btn-danger {
    background: linear-gradient(135deg, #f44336, #d32f2f) !important;
    color: white !important;
    box-shadow: 0 2px 8px rgba(244, 67, 54, 0.2) !important;
    border: none !important;
}

.cgm-btn-danger:hover {
    background: linear-gradient(135deg, #d32f2f, #c62828) !important;
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3) !important;
    transform: translateY(-1px) !important;
}

/* ===============================================
   MODALS
   =============================================== */

.cgm-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(37, 40, 36, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
}

.cgm-modal-content {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.98) 0%, 
        rgba(250, 251, 252, 0.99) 100%);
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(37, 40, 36, 0.2);
    border: 1px solid rgba(37, 40, 36, 0.08);
}

.cgm-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px 16px;
    border-bottom: 1px solid rgba(37, 40, 36, 0.08);
}

.cgm-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--cgm-dark);
}

.cgm-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--cgm-text-muted);
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.cgm-modal-close:hover {
    background: rgba(37, 40, 36, 0.08);
    color: var(--cgm-dark);
}

.cgm-modal-body {
    padding: 24px;
}

.cgm-modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
}

/* Botões dos modais também seguem o padrão */
.cgm-modal-actions .cgm-btn {
    background: var(--cgm-primary) !important;
    color: var(--cgm-dark) !important;
    border: 1px solid rgba(118, 255, 3, 0.3) !important;
    padding: 10px 20px !important;
    border-radius: 20px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    min-width: 120px !important;
    justify-content: center !important;
}

.cgm-modal-actions .cgm-btn:hover {
    background: var(--cgm-primary) !important;
    color: var(--cgm-dark) !important;
    border-color: rgba(118, 255, 3, 0.3) !important;
    transform: none !important;
    box-shadow: 0 2px 8px rgba(118, 255, 3, 0.2) !important;
}

/* ===============================================
   SISTEMA DE AVALIAÇÃO
   =============================================== */

.cgm-rating-stars {
    display: flex;
    gap: 8px;
    margin: 16px 0;
    justify-content: center;
    flex-wrap: wrap;
}

.cgm-star-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(37, 40, 36, 0.15);
    background: rgba(37, 40, 36, 0.04);
    color: var(--cgm-dark);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cgm-star-btn:hover {
    background: rgba(118, 255, 3, 0.15);
    border-color: rgba(118, 255, 3, 0.3);
    transform: scale(1.1);
}

.cgm-star-btn.active {
    background: var(--cgm-primary);
    border-color: var(--cgm-secondary);
    color: var(--cgm-dark);
    transform: scale(1.1);
}

.cgm-rating-comment {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(37, 40, 36, 0.15);
    border-radius: 12px;
    font-size: 14px;
    resize: vertical;
    margin-top: 16px;
    font-family: inherit;
}

.cgm-rating-comment:focus {
    outline: none;
    border-color: var(--cgm-primary);
    box-shadow: 0 0 0 3px rgba(118, 255, 3, 0.1);
}

/* ===============================================
   LISTAGEM DE AVALIAÇÕES
   =============================================== */

.cgm-ratings-list {
    max-height: 400px;
    overflow-y: auto;
}

.cgm-rating-item {
    padding: 16px;
    border: 1px solid rgba(37, 40, 36, 0.08);
    border-radius: 12px;
    margin-bottom: 12px;
    background: rgba(255, 255, 255, 0.5);
}

.cgm-rating-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.cgm-rating-score {
    background: var(--cgm-primary);
    color: var(--cgm-dark);
    padding: 4px 8px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 12px;
}

.cgm-rating-user {
    font-weight: 500;
    color: var(--cgm-dark);
}

.cgm-rating-date {
    font-size: 12px;
    color: var(--cgm-text-muted);
}

.cgm-rating-text {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--cgm-text-muted);
}

/* ===============================================
   TOAST NOTIFICATIONS
   =============================================== */

.cgm-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10001;
    min-width: 320px;
    max-width: 500px;
    background: var(--cgm-bg-card);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(37, 40, 36, 0.15);
    border: 1px solid rgba(37, 40, 36, 0.08);
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cgm-toast-show {
    transform: translateX(0);
    opacity: 1;
}

.cgm-toast-hide {
    transform: translateX(100%);
    opacity: 0;
}

.cgm-toast-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
}

.cgm-toast-message {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--cgm-dark);
}

.cgm-toast-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--cgm-text-muted);
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    margin-left: 12px;
}

.cgm-toast-close:hover {
    background: rgba(37, 40, 36, 0.08);
    color: var(--cgm-dark);
}

.cgm-toast-success {
    border-left: 4px solid var(--cgm-primary);
}

.cgm-toast-error {
    border-left: 4px solid #ef4444;
}

.cgm-toast-info {
    border-left: 4px solid #3b82f6;
}

/* ===============================================
   SLIDER DE AVALIAÇÃO
   =============================================== */

.cgm-rating-slider-container {
    margin: 20px 0;
    padding: 20px;
    background: rgba(37, 40, 36, 0.02);
    border-radius: 12px;
    border: 1px solid rgba(37, 40, 36, 0.06);
}

.cgm-rating-label {
    display: block;
    font-weight: 600;
    color: var(--cgm-dark);
    margin-bottom: 12px;
    font-size: 16px;
}

.cgm-rating-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: rgba(37, 40, 36, 0.1);
    outline: none;
    margin: 12px 0;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.cgm-rating-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--cgm-primary);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(118, 255, 3, 0.3);
}

.cgm-rating-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--cgm-primary);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(118, 255, 3, 0.3);
}

.cgm-slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--cgm-text-muted);
    margin-top: 8px;
}

.cgm-comment-container {
    margin: 20px 0;
}

.cgm-comment-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
    color: var(--cgm-dark);
    margin-bottom: 8px;
}

.cgm-char-counter {
    font-size: 12px;
    color: var(--cgm-text-muted);
    font-weight: normal;
}

/* ===============================================
   SISTEMA DE RESPOSTAS
   =============================================== */

.cgm-rating-actions {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(37, 40, 36, 0.06);
}

/* Botões padronizados - Responder e Comentar */
.cgm-reply-btn,
.cgm-btn-small,
#cgm-submit-comment {
    background: var(--cgm-primary) !important;
    color: var(--cgm-dark) !important;
    border: 1px solid rgba(118, 255, 3, 0.3) !important;
    padding: 8px 16px !important;
    border-radius: 20px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
}

.cgm-reply-btn:hover,
.cgm-btn-small:hover,
#cgm-submit-comment:hover {
    background: var(--cgm-primary) !important;
    color: var(--cgm-dark) !important;
    border-color: rgba(118, 255, 3, 0.5) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 8px rgba(118, 255, 3, 0.2) !important;
}

.cgm-replies-container {
    margin-top: 16px;
    padding-left: 20px;
    border-left: 2px solid rgba(37, 40, 36, 0.06);
}

.cgm-reply-item {
    padding: 12px 0;
    border-bottom: 1px solid rgba(37, 40, 36, 0.04);
}

.cgm-reply-item:last-child {
    border-bottom: none;
}

.cgm-reply-new {
    background: rgba(118, 255, 3, 0.05);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(118, 255, 3, 0.1);
}

.cgm-reply-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.cgm-reply-user {
    font-weight: 500;
    color: var(--cgm-secondary);
    font-size: 13px;
}

.cgm-reply-date {
    font-size: 11px;
    color: var(--cgm-text-muted);
}

.cgm-reply-text {
    margin: 0;
    font-size: 13px;
    line-height: 1.4;
    color: var(--cgm-text-muted);
}

.cgm-reply-form {
    margin-top: 12px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    border: 1px solid rgba(37, 40, 36, 0.08);
}

.cgm-reply-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(37, 40, 36, 0.15);
    border-radius: 8px;
    font-size: 13px;
    resize: vertical;
    margin-bottom: 12px;
    font-family: inherit;
}

.cgm-reply-textarea:focus {
    outline: none;
    border-color: var(--cgm-primary);
    box-shadow: 0 0 0 3px rgba(118, 255, 3, 0.1);
}

.cgm-reply-form-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.cgm-reply-form-actions .cgm-btn {
    padding: 8px 16px;
    font-size: 13px;
}

/* ===============================================
   AJUSTES NO BOTÃO RANK
   =============================================== */

.cgm-header-container {
    margin: 0 16px;
    padding: 0 8px;
}

.cgm-leaderboard-label {
    background: rgba(37, 40, 36, 0.04) !important;
    color: var(--cgm-text-muted) !important;
    padding: 8px 16px !important;
    border-radius: 20px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    border: 1px solid rgba(37, 40, 36, 0.08) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    white-space: nowrap !important;
}

.cgm-leaderboard-icon:hover .cgm-leaderboard-label {
    background: rgba(118, 255, 3, 0.15) !important;
    color: var(--cgm-secondary) !important;
    border-color: rgba(118, 255, 3, 0.3) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(118, 255, 3, 0.2) !important;
}

/* ===============================================
   RESPONSIVIDADE
   =============================================== */

@media (max-width: 768px) {
    .cgm-container {
        padding: 16px;
        margin: 8px 0;
        border-radius: 12px;
    }
    
    .cgm-header-container {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .cgm-page-title {
        font-size: 24px;
    }
    
    .cgm-simulator {
        padding: 16px;
        margin: 16px 0;
    }
    
    .cgm-simulator-header h3 {
        font-size: 20px;
    }

/* Ajuste de título para duas linhas em telas estreitas */
@media (max-width: 420px) {
    .cgm-simulator-header h3 {
        line-height: 1.25;
        word-break: break-word;
        hyphens: auto;
        text-align: center;
    }
}
    
    .cgm-controls-row {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .cgm-provider-filters {
        justify-content: center;
    }
    
    .cgm-filter-label {
        padding: 6px 10px;
    }
    
    .cgm-filter-text {
        font-size: 12px;
    }
    
    .cgm-results-table {
        font-size: 12px;
    }
    
    .cgm-results-table th,
    .cgm-results-table td {
        padding: 8px 4px;
    }
    
    .cgm-simulation-header {
        padding: 16px;
    }
    
    #cgm-simulate-latency {
        min-width: auto;
        width: 100%;
    }
    
    .cgm-force-location-btn {
        width: 100%;
        text-align: center;
    }
    
    .cgm-simulation-actions {
        flex-direction: column;
        gap: 12px;
    }
    
    .cgm-action-btn {
        width: 100%;
        justify-content: center;
    }
    
    .cgm-modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .cgm-modal-header {
        padding: 16px;
    }
    
    .cgm-modal-body {
        padding: 16px;
    }
    
    .cgm-modal-actions {
        flex-direction: row !important;
        gap: 8px !important;
        justify-content: space-between !important;
    }
    
    .cgm-modal-actions .cgm-btn {
        flex: 1 !important;
        min-width: auto !important;
    }
    
    .cgm-rating-slider-container {
        padding: 16px !important;
    }
    
    .cgm-rating-comment {
        font-size: 16px !important; /* Previne zoom no iOS */
    }
}

@media (max-width: 480px) {
    .cgm-simulator-info {
        justify-content: center;
    }
    
    .cgm-info-badge {
        font-size: 11px;
        padding: 4px 8px;
    }
    
    .cgm-results-table-container {
        margin: 0 -8px;
    }
    
    .cgm-results-table th,
    .cgm-results-table td {
        padding: 8px 6px;
    }
    
    .cgm-provider-badge {
        font-size: 10px;
        padding: 2px 6px;
    }
    
    .cgm-latency-badge {
        font-size: 11px;
        padding: 3px 6px;
        min-width: 40px;
    }
    
    .cgm-position-badge {
        width: 24px;
        height: 24px;
        font-size: 11px;
    }

    /* Botões de ação: ocupar a largura total no mobile */
    .cgm-simulation-actions .cgm-action-btn { width: 100%; }
    .cgm-simulation-actions { gap: 10px; }
}

/* ===============================================
   ANIMAÇÕES E TRANSIÇÕES
   =============================================== */

.cgm-simulation-results {
    animation: fadeInUp 0.5s ease-out;
}

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

.cgm-results-table tbody tr {
    transition: background-color 0.2s ease;
}

.cgm-results-table tbody tr:hover {
    background: rgba(255,255,255,0.05);
}

/* ===============================================
   ESTADOS DE LOADING E ERRO
   =============================================== */

.cgm-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    font-size: 16px;
    opacity: 0.8;
}

.cgm-error {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    color: #ef4444;
    font-weight: 500;
}

.cgm-no-results {
    text-align: center;
    padding: 40px;
    opacity: 0.8;
    font-size: 15px;
}