/* Liquid Glass UI - Efecto glassmorphism fiel al CodePen */

:root {
  --lg-shadow: 0 6px 6px rgba(0, 0, 0, 0.2), 0 0 20px rgba(0, 0, 0, 0.1);
  --lg-spring: cubic-bezier(0.175, 0.885, 0.32, 2.2);
}

/* ===== BASE LIQUID GLASS SURFACE ===== */
.lg {
  --lg-radius: 1.5rem;
  --lg-blur: 8px;
  --lg-tint: rgba(255, 255, 255, 0.12);
  --lg-fg: white;

  position: relative;
  display: flex;
  overflow: hidden;

  font-weight: 600;
  color: var(--lg-fg);
  background: transparent !important;
  border: 0;
  border-radius: var(--lg-radius);
  box-shadow: var(--lg-shadow);

  transition: all 0.4s var(--lg-spring);
}

/* Las 3 capas del efecto glass */
.lg__effect,
.lg__tint,
.lg__shine {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}

/* Capa 1: Efecto de blur - ESTO ES LO IMPORTANTE */
.lg__effect {
  z-index: 0;
  overflow: hidden;
  isolation: isolate;

  /* Aplicar blur AL FONDO que se ve detrás del elemento */
  -webkit-backdrop-filter: blur(var(--lg-blur)) saturate(150%);
  backdrop-filter: blur(var(--lg-blur)) saturate(150%);

  opacity: 1;
  transition: opacity 560ms ease-out;
}

/* Capa 2: Tint - Color muy sutil sobre el blur */
.lg__tint {
  z-index: 1;
  background: var(--lg-tint);
}

/* Capa 3: Shine - Brillo en los bordes */
.lg__shine {
  z-index: 2;
  overflow: hidden;
  box-shadow: inset 2px 2px 1px 0 rgba(255, 255, 255, 0.5),
    inset -1px -1px 1px 1px rgba(255, 255, 255, 0.5);
}

/* Contenido por encima de todo */
.lg__content {
  z-index: 3;
  position: relative;
  width: 100%;
}

.lg--interactive {
  cursor: pointer;
}

/* ===== BOTÓN FLOTANTE LIQUID GLASS ===== */
.lg--button {
  padding: 2rem 1.25rem;
  --lg-radius: 2rem;
  font-size: 1.1rem;
  font-weight: 600;
  --lg-blur: 12px;
  --lg-tint: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.lg--button:hover {
  padding: 2.2rem 1.5rem;
  --lg-radius: 2.5rem;
  --lg-tint: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.4);
}

.lg--button .lg__content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.4s var(--lg-spring);
}

.lg--button:hover .lg__content {
  transform: scale(0.95);
}

/* Variantes ghost para botones grandes */
.lg--button.lg-action-btn--accept {
  --lg-tint: rgba(180, 220, 180, 0.08);
  border-color: rgba(180, 220, 180, 0.5);
  color: rgba(220, 240, 220, 0.95);
}

.lg--button.lg-action-btn--accept:hover {
  --lg-tint: rgba(180, 220, 180, 0.15);
  border-color: rgba(180, 220, 180, 0.8);
}

.lg--button.lg-action-btn--decline,
.lg--button[style*="239, 68, 68"] {
  --lg-tint: rgba(220, 180, 180, 0.08);
  border-color: rgba(220, 180, 180, 0.5);
  color: rgba(240, 210, 210, 0.95);
}

.lg--button.lg-action-btn--decline:hover {
  --lg-tint: rgba(220, 180, 180, 0.15);
  border-color: rgba(220, 180, 180, 0.8);
}

/* ===== CARD/MODAL LIQUID GLASS ===== */
.lg--card {
  padding: 1.5rem;
  --lg-radius: 1.75rem;
  --lg-fg: rgba(255, 255, 255, 0.95);
  --lg-tint: rgba(255, 255, 255, 0.08);
  --lg-blur: 16px;
}

/* ===== MODAL SPECIFIC ===== */
.lg-modal {
  width: 100%;
  max-width: 32rem;
  max-height: 90vh;
  overflow-y: auto;
}

.lg-modal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.lg-modal__title {
  font-size: 1.1rem !important;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
  color: inherit;
}

.lg-modal__close {
  appearance: none;
  border: 0;
  background: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.9);
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.15s ease;
}

.lg-modal__close:hover {
  background: rgba(255, 255, 255, 0.24);
  transform: scale(1.05);
}

/* ===== OVERLAY DEL MODAL ===== */
.lg-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;

  /* Fondo semi-transparente con blur */
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);

  opacity: 0;
  visibility: hidden;
  transition: opacity 420ms ease-in-out, visibility 420ms ease-in-out;
}

.lg-overlay[data-lg-state='open'] {
  opacity: 1;
  visibility: visible;
}

/* ===== BOTONES DE ACCIÓN GHOST ===== */
.lg-action-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.08);
  font: inherit;
  cursor: pointer;

  padding: 0.375rem 0.625rem;
  border-radius: 0.75rem;
  font-weight: 600;
  font-size: 0.875rem;

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;

  color: white;
  transition: all 0.15s ease;
  backdrop-filter: blur(4px);
}

.lg-action-btn:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.5);
}

.lg-action-btn--accept {
  border-color: rgba(180, 220, 180, 0.6);
  color: rgba(220, 240, 220, 0.95);
}

.lg-action-btn--accept:hover {
  background: rgba(180, 220, 180, 0.15);
  border-color: rgba(180, 220, 180, 0.9);
}

.lg-action-btn--decline {
  border-color: rgba(220, 180, 180, 0.6);
  color: rgba(240, 210, 210, 0.95);
}

.lg-action-btn--decline:hover {
  background: rgba(220, 180, 180, 0.15);
  border-color: rgba(220, 180, 180, 0.9);
}

/* ===== MEMBER ROW ===== */
.lg-member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1rem;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.2s ease;
}

.lg-member-row:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

/* ===== STATUS BADGE ===== */
.lg-status-badge {
  font-size: 0.6875rem;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid;
}

/* ===== FLOATING CONTAINER ===== */
.lg-floating-container {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 1rem;
  background: linear-gradient(to top, rgba(15, 18, 32, 0.45) 0%, rgba(15, 18, 32, 0.25) 60%, transparent 100%);
}

/* ===== TEXT COLORS ===== */
.lg-text {
  color: rgba(255, 255, 255, 0.95);
}

.lg-text-secondary {
  color: rgba(255, 255, 255, 0.75);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  .lg--button {
    padding: 0.6rem 1rem;
    font-size: 1rem;
  }

  .lg--button:hover {
    padding: 0.8rem 1.2rem;
  }

  .lg-modal {
    margin: 0.5rem;
    max-height: 95vh;
  }

  .lg--card {
    padding: 1.25rem;
  }

  .lg-action-btn {
    padding: 0.3rem 0.5rem;
    font-size: 0.8125rem;
  }
}

/* ===== BUTTON TEXT SIZES ===== */
.lg-button-text {
  font-size: 2rem;
}

.lg-button-countdown {
  font-size: 1rem;
}

@media (max-width: 640px) {
  .lg-button-text {
    font-size: 1.1rem;
  }

  .lg-button-countdown {
    font-size: 0.6rem;
  }
}

/* ===== FOCUS STATES ===== */
.lg:focus-visible,
.lg-action-btn:focus-visible,
.lg-modal__close:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.65);
  outline-offset: 4px;
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  .lg,
  .lg__effect,
  .lg__content,
  .lg-action-btn,
  .lg-overlay {
    transition: none;
  }
}
