/* css/servers.css */

/* 1. CONFIGURACIÓN GLOBAL Y VARIABLES (Traídas del PHP original) */
:root {
    --primary: #FF073A; /* El rojo neón original */
    --bg-glass: rgba(10, 10, 10, 0.9); /* Fondo semitransparente */
    --border: rgba(255, 255, 255, 0.1);
    --text-main: #ffffff;
    --text-dim: #888;
    --success: #00ff9d;
    --warning: #ffcc00;
    --discord: #5865F2;
}

/* Ocultar scrollbar general como en el original */
html::-webkit-scrollbar { display: none; }
html { -ms-overflow-style: none; scrollbar-width: none; }

.servers-page-wrapper {
    background: transparent;
    font-family: 'JetBrains Mono', monospace;
    color: white;
    width: 100%;
    min-height: 100vh;
    padding-bottom: 120px;
}

#network-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    width: 100%;
    align-items: start;
}

/* 2. TARJETAS (Efecto Glass + Blur) */
.tracker-card {
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    overflow: hidden;
    backdrop-filter: blur(10px); /* Efecto vidrio del original */
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.tracker-card:hover { 
    transform: translateY(-5px);
    border-color: rgba(255, 7, 58, 0.5); /* Borde rojo neón al pasar mouse */
    box-shadow: 0 0 20px rgba(255, 7, 58, 0.15); /* Resplandor rojo */
}

/* 3. HEADER Y MAPA */
.card-header { 
    height: 140px;
    position: relative; 
    background-color: #111; 
    /* Mantenemos tu corrección de imagen para que no se repita */
    background-size: cover !important; 
    background-position: center !important;
    background-repeat: no-repeat !important;
    
    display: flex; 
    flex-direction: column; 
    justify-content: flex-end; 
    padding: 15px; 
    border-bottom: none;
    transition: background-image 0.5s ease-in-out;
}

/* Gradiente del header original (más suave hacia arriba) */
.card-header::after { 
    content: ''; 
    position: absolute; 
    inset: 0; 
    background: linear-gradient(to top, var(--bg-glass), transparent 70%);
    z-index: 1;
}

.header-content { 
    position: relative; 
    z-index: 2; 
    display: flex; 
    justify-content: space-between; 
    align-items: flex-end; 
}

/* Icono flotante con efecto glass */
.game-icon-overlay { 
    position: absolute; 
    top: 15px; 
    right: 15px; 
    width: 45px; 
    height: 45px; 
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(8px);
    border-radius: 10px; 
    border: 1px solid rgba(255, 255, 255, 0.1); 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    z-index: 3; 
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}
.game-icon-overlay img { width: 80%; height: 80%; object-fit: contain; }

.server-title { 
    font-size: 0.85rem; 
    font-weight: 800; 
    text-shadow: 0 2px 4px rgba(0,0,0,0.8); 
    white-space: normal; 
    max-width: 80%;
}

/* 4. ESTADO Y PUNTOS DE LUZ */
.status-badge { 
    font-size: 0.65rem; 
    background: rgba(0,0,0,0.7); 
    padding: 4px 8px; 
    border-radius: 4px; 
    display: flex; 
    align-items: center; 
    gap: 5px; 
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; }

.dot-online { 
    background: var(--success); 
    /* El efecto neón fuerte del original */
    box-shadow: 0 0 10px var(--success), 0 0 20px rgba(0, 255, 157, 0.2); 
    animation: pulse 2s infinite; 
}
.dot-offline { background: #555; }

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

/* 5. CUERPO Y ESTADÍSTICAS */
.card-body { padding: 20px; flex: 1; display: flex; flex-direction: column; }

.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.stats-grid.ts3-mode, .stats-grid.discord-mode { display: block; }

.stat-box { 
    background: rgba(255,255,255,0.03); /* Transparencia sutil original */
    padding: 8px; 
    border-radius: 6px; 
    border: 1px solid var(--border); 
}
.stat-label { 
    font-size: 0.6rem; 
    color: var(--text-dim); 
    text-transform: uppercase; 
    margin-bottom: 2px; 
}
.stat-value { font-size: 1.1rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-ping { color: var(--primary); }

.stat-address-box { 
    margin-bottom: 15px;
    border-color: rgba(255, 0, 60, 0.15);
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.03), transparent);
    text-align: center;
    padding: 10px;
    border-radius: 8px;
    border-width: 1px;
    border-style: solid;
}
.stat-address-value { font-size: 0.75rem; color: var(--text-main); opacity: 0.9; letter-spacing: 0.5px; font-weight: 600; }

/* 6. LISTA DE JUGADORES Y ACORDEÓN */
.players-toggle-header { 
    cursor: pointer; 
    padding: 5px 0; 
    user-select: none; 
    transition: opacity 0.2s;
}
.toggle-info-row { display: flex; justify-content: space-between; font-size: 0.65rem; color: #888; margin-bottom: 5px; align-items: center; }
.toggle-icon { margin-left: 5px; transition: transform 0.3s ease; color: var(--primary); font-size: 1rem; vertical-align: middle; }
.players-toggle-header.active .toggle-icon { transform: rotate(180deg); }

.capacity-bar-bg { height: 4px; background: rgba(255,255,255,0.1); border-radius: 2px; overflow: hidden; margin-bottom: 5px; }
.capacity-fill { height: 100%; background: var(--primary); width: 0%; transition: width 0.5s ease; }

.players-accordion { 
    max-height: 0; 
    overflow: hidden; 
    transition: max-height 0.4s cubic-bezier(0, 1, 0, 1); 
    margin-bottom: 15px; 
}
.players-accordion.open { 
    max-height: 200px; 
    transition: max-height 0.4s ease-in-out; 
}

.players-container { 
    height: 130px; 
    overflow-y: auto; 
    background: rgba(0,0,0,0.2); 
    border-radius: 4px; 
    margin-top: 5px; 
}
.players-container::-webkit-scrollbar { width: 3px; }
.players-container::-webkit-scrollbar-thumb { background: var(--primary); }

.player-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; border-bottom: 1px solid rgba(255,255,255,0.03); font-size: 0.75rem; gap: 8px; }
.player-name { color: #ccc; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-score { color: var(--primary); font-weight: 700; min-width: 40px; text-align: right; }

/* Estilos específicos TS3 */
.player-channel { font-size: 0.62rem; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-style: italic; opacity: 0.9; display: flex; align-items: center; gap: 3px; }
.ch-parent { color: var(--primary); font-weight: 700; flex-shrink: 1; overflow: hidden; text-overflow: ellipsis; }
.ch-child { color: var(--warning); font-weight: 700; flex-shrink: 1; overflow: hidden; text-overflow: ellipsis; }
.ch-sep { color: #555; font-style: normal; font-size: 0.5rem; flex-shrink: 0; }
.bot-tag { color: #555; font-size: 0.6rem; margin-right: 5px; vertical-align: middle; }

/* 7. BOTONES */
.actions-row { display: flex; gap: 8px; margin-top: auto; }

.btn-connect {
    flex: 1; 
    height: 40px; 
    background: var(--primary); 
    color: white; 
    text-decoration: none; 
    display: flex; align-items: center; justify-content: center; gap: 8px; 
    font-weight: 700; 
    border-radius: 4px; 
    font-size: 0.75rem; 
    text-transform: uppercase; 
    transition: all 0.2s ease; 
    border: none; 
    cursor: pointer;
    /* Glow effect original */
    box-shadow: 0 0 10px rgba(255, 7, 58, 0.2);
}
.btn-connect:hover { 
    filter: brightness(1.2); 
    box-shadow: 0 0 20px rgba(255, 7, 58, 0.5); 
}
.btn-connect.btn-discord { background: var(--discord); }

.btn-copy-ip { 
    width: 45px; height: 40px; 
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1); 
    backdrop-filter: blur(12px); 
    color: rgba(255, 255, 255, 0.7); 
    display: flex; align-items: center; justify-content: center; 
    border-radius: 4px; 
    cursor: pointer; 
    transition: all 0.3s ease; 
    position: relative; 
    overflow: hidden;
}
.btn-copy-ip:hover { 
    background: rgba(255, 255, 255, 0.08); 
    border-color: rgba(255, 255, 255, 0.25); 
    color: #fff; 
}
.btn-copy-ip.copied { color: var(--success); border-color: var(--success); }