/* Curruscos Clan — Sistema visual inspirado en la estética Apple (HIG) */
:root {
  color-scheme: light;
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "SF Pro", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --color-primary: #0071e3;
  --color-primary-hover: #0077ed;
  --color-primary-subtle: rgba(0, 113, 227, 0.08);
  --bg-app: #f5f5f7;
  --bg-surface: #ffffff;
  --bg-muted: rgba(120, 120, 128, 0.08);
  --text-main: #1d1d1f;
  --text-muted: #86868b;
  --text-subtle: #a1a1a6;
  --text-inverse: #ffffff;
  --border-light: rgba(0, 0, 0, 0.08);
  --border-focus: #0071e3;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-full: 9999px;
  --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.12);
  --nav-bottom-height: 70px;
  --header-height: 64px;
  --max-width-app: 720px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  background: var(--bg-app);
  color: var(--text-main);
  line-height: 1.47059;
  letter-spacing: -0.015em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-bottom: calc(var(--nav-bottom-height) + 24px);
}

button, input, select, textarea, a {
  font-family: var(--font-sans);
}

button, .btn, .button, .filter-chip, .intent, .explore-chip, .rsvp-btn, .explore-scope-tab, .recommendation-dismiss, .clearExploreFilters, .category-scroll a, .nav-tab {
  color: inherit;
  pointer-events: auto !important;
  cursor: pointer !important;
}

a {
  color: inherit;
  text-decoration: none;
}

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(0, 113, 227, 0.35);
  outline-offset: 2px;
}

.top-header {
  position: sticky;
  top: 0;
  height: var(--header-height);
  background: rgba(245, 245, 247, 0.78);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(20px, calc((100vw - 1050px) / 2));
  z-index: 90;
}

.app-brand {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 3px;
  color: var(--text-main);
}

.app-brand::after {
  content: "";
  width: 6px;
  height: 6px;
  margin: 8px 0 0 2px;
  border-radius: 50%;
  background: var(--color-primary);
}

.header-subtitle {
  display: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.app-container {
  width: min(100% - 32px, var(--max-width-app));
  margin: 0 auto;
  padding: 32px 0 28px;
}

.feed-intro {
  margin: 0 0 24px;
}

.eyebrow {
  color: var(--color-primary);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.feed-intro h1 {
  margin: 8px 0 8px;
  font-size: clamp(2.2rem, 7vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
  font-weight: 700;
  color: var(--text-main);
}

.feed-intro p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.98rem;
  line-height: 1.48;
  max-width: 500px;
}

.feed-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 28px 0 14px;
}

.feed-toolbar h2 {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}

.feed-toolbar p {
  margin: 3px 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* iOS Segmented Control aesthetic for filter chips */
.filter-row {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  padding: 4px;
  border-radius: var(--radius-full);
  background: rgba(120, 120, 128, 0.12);
  border: 1px solid rgba(0, 0, 0, 0.04);
  scrollbar-width: none;
  margin-bottom: 16px;
}

.filter-row::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  flex: none;
  padding: 7px 16px;
  border: none;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s cubic-bezier(0.25, 1, 0.5, 1), color 0.2s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.2s cubic-bezier(0.25, 1, 0.5, 1);
}

.filter-chip:hover {
  color: var(--text-main);
}

.filter-chip.active {
  background: #ffffff;
  color: var(--text-main);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12), 0 0 1px rgba(0, 0, 0, 0.08);
  font-weight: 600;
}

.feed-list {
  display: grid;
  gap: 16px;
}

/* Apple squircle cards with subtle glass elevation */
.event-card {
  overflow: hidden;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.25s cubic-bezier(0.25, 1, 0.5, 1), border-color 0.25s cubic-bezier(0.25, 1, 0.5, 1);
}

.event-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: rgba(0, 0, 0, 0.12);
}

.event-card-media {
  height: 155px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  padding: 18px;
  background: linear-gradient(135deg, #1d1d1f 0%, #3a3a3c 100%);
}

.event-card-media[data-category="deporte"] {
  background: linear-gradient(135deg, #1c3b2b 0%, #2e6f4e 100%);
}

.event-card-media[data-category="ocio"] {
  background: linear-gradient(135deg, #2b2347 0%, #5d4d8c 100%);
}

.event-card-media[data-category="cultura"] {
  background: linear-gradient(135deg, #422419 0%, #8c4e36 100%);
}

.event-card-media[data-category="comida"] {
  background: linear-gradient(135deg, #421d23 0%, #8c3b47 100%);
}

.event-card-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.35) 0%, transparent 70%);
  pointer-events: none;
}

.event-card-symbol {
  position: relative;
  z-index: 1;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: grid;
  place-items: center;
  color: #ffffff;
  font-size: 1.25rem;
}

.event-card-body {
  padding: 18px 20px 16px;
  display: grid;
  gap: 10px;
}

.event-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.badge-subtle {
  background: rgba(120, 120, 128, 0.12);
  color: var(--text-muted);
}

.badge-joined {
  background: rgba(52, 199, 89, 0.14);
  color: #248a3d;
}

.event-date-row {
  color: var(--color-primary);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.event-card-title {
  margin: 0;
  font-size: 1.22rem;
  line-height: 1.25;
  letter-spacing: -0.03em;
  font-weight: 700;
  color: var(--text-main);
}

.event-description {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.event-card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 500;
}

.event-card-footer {
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.event-capacity {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 500;
}

/* Apple pill button styling */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 9px 18px;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s cubic-bezier(0.25, 1, 0.5, 1), transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn:active:not(:disabled) {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--color-primary);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 113, 227, 0.22);
}

.btn-primary:hover:not(:disabled) {
  background: var(--color-primary-hover);
  box-shadow: 0 4px 14px rgba(0, 113, 227, 0.32);
}

.btn-secondary {
  background: rgba(120, 120, 128, 0.08);
  color: var(--text-main);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(120, 120, 128, 0.15);
  border-color: rgba(0, 0, 0, 0.1);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

#auth-header-action .btn {
  min-height: 36px;
  padding: 7px 15px;
  font-size: 0.8rem;
}

.feed-state {
  padding: 42px 24px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  text-align: center;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.feed-state h2 {
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
  font-weight: 700;
}

.feed-state p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0 auto;
  max-width: 380px;
}

.feed-state .btn {
  margin-top: 18px;
}

#toast-container {
  position: fixed;
  top: calc(var(--header-height) + 14px);
  left: 16px;
  right: 16px;
  max-width: 420px;
  margin: 0 auto;
  z-index: 999;
  pointer-events: none;
}

.toast {
  padding: 13px 18px;
  border-radius: 16px;
  background: rgba(29, 29, 31, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: #ffffff;
  box-shadow: var(--shadow-lg);
  margin-bottom: 8px;
  font-size: 0.88rem;
  font-weight: 500;
  animation: toast-in 0.22s cubic-bezier(0.25, 1, 0.5, 1);
  pointer-events: auto;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-bottom-height);
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(245, 245, 247, 0.82);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: center;
  align-items: stretch;
  z-index: 100;
}

.nav-tab {
  width: min(25%, 150px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.18s ease;
}

.nav-tab:hover {
  color: var(--text-main);
}

.nav-tab.active {
  color: var(--color-primary);
  font-weight: 600;
}

.nav-tab svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 1.8;
}

.nav-tab.active span {
  font-weight: 600;
}

.feed-footer-note {
  margin: 22px 0 0;
  color: var(--text-subtle);
  font-size: 0.75rem;
  text-align: center;
}

@media(min-width: 768px) {
  .app-container {
    padding-top: 44px;
  }
  .feed-intro {
    margin-bottom: 32px;
  }
  .event-card-media {
    height: 180px;
  }
  .event-card-body {
    padding: 22px 24px 18px;
  }
  .event-card-title {
    font-size: 1.32rem;
  }
  .header-subtitle {
    display: block;
    margin-left: auto;
    margin-right: 20px;
  }
  .top-header {
    gap: 16px;
  }
}

@media(prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Public event cover images */
.event-card-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.event-card-media[data-has-cover="true"]::after {
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.05) 75%);
}
