/* ═══════════════════════════════════════════════════════════
   SWINGERSPHERE — SCREEN LAYOUTS
   Per-screen layout rules
═══════════════════════════════════════════════════════════ */

/* ── APP SHELL ──────────────────────────────────────────── */
#app {
  width: 100%;
  min-height: 100dvh;
  max-width: var(--max-w);
  margin: 0 auto;
  position: relative;
  background: var(--bg-void);
}

.screen {
  display: none;
  flex-direction: column;
  min-height: 100dvh;
  padding-bottom: calc(var(--navbar-h) + var(--space-4));
  overflow-x: hidden;
}

.screen.active {
  display: flex;
  animation: fade-in 0.25s var(--ease-out);
}

/* ── TOP BAR ────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-5);
  height: var(--topbar-h);
  background: rgba(6, 6, 8, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
}

.topbar-logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.logo-mark {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--copper) 0%, var(--copper-light) 100%);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: var(--weight-black);
  color: white;
  letter-spacing: -0.02em;
  box-shadow: var(--shadow-copper);
}

.logo-text {
  font-size: var(--text-md);
  font-weight: var(--weight-bold);
  background: linear-gradient(135deg, var(--white) 40%, var(--copper-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* ── SCROLL CONTAINER ───────────────────────────────────── */
.scroll-content {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4) var(--space-4) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* ── HOME SCREEN ────────────────────────────────────────── */
.daily-quote-banner {
  background: linear-gradient(135deg,
    rgba(196, 129, 58, 0.12) 0%,
    rgba(184, 115, 51, 0.06) 50%,
    rgba(196, 129, 58, 0.12) 100%);
  border: 1px solid var(--copper-border);
  border-radius: var(--radius-xl);
  padding: var(--space-5) var(--space-5);
  position: relative;
  overflow: hidden;
  animation: slide-down 0.5s var(--ease-out);
}

.daily-quote-banner::before {
  content: '"';
  position: absolute;
  top: -20px;
  left: var(--space-4);
  font-size: 8rem;
  font-weight: var(--weight-black);
  color: rgba(196,129,58,0.08);
  line-height: 1;
  font-family: Georgia, serif;
}

.quote-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--copper);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.quote-text {
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--white);
  line-height: 1.65;
  font-style: italic;
}

.quote-author {
  font-size: var(--text-xs);
  color: var(--silver-dark);
  margin-top: var(--space-3);
  font-weight: var(--weight-medium);
}

/* Home Feed */
.feed-filters {
  padding: 0;
}

.feed-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* ── DISCOVER SCREEN ────────────────────────────────────── */
#screen-discover {
  position: relative;
  overflow: hidden;
}

.discover-header {
  padding: var(--space-4) var(--space-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 2;
}

.discover-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 var(--space-4);
  position: relative;
}

.card-stack {
  width: 100%;
  max-width: 360px;
  aspect-ratio: 3/4;
  position: relative;
}

/* Stack visual hint */
.card-stack .discover-card:nth-child(2) {
  transform: scale(0.95) translateY(12px);
  z-index: 0;
}

.card-stack .discover-card:nth-child(3) {
  transform: scale(0.90) translateY(24px);
  z-index: -1;
  opacity: 0.6;
}

.card-stack .discover-card:nth-child(1) {
  z-index: 1;
}

.discover-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-6);
  padding: var(--space-6) var(--space-5);
}

.discover-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 2px solid;
  font-size: 1.5rem;
  transition: all var(--duration-base) var(--ease-spring);
  cursor: pointer;
  background: var(--bg-card);
}

.discover-action-btn.nope {
  width: 58px; height: 58px;
  border-color: rgba(255,69,58,0.4);
  color: var(--danger);
}
.discover-action-btn.nope:hover {
  background: rgba(255,69,58,0.1);
  border-color: var(--danger);
  transform: scale(1.1);
  box-shadow: 0 0 24px rgba(255,69,58,0.3);
}

.discover-action-btn.like {
  width: 72px; height: 72px;
  border-color: rgba(196,129,58,0.4);
  color: var(--copper);
}
.discover-action-btn.like:hover {
  background: var(--copper-glow);
  border-color: var(--copper);
  transform: scale(1.1);
  box-shadow: var(--shadow-copper-lg);
}

.discover-action-btn.super {
  width: 58px; height: 58px;
  border-color: rgba(10,132,255,0.4);
  color: #0a84ff;
}
.discover-action-btn.super:hover {
  background: rgba(10,132,255,0.1);
  border-color: #0a84ff;
  transform: scale(1.1);
}

/* Filter Drawer */
.filter-drawer {
  background: var(--bg-elevated);
  border-top: 1px solid var(--border-md);
  border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
  padding: var(--space-6);
  animation: slide-up var(--duration-slow) var(--ease-spring);
}

.filter-section {
  margin-bottom: var(--space-6);
}

.filter-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--silver-dark);
  margin-bottom: var(--space-3);
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* Range slider */
.range-slider {
  width: 100%;
  height: 4px;
  -webkit-appearance: none;
  background: linear-gradient(90deg, var(--copper) var(--val, 50%), var(--graphite) var(--val, 50%));
  border-radius: var(--radius-full);
  outline: none;
  cursor: pointer;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--copper);
  border: 3px solid var(--bg-void);
  box-shadow: var(--shadow-copper);
  cursor: pointer;
  transition: transform var(--duration-fast);
}

.range-slider::-webkit-slider-thumb:hover { transform: scale(1.2); }

/* ── COMMUNITY SCREEN ───────────────────────────────────── */
.community-tabs {
  display: flex;
  gap: 0;
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  padding: 3px;
  margin: var(--space-4) var(--space-5);
}

.community-tab-btn {
  flex: 1;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--silver);
  transition: all var(--duration-base);
  cursor: pointer;
  text-align: center;
}

.community-tab-btn.active {
  background: var(--bg-card);
  color: var(--white);
  box-shadow: var(--shadow-sm);
}

.rooms-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: 0 var(--space-5);
}

/* Chat View */
.chat-view {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - var(--topbar-h) - var(--navbar-h) - 60px);
}

.chat-header {
  padding: var(--space-3) var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  border-bottom: 1px solid var(--border);
  background: var(--bg-deep);
}

.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.chat-input-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  border-top: 1px solid var(--border);
  background: var(--bg-deep);
}

.chat-input {
  flex: 1;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  color: var(--white);
  transition: border-color var(--duration-base);
}

.chat-input:focus { border-color: var(--copper-border); }
.chat-input::placeholder { color: var(--silver-dark); }

/* ── EVENTS SCREEN ──────────────────────────────────────── */
.events-view-toggle {
  display: flex;
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  padding: 3px;
  width: fit-content;
}

.view-toggle-btn {
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--silver);
  transition: all var(--duration-base);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.view-toggle-btn.active {
  background: var(--bg-card);
  color: var(--white);
  box-shadow: var(--shadow-sm);
}

/* Map */
#events-map {
  height: 320px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--border);
  z-index: 1;
}

/* Leaflet dark theme overrides */
.leaflet-container {
  background: #0d0d10 !important;
  font-family: var(--font-sans) !important;
}

.leaflet-tile {
  filter: brightness(0.7) saturate(0.5);
}

.leaflet-popup-content-wrapper {
  background: var(--bg-elevated) !important;
  border: 1px solid var(--copper-border) !important;
  border-radius: var(--radius-lg) !important;
  color: var(--white) !important;
  box-shadow: var(--shadow-copper) !important;
}

.leaflet-popup-tip {
  background: var(--bg-elevated) !important;
}

.leaflet-popup-close-button {
  color: var(--silver) !important;
}

.custom-map-marker {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--copper), var(--copper-light));
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  border: 3px solid rgba(255,255,255,0.2);
  box-shadow: var(--shadow-copper);
  display: flex;
  align-items: center;
  justify-content: center;
}

.custom-map-marker-inner {
  transform: rotate(45deg);
  font-size: 1rem;
}

.radar-widget {
  background: var(--copper-glow);
  border: 1px solid var(--copper-border);
  border-radius: var(--radius-xl);
  padding: var(--space-4) var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.radar-icon {
  font-size: 2rem;
  animation: oraculo-float 2s ease-in-out infinite;
}

/* Calendar */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  padding: var(--space-4) var(--space-5);
}

.cal-day-header {
  text-align: center;
  font-size: 10px;
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--silver-dark);
  padding: var(--space-2) 0;
}

.cal-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  cursor: pointer;
  transition: all var(--duration-fast);
  position: relative;
}

.cal-day:hover { background: var(--bg-glass); }

.cal-day.today {
  background: var(--copper-glow);
  color: var(--copper-light);
  font-weight: var(--weight-bold);
}

.cal-day.has-event::after {
  content: '';
  position: absolute;
  bottom: 3px;
  width: 4px;
  height: 4px;
  background: var(--copper);
  border-radius: 50%;
}

.cal-day.other-month { color: var(--silver-dark); opacity: 0.4; }

/* ── PROFILE SCREEN ─────────────────────────────────────── */
.profile-cover {
  width: 100%;
  height: 200px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg,
    var(--copper-900) 0%,
    var(--copper-700) 40%,
    var(--bg-elevated) 100%);
}

.profile-cover-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-cover-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 40%, var(--bg-void) 100%);
}

.profile-avatar-wrap {
  position: absolute;
  bottom: -48px;
  left: var(--space-5);
}

.profile-body {
  padding: 60px var(--space-5) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.profile-identity {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.profile-name {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-1);
}

.profile-username {
  font-size: var(--text-sm);
  color: var(--silver-dark);
}

.profile-badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.profile-bio {
  font-size: var(--text-sm);
  color: var(--silver-light);
  line-height: 1.7;
}

.profile-stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--border);
}

.profile-stat {
  background: var(--bg-card);
  padding: var(--space-4);
  text-align: center;
}

.profile-stat-value {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--white);
  letter-spacing: -0.02em;
}

.profile-stat-label {
  font-size: 10px;
  color: var(--silver-dark);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 2px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.section-title {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--white);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* Passport Wall */
.passport-wall {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
}

/* Album Grid */
.album-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--border);
}

.album-item {
  aspect-ratio: 1;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  overflow: hidden;
  font-size: 1.75rem;
  transition: all var(--duration-base);
}

.album-item:hover::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(196,129,58,0.2);
}

.album-privacy-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

/* Trust score section */
.trust-section {
  background: var(--bg-card);
  border: 1px solid var(--copper-border);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-5);
  box-shadow: var(--shadow-copper);
}

.trust-breakdown {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.trust-bar-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.trust-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-xs);
  color: var(--silver);
}

/* ── LANDING PAGE ────────────────────────────────────────── */
.landing-page {
  min-height: 100dvh;
  background: var(--bg-void);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

#landing-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.landing-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100dvh;
}

.landing-nav {
  width: 100%;
  max-width: 900px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-6) var(--space-8);
}

.landing-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.landing-logo-mark {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--copper) 0%, var(--copper-light) 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: var(--weight-black);
  color: white;
  letter-spacing: -0.02em;
  box-shadow: var(--shadow-copper);
  animation: glow-pulse 3s ease-in-out infinite;
}

.landing-logo-text {
  font-size: var(--text-xl);
  font-weight: var(--weight-black);
  letter-spacing: -0.03em;
  background: linear-gradient(135deg,
    var(--white) 0%,
    var(--silver-light) 40%,
    var(--copper-light) 70%,
    var(--copper-pale) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: logo-shimmer 4s linear infinite;
}

.landing-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-8) var(--space-6);
  max-width: 700px;
}

.landing-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--copper-glow);
  border: 1px solid var(--copper-border);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--copper-light);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-8);
  animation: slide-down 0.6s var(--ease-out);
}

.landing-title {
  font-size: clamp(2.5rem, 8vw, 4rem);
  font-weight: var(--weight-black);
  letter-spacing: -0.04em;
  line-height: 1.05;
  color: var(--white);
  margin-bottom: var(--space-6);
  animation: slide-up 0.7s var(--ease-out) 0.1s both;
}

.landing-title-accent {
  background: linear-gradient(135deg, var(--copper) 0%, var(--copper-pale) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.landing-subtitle {
  font-size: var(--text-base);
  color: var(--silver);
  line-height: 1.75;
  max-width: 560px;
  margin-bottom: var(--space-10);
  animation: slide-up 0.7s var(--ease-out) 0.2s both;
}

.landing-cta-row {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
  justify-content: center;
  animation: slide-up 0.7s var(--ease-out) 0.3s both;
}

.landing-stats {
  display: flex;
  gap: var(--space-10);
  justify-content: center;
  flex-wrap: wrap;
  padding: var(--space-10) var(--space-6);
  max-width: 700px;
  width: 100%;
  animation: slide-up 0.7s var(--ease-out) 0.4s both;
}

.landing-features {
  width: 100%;
  max-width: 900px;
  padding: var(--space-8) var(--space-6) var(--space-16);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-4);
}

.feature-card {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  backdrop-filter: blur(16px);
  transition: all var(--duration-base) var(--ease-out);
}

.feature-card:hover {
  border-color: var(--copper-border);
  background: var(--copper-glow);
  transform: translateY(-4px);
  box-shadow: var(--shadow-copper);
}

.feature-icon {
  font-size: 2rem;
  margin-bottom: var(--space-4);
  display: block;
}

.feature-title {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--white);
  margin-bottom: var(--space-2);
}

.feature-desc {
  font-size: var(--text-sm);
  color: var(--silver);
  line-height: 1.6;
}

.landing-footer {
  text-align: center;
  padding: var(--space-6);
  color: var(--silver-dark);
  font-size: var(--text-xs);
  border-top: 1px solid var(--border);
  width: 100%;
}

/* ── CLUBS PRO SCREEN ───────────────────────────────────── */
.pro-dashboard {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.metric-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.metric-value {
  font-size: var(--text-2xl);
  font-weight: var(--weight-black);
  letter-spacing: -0.02em;
}

.metric-label {
  font-size: var(--text-xs);
  color: var(--silver-dark);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ── MARKETPLACE SCREEN ─────────────────────────────────── */
.marketplace-categories {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

.market-cat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  cursor: pointer;
  transition: all var(--duration-base) var(--ease-out);
}

.market-cat-card:hover {
  border-color: var(--copper-border);
  background: var(--copper-glow);
  transform: translateY(-2px);
}

.market-cat-icon { font-size: 2rem; }
.market-cat-name {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--white);
}
.market-cat-count {
  font-size: var(--text-xs);
  color: var(--silver-dark);
}

/* ── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 400px) {
  :root {
    --text-3xl: 2rem;
    --text-2xl: 1.5rem;
  }

  .landing-title { font-size: 2.5rem; }
  .landing-stats { gap: var(--space-6); }
  .landing-features { grid-template-columns: 1fr; }
}

@media (min-width: 600px) {
  .landing-nav { padding: var(--space-8) var(--space-12); }
  .card-stack { max-width: 400px; }
}
