/* ================================
   📱 Radar Responsive Styles
   Archivo: radar-responsive.css
   ================================ */

/* Base fluid adjustments */
#nomadsflow-radar-full,
#radar-full-header,
#radar-full-menu,
#eventos-filtrados-container {
  width: 100%;
  max-width: 100%;
}

img {
  max-width: 100%;
  height: auto;
}

/* Botones coherentes en todos los bloques */
.radar-menu-button,
#apply-filters,
#clear-filters,
.filtro-btn {
  font-size: 18px;
  font-weight: 600;
  padding: 12px 22px;
  border-radius: 6px;
}

/* Paneles adaptables */
.radar-panel,
.radar-panel-wide {
  max-width: 90vw;
}

/* Grids adaptables */
#eventos-resultado {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

/* ================================
   📐 Media Queries
   ================================ */

/* Tablet */
@media (max-width: 768px) {
  #radar-full-header h2 { font-size: 36px; }
  #radar-full-user-greeting { font-size: 16px; }
  #radar-full-event-message { font-size: 14px; }

  .radar-form-grid,
  .radar-checkbox-grid { grid-template-columns: 1fr; }

  .nomadsflow-filter-grid { gap: 12px; }

  .radar-panel,
  .radar-panel-wide { max-width: 100%; }
}

/* Mobile */
@media (max-width: 480px) {
  #radar-full-header h2 { font-size: 28px; }
  #radar-full-user-greeting { font-size: 15px; }
  #radar-full-event-message { font-size: 13px; }

  #radar-full-intro-text { max-width: 100%; font-size: 13px; }

  .radar-menu-container { justify-content: stretch; }
  .radar-menu-button,
  #apply-filters,
  #clear-filters,
  .filtro-btn {
    width: 100%;
    margin-bottom: 10px;
    box-sizing: border-box;
  }

  #radar-counters-top,
  #radar-counters-bottom,
  #radar-user-legend {
    gap: 10px;
    font-size: 13px;
    flex-wrap: wrap;
  }

  #eventos-resultado {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px;
  }

  #nomadsflow-radar-full { padding: 16px; border-radius: 12px; }
}

/* 📱 Menús desplegables a pantalla completa en móvil */
@media (max-width: 480px) {
  .radar-panel,
  .radar-panel-wide {
    position: fixed !important;   /* se fija a la ventana */
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    margin: 0 !important;
    border-radius: 0 !important;
    transform: none !important;
    z-index: 9999 !important;
    overflow-y: auto !important;
    background: #1a1a1a !important;
    display: none; /* oculto por defecto */
  }

  /* Cuando el panel está activo */
  .radar-panel.open {
    display: block !important;
  }

  .radar-panel-header,
  .radar-panel-body,
  .radar-panel-scroll {
    padding: 16px !important;
  }
}
/* 📱 Botón de cierre en los paneles */
.close-panel {
  background: none;
  border: none;
  color: #f3f4f6;
  font-size: 22px;
  cursor: pointer;
  position: absolute;
  top: 12px;
  right: 16px;
}

@media (max-width: 480px) {
  .close-panel {
    font-size: 26px;
  }
}

.close-panel {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: #f3f4f6;
  font-size: 22px;
  cursor: pointer;
  z-index: 10000;
}

.close-panel .emoji {
  pointer-events: none;
}

/* Forzar visibilidad de los desplegables en móvil */
@media (max-width: 480px) {
  details {
    display: block;
    width: 100%;
  }
  details[open] > .checkbox-group {
    display: flex !important;
    flex-wrap: wrap;
    gap: 12px;
    background: #262626;
    padding: 12px;
    border-radius: 12px;
  }
}


/* =========================================
   Estética mejorada para desplegables
   ========================================= */

/* Sección general */
.radar-form-section {
  margin-bottom: 20px;
}

/* Botón de apertura/cierre */
.radar-form-section button {
  width: 100%;
  text-align: left;
  padding: 12px 16px;
  font-size: 16px;
  font-weight: 600;
  background: #1f2937; /* gris oscuro elegante */
  color: #f3f4f6;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.radar-form-section button:hover {
  background: #374151; /* tono más claro al pasar el ratón */
}

/* Contenedor desplegado */
#languages-section,
#prof-interests-section,
#lifestyle-interests-section {
  margin-top: 10px;
  padding: 14px;
  background: #262626;
  border-radius: 8px;
  box-shadow: inset 0 0 6px rgba(0,0,0,0.4);
}

/* Grid de checkboxes */
.radar-checkbox-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.radar-checkbox-grid label {
  flex: 1 1 45%; /* ✅ dos columnas en cualquier tamaño */
  text-align: center;
  background: #333;
  padding: 8px 12px;
  border-radius: 6px;
  color: #f3f4f6;
  cursor: pointer;
  transition: background 0.2s ease;
}

.radar-checkbox-grid label:hover {
  background: #444;
}

.radar-checkbox-grid input[type="checkbox"] {
  margin-right: 6px;
}


/* ===============================
   Correcciones visuales del filtro de usuarios
   (sin tocar la estructura PHP)
   =============================== */

/* Título */
#nomadsflow-filters-container .filters-title {
  background: #1a1a1a;
  color: #fff;
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 20px;
}
#nomadsflow-filters-container .filters-title h2 {
  margin: 0;
  font-size: 36px;
  font-weight: 700;
  color: #f3f4f6;
}
#nomadsflow-filters-container .filters-title p {
  margin: 0;
  opacity: 0.85;
  font-size: 18px;
  color: #e5e7eb;
}

/* Grid y celdas */
#nomadsflow-filters-form.nomadsflow-filter-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}
#nomadsflow-filters-form .filter-cell {
  flex: 1 1 200px;
  min-width: 200px;
}

/* Inputs y select */
#nomadsflow-filters-form .filter-cell label {
  display: block;
  color: #e5e7eb;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}
#nomadsflow-filters-form input[type="text"],
#nomadsflow-filters-form select {
  background-color: #1f2937;
  border: 1px solid #374151;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 16px;
  color: #f3f4f6;
  width: 100%;
}

/* Desplegables (details/summary) */
#nomadsflow-filters-form .filter-cell details {
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 8px;
  overflow: hidden; /* recorta dentro, evita scroll horizontal */
}
#nomadsflow-filters-form .filter-cell summary {
  cursor: pointer;
  padding: 12px 16px;
  font-size: 16px;
  font-weight: 600;
  color: #f3f4f6;
  list-style: none;
}
#nomadsflow-filters-form .filter-cell summary::-webkit-details-marker {
  display: none;
}
#nomadsflow-filters-form .filter-cell details[open] summary {
  background: #253042;
}

/* Contenido del desplegable con scroll vertical */
#nomadsflow-filters-form .filter-cell details > .checkbox-group {
  margin-top: 0;
  background: #262626;
  border-top: 1px solid #374151;
  padding: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  max-height: 220px;         /* controla altura visible */
  overflow-y: auto;           /* scroll vertical */
  overflow-x: hidden;         /* sin scroll horizontal */
}

/* Tarjetas de checkbox: dos columnas y alturas uniformes */
#nomadsflow-filters-form .checkbox-group label {
  flex: 1 1 45%;              /* dos columnas responsivas */
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  background: #333;
  color: #f3f4f6;
  border-radius: 6px;
  padding: 10px 12px;         /* altura consistente */
  min-height: 42px;           /* uniforma la altura visual */
  cursor: pointer;
  transition: background 0.2s ease;
}
#nomadsflow-filters-form .checkbox-group label:hover {
  background: #444;
}
#nomadsflow-filters-form .checkbox-group input[type="checkbox"] {
  margin: 0;                  /* limpia márgenes */
}

/* Botones */
#nomadsflow-filters-form .filter-buttons {
  flex: 1 1 100%;
  margin-top: 16px;
  text-align: center;
}
#apply-filters {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); /* azul */
  color: #ffffff;
  border: none;
  padding: 12px 22px;
  border-radius: 6px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  margin-right: 12px;
}
#apply-filters:hover {
  filter: brightness(1.05);
}
#clear-filters {
  background: #374151;  /* gris */
  color: #f3f4f6;
  border: none;
  padding: 12px 22px;
  border-radius: 6px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
}
#clear-filters:hover {
  filter: brightness(1.05);
}

/* Resultados */
#nomadsflow-results {
  margin-top: 24px;
  max-height: 800px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  padding: 16px;
  background: #121212;
}
#nomadsflow-results p {
  color: #f3f4f6;
  font-size: 14px;
}

/* Responsive fino */
@media (max-width: 480px) {
  #nomadsflow-filters-form .checkbox-group label {
    flex: 1 1 48%;
  }
}



/* Agrupación visual en dos filas */
.nomadsflow-filter-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Fila superior: City, Country, Account Type */
.filter-row-top {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

/* Fila inferior: Languages, Lifestyle, Interests */
.filter-row-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

/* Cada celda sigue igual */
.filter-cell {
  flex: 1 1 200px;
  min-width: 200px;
}


/* Apilar Lifestyle e Interests en una sola columna */
#nomadsflow-filters-form .filter-cell details > .checkbox-group {
  display: flex;
  flex-direction: column;  /* ✅ apila verticalmente */
  gap: 10px;
  max-height: none;        /* quita límite de altura */
  overflow: visible;       /* sin scroll */
}

#nomadsflow-filters-form .checkbox-group label {
  flex: none;
  text-align: left;
}

#nomadsflow-filters-form summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 16px;
  color: #f3f4f6;
  position: relative;
  padding-right: 20px; /* espacio para la flecha */
}

#nomadsflow-filters-form summary::after {
  content: "▼";                /* flechita hacia abajo */
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: #9ca3af;
  transition: transform 0.2s ease;
}

/* Cuando el desplegable está abierto, rota la flecha */
#nomadsflow-filters-form details[open] summary::after {
  transform: translateY(-50%) rotate(180deg);
}

/* === Cabecera Radar Final (ajustes de layout y botones) === */
#radar-full-header {
  font-family: 'Inter', sans-serif;
  margin-bottom: 30px;
  text-align: left;
}

/* Fondo y overlay del header */
#radar-full-header .header-bg {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  padding: 24px;
  background-size: cover;
  background-position: center;
}
#radar-full-header .header-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: rgba(0,0,0,0.55);
}

/* Contenido superior (logo, saludo, mensaje) */
#radar-full-header .header-content {
  position: relative;
  z-index: 1;
}
#radar-full-header .header-content img {
  max-width: 60%; /* tamaño normal en escritorio */
  height: auto;
  border-radius: 12px;
  margin-bottom: 10px;
}

/* Greeting */
#radar-full-user-greeting {
  font-size: clamp(20px, 4vw, 36px);
  color: #edf2f7;
  margin-bottom: 6px;
  font-weight: 600;
  text-transform: none;
  text-shadow: 0 2px 4px rgba(0,0,0,0.4);
}
#radar-full-user-greeting span { color: #3b82f6; }

/* Event message */
#radar-full-event-message {
  font-size: clamp(16px, 3vw, 28px);
  color: #e2e8f0;
  margin-bottom: 12px;
  font-weight: 500;
  text-transform: none;
  text-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

/* Intro externa */
#radar-full-header .intro-text {
  text-align: center;
  font-size: clamp(18px, 3.5vw, 30px);
  font-weight: 600;
  color: #f7fafc;
  margin: 16px 0;
}

/* Menú externo */
#radar-full-menu {
  margin-top: 32px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

/* Contenedor de contadores (estable y centrado) */
#radar-counters-top {
  display: flex;
  justify-content: center;
  align-items: stretch; /* iguala alturas si hay iconos */
  flex-wrap: wrap;
  gap: 12px;
}

/* Botones filtrables — caja consistente en todos los estados */
.radar-filter-button {
  box-sizing: border-box;              /* evita saltos al cambiar borde */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;                            /* separación icono/texto estable */
  min-width: 140px;
  height: 44px;                        /* altura fija para evitar saltos */
  padding: 10px 18px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  border-radius: 6px;
  border: 1px solid #374151;           /* borde siempre presente */
  background: #1f2937;
  color: #f3f4f6;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
  text-align: center;
  white-space: nowrap;                 /* evita wrap desigual en móvil */
}
.radar-filter-button:hover {
  background: #374151;
}

/* Iconos internos (si los hay) para evitar desplazamientos */
.radar-filter-button .icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Estado activo — MISMA CAJA (no quitar el borde) */
.radar-filter-button.active {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #fff;
  border-color: #2563eb;               /* mantiene grosor del borde */
}

/* Botón GPS centrado */
#radar-gps-toggle {
  text-align: center;
  margin: 32px auto 40px;
}
#gps-toggle-button {
  display: inline-block;
  margin: 0 auto;
  padding: 12px 22px;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  transition: filter 0.2s ease;
}
#gps-toggle-button:hover { filter: brightness(1.05); }

/* Responsive ajustes: solo móvil */
@media (max-width: 768px) {
  #radar-full-header .header-content {
    padding: 16px;
  }

  #radar-full-user-greeting,
  #radar-full-event-message {
    font-size: 20px;
    line-height: 1.3;
    word-break: break-word;
  }

  /* Logo más grande solo en móvil */
  #radar-full-header .header-content img {
    max-width: 70%;
    margin: 0 auto 14px;
    display: block;
  }

  /* Menú más compacto en móvil */
  #radar-full-menu {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
  }

  /* Botones filtrables: ancho estable en móvil */
  #radar-counters-top {
    gap: 12px;
  }
  .radar-filter-button {
    flex: 1 1 160px;       /* crece de forma uniforme */
    max-width: 220px;      /* evita ensancharse de más */
    width: auto;           /* mantiene caja flexible sin saltos */
  }
}

@media (max-width: 480px) {
  /* Paneles: ocupar toda la pantalla con scroll interno */
  #messages-panel,
  #events-panel,
  #profile-dropdown {
    position: fixed;
    inset: 0;               /* equivale a top:0; right:0; bottom:0; left:0 */
    width: 100vw;
    height: 100vh;
    overflow-y: auto;
    background: #1a1a1a;
    z-index: 9999;
    border-radius: 0;
    padding: 16px;
  }

  /* Quitar límites internos que cortan el contenido */
  #messages-panel .chat-messages,
  #events-panel .radar-panel-scroll,
  #profile-dropdown .radar-panel-body {
    max-height: none !important;
    height: auto !important;
    overflow-y: auto;
  }
}


