:root {
    --bg: #0f172a;
    --card-bg: #1e293b;
    --text: #f8fafc;
    --primary: #3b82f6;
    --whatsapp: #25d366;
    --telegram: #0088cc;
    --discord: #5865f2;
    --accent: #10b981;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

/* Header y Hero */
header {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    padding: 2rem 5%;
    border-bottom: 1px solid #334155;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
    letter-spacing: 1px;
}

.hero {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

.search-bar {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.search-bar input {
    width: 100%;
    padding: 12px 20px 12px 45px;
    border-radius: 50px;
    border: none;
    background: var(--card-bg);
    color: white;
    font-size: 1.1rem;
}

.search-bar .material-icons {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

/* Layout Principal */
main {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
    padding: 2rem 5%;
}

.filtros h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: #94a3b8;
}

.botones-plataforma {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filtro-btn {
    padding: 10px;
    border: none;
    background: var(--card-bg);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    transition: 0.3s;
}

.filtro-btn:hover, .filtro-btn.active {
    background: var(--primary);
}

/* Grid de Grupos */
.grid-grupos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* --- PUNTO 1: ESTÉTICA DE LAS CARDS --- */
.card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    border-top: 5px solid #64748b; /* Color base */
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card:hover {
    transform: translateY(-5px);
}

/* Colores específicos por plataforma */
.card.wa { 
    border-top-color: var(--whatsapp); 
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.1);
}
.card.wa .btn-unirse { background: var(--whatsapp); }

.card.tg { 
    border-top-color: var(--telegram); 
    box-shadow: 0 4px 15px rgba(0, 136, 204, 0.1);
}
.card.tg .btn-unirse { background: var(--telegram); }

.card.dc { 
    border-top-color: var(--discord); 
    box-shadow: 0 4px 15px rgba(88, 101, 242, 0.1);
}
.card.dc .btn-unirse { background: var(--discord); }

.card h4 { margin-bottom: 0.5rem; color: var(--text); }
.card p { font-size: 0.9rem; color: #94a3b8; margin-bottom: 1rem; }

.btn-unirse {
    display: inline-block;
    width: 100%;
    text-align: center;
    padding: 10px;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    transition: filter 0.2s;
}

.btn-unirse:hover {
    filter: brightness(1.1);
}

/* --- FIN PUNTO 1 --- */

/* Modales y Formularios */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
}

.modal-content {
    background: #1e293b;
    margin: 5% auto;
    padding: 20px;
    width: 90%;
    max-width: 500px;
    border-radius: 12px;
    max-height: 85vh; 
    overflow-y: auto; 
    position: relative;
}

.check-legal {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
    font-size: 0.85rem;
}

form label { display: block; margin-top: 15px; font-size: 0.9rem; }
form input, form select, form textarea {
    width: 100%;
    padding: 10px;
    margin-top: 5px;
    background: #0f172a;
    border: 1px solid #334155;
    color: white;
    border-radius: 5px;
}

.btn-enviar {
    width: 100%;
    padding: 15px;
    margin-top: 20px;
    margin-bottom: 20px;
    background: var(--accent);
    border: none;
    color: white;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
}

footer {
    text-align: center;
    padding: 3rem;
    border-top: 1px solid #334155;
    margin-top: 4rem;
    color: #64748b;
}

/* Responsive */
@media (max-width: 768px) {
    main { grid-template-columns: 1fr; }
    .hero h1 { font-size: 1.8rem; }
}
.search-bar input:focus {
    outline: none;
    background: #2d3748; /* Un poco más claro al escribir */
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.4); /* Glow azul */
    transition: all 0.3s ease;
}
/* Cabecera de la Card */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.categoria-tag {
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
    color: #cbd5e1;
    text-transform: uppercase;
}

.platform-icon {
    font-size: 20px !important;
    opacity: 0.8;
}

.pais-texto {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--primary) !important;
    font-weight: bold;
}

.desc-texto {
    height: 45px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-top: 10px !important;
}
/* Ajuste específico para que los iconos se vean más limpios */
.platform-icon {
    font-family: 'Material Icons'; /* Asegura que cargue la fuente de iconos */
    font-size: 22px !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Si el icono 'whatsapp' no cargara por versión, usamos un respaldo redondo */
.card.wa .platform-icon {
    border-radius: 50%;
}
/* --- AJUSTES PARA LOGO DE WHATSAPP (IMAGEN) --- */

/* Contenedor para alinear icono/imagen perfectamente */
/* El contenedor también debe ser estricto */
.icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    overflow: hidden; /* Corta cualquier cosa que intente salirse */
}

/* Estilo para la imagen del logo */
/* Esto obligará a la imagen a ser pequeñita, pase lo que pase */
.platform-logo-img {
    width: 22px !important;
    height: 22px !important;
    max-width: 22px !important;
    max-height: 22px !important;
    object-fit: contain;
    display: block;
}
.footer-links {
    margin: 15px 0;
}

.footer-links a {
    color: #94a3b8;
    text-decoration: none;
    margin: 0 10px;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--primary);
}

/* Alineación de los iconos de Material Icons existentes */
.platform-icon {
    font-size: 22px !important; /* Mismo tamaño que la imagen */
    color: #cbd5e1; /* Color gris suave por defecto */
}
