/* public/css/style.css */

/* Reset y estructura */
@media (max-width: 576px) {
  main {
    min-height: auto !important;
    transform: none !important;
    position: static !important;
    margin-top: 2rem;
    padding-inline: 1rem;
  }
}

@media (min-width: 577px) {
  main.welcome-centered {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 140px); /* ajusta según altura navbar + footer */
    padding-inline: 1rem;
  }
}

html, body {
  height: 100%;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg-gradient);
  color: var(--text-main);
  margin: 0;
}

main {
  flex: 1 0 auto;
}

footer {
  flex-shrink: 0;
}

/* Login */
.login-container {
  background: var(--bg-login);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 420px;
  animation: fadeIn 0.5s ease-in-out;
}

.login-container h2 {
  text-align: center;
  margin-bottom: 1.5rem;
  font-weight: 600;
}

.login-container input {
  width: 100%;
  padding: 0.9rem;
  margin-bottom: 1.2rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.login-container input:focus {
  border-color: #0d6efd;
  outline: none;
}

.login-container button {
  width: 100%;
  padding: 0.9rem;
  background: #0d6efd;
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  transition: background 0.3s ease;
}

.login-container button:hover {
  background: #0056b3;
}

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

/* Cards de permisos */
.perm-card {
  display: block;
  padding: 0.5rem 0.75rem;
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 0.4rem;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s;
  height: 100%;
  font-size: 0.85rem;
  line-height: 1.2;
}

.perm-card:hover {
  border-color: #0d6efd;
}

.perm-card.selected {
  background-color: var(--card-hover);
  border-color: #0d6efd;
}

.perm-card strong {
  font-size: 0.9rem;
  display: block;
  margin-bottom: 0.1rem;
}

.perm-card small {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.perm-wrapper {
  padding: 0.25rem 0.5rem;
}

/* Alertas */
#alertContainer {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1050;
  width: auto;
  max-width: 600px;
  pointer-events: none;
}

#alertContainer .alert {
  pointer-events: all;
}

.fade {
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
}

.fade.show {
  opacity: 1;
}

/* Modal con fondo difuminado */
.modal-backdrop.show {
  background-color: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: all 0.3s ease-in-out;
}

body.modal-open {
  overflow: hidden;
}

/* Botón adaptable */
.btn-outline-adaptable {
  color: var(--bs-body-color);
  border-color: var(--bs-border-color);
}

.btn-outline-adaptable:hover {
  background-color: var(--bs-secondary-bg);
}

/* Separador "o" entre login clásico y social */
.login-separator {
  text-align: center;
  margin: 1rem 0;
  color: var(--text-muted);
  position: relative;
}

.login-separator::before,
.login-separator::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 45%;
  height: 1px;
  background: var(--card-border);
}

.login-separator::before { left: 0; }
.login-separator::after  { right: 0; }

/* === ESTILOS ADICIONALES PARA FORMULARIOS === */

/* Validación */
input.is-invalid {
  border-color: var(--bs-danger);
  box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25);
  outline: none;
}

.login-container input { box-sizing: border-box; }

/* Botón login con Google */
.btn-google {
  background-color: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 500;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  padding: 0.7rem 1rem;
  border-radius: 8px;
}

.btn-google:hover {
  background-color: var(--bs-secondary-bg);
  border-color: var(--bs-border-color-hover, #0d6efd);
  text-decoration: none;
}

/* Enlace a registro */
.login-register-link {
  text-align: center;
  margin-top: 2rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.login-register-link a {
  font-weight: 600;
  color: var(--bs-primary);
  text-decoration: none;
}

.login-register-link a:hover { text-decoration: underline; }

/* ==== NOTIFICACIONES ==== */

/* Badge de la campana: DOM real -> #notifBellBtn .notif-badge */
#notifBellBtn {
  line-height: 1;
  position: relative;
}

#notifBellBtn .notif-badge {
  --size: 18px;
  position: absolute;
  top: 2px;
  right: 0;
  min-width: var(--size);
  height: var(--size);
  font-size: 0.7rem;
  line-height: var(--size);
  text-align: center;
  padding: 0 5px;
  border-radius: 50px;
  background-color: #dc3545;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 0 6px rgba(0,0,0,.4);
  transform: translate(45%, -30%);
  pointer-events: none;
  z-index: 5;
}
#notifBellBtn .notif-badge.d-none { display: none !important; }
#notifBellBtn .notif-badge:empty      { display: none; }

/* Botón "marcar como leída": visible y clicable */
.notif-item .js-mark-read{
  flex: 0 0 22px;            /* reserva ancho fijo */
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--bs-border-color);
  background: transparent;
  cursor: pointer;
  margin-top: .2rem;
  position: relative;
  z-index: 1;                /* por si el <a> cubre el botón */
}

.notif-item .js-mark-read i{
  font-size: 12px;
  line-height: 1;
  opacity: .5;               /* leída: tenue */
}

.notif-item.is-unread .js-mark-read{
  background: var(--bs-primary);
  border-color: var(--bs-primary);
}
.notif-item.is-unread .js-mark-read i{
  color: var(--bs-body-bg);
  opacity: 1;                /* no leída: check blanco */
}

.notif-item .js-mark-read:hover{ filter: brightness(1.08); }

/* Botón "Marcar todas" (feedback visual) */
#markAllReadBtn:disabled { opacity: .45; cursor: not-allowed; }
#markAllReadBtn:not(:disabled){ opacity: 1; }

/* Contenedor del gráfico: limitamos altura y permitimos scroll */
.socios-chart-body {
  max-height: 240px;
  overflow-y: auto;   /* scroll vertical */
  overflow-x: auto;   /* scroll horizontal */
}

/* Wrapper del canvas: fuerza un ancho mínimo mayor que la card */
.socios-chart-wrapper {
  min-width: 1200px;  /* ajusta si quieres más/menos ancho */
}

/* Ocultar la cabecera (ES-VC, ES-AN, etc.) en los tooltips del GeoChart */
.google-visualization-tooltip-item-list
  .google-visualization-tooltip-item:first-child {
  display: none !important;
}

#spain-map-wrapper {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;           /* centra el mapa en la card */
}

#spain-map {
  width: 100%;
  height: 420px;            /* un poco menos alto que antes */
}

/* Tooltip claro y oscuro */
.google-visualization-tooltip {
  border-radius: 6px !important;
  padding: 6px 8px !important;
  border: 1px solid rgba(0,0,0,0.15) !important;
}

/* Modo oscuro */
[data-bs-theme="dark"] .google-visualization-tooltip {
  background: #2e2e2e !important;
  color: #fff !important;
  border-color: rgba(255,255,255,0.2) !important;
}



