/* CSS Variables & Global Reset */
:root {
  --bg-primary: #0a0c10;
  --bg-secondary: #12161f;
  --bg-card: rgba(22, 27, 34, 0.75);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(168, 85, 247, 0.4);
  --text-main: #f0f6fc;
  --text-muted: #94a3b8;
  --primary-accent: #a855f7;
  --primary-gradient: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
  --secondary-gradient: linear-gradient(135deg, #3b82f6 0%, #2dd4bf 100%);
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  --font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
  background-image: 
    radial-gradient(at 0% 0%, rgba(168, 85, 247, 0.12) 0px, transparent 45%),
    radial-gradient(at 100% 100%, rgba(236, 72, 153, 0.1) 0px, transparent 45%);
  background-attachment: fixed;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* 18+ Age Modal Overlay */
.age-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 10, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.age-modal-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.age-modal-card {
  background: var(--bg-secondary);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-lg);
  max-width: 480px;
  width: 100%;
  padding: 2.25rem 1.75rem;
  text-align: center;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 40px rgba(168, 85, 247, 0.2);
  animation: slideUp 0.35s ease-out;
}

@keyframes slideUp {
  from {
    transform: translateY(24px) scale(0.97);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.age-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(239, 68, 68, 0.16);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1.25rem;
}

.age-modal-card h2 {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.age-modal-card p {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

.age-terms {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1.5rem;
  text-align: left;
}

.custom-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.custom-checkbox input {
  display: none;
}

.custom-checkbox .checkmark {
  width: 22px;
  height: 22px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 6px;
  display: inline-block;
  flex-shrink: 0;
  position: relative;
  transition: var(--transition);
  margin-top: 2px;
}

.custom-checkbox input:checked + .checkmark {
  background: var(--primary-accent);
  border-color: var(--primary-accent);
}

.custom-checkbox input:checked + .checkmark::after {
  content: '\f00c';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 12px;
  color: #fff;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.custom-checkbox a {
  color: #c084fc;
  text-decoration: underline;
}

.age-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.age-disclaimer {
  font-size: 0.75rem;
  color: #64748b;
  margin-bottom: 0 !important;
}

/* Buttons (Touch optimized: min 48px height) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  outline: none;
  transition: var(--transition);
  font-family: inherit;
  text-decoration: none;
  touch-action: manipulation;
}

.btn-primary {
  background: var(--primary-gradient);
  color: #fff;
  box-shadow: 0 4px 15px rgba(168, 85, 247, 0.35);
}

.btn-primary:active:not(:disabled) {
  transform: scale(0.98);
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.btn-connect {
  width: 100%;
  min-height: 44px;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--primary-gradient);
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: 0.75rem;
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.25);
}

.btn-connect:active {
  transform: scale(0.97);
}

.btn-connect.requested {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
  box-shadow: none;
}

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 12, 16, 0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-color);
  padding-top: env(safe-area-inset-top, 0px);
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
}

.logo i {
  color: var(--primary-accent);
  font-size: 1.3rem;
}

.logo span strong {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-search {
  position: relative;
  flex: 1;
  max-width: 440px;
}

.nav-search i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.nav-search input {
  width: 100%;
  height: 42px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 0.6rem 1rem 0.6rem 2.6rem;
  border-radius: 999px;
  color: #fff;
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
}

.nav-search input:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--primary-accent);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.2);
}

.mobile-search-bar {
  padding: 0 1.25rem 0.75rem;
}

.mobile-input-wrap {
  position: relative;
  width: 100%;
}

.mobile-input-wrap i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.mobile-input-wrap input {
  width: 100%;
  height: 42px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 0.5rem 1rem 0.5rem 2.5rem;
  border-radius: 999px;
  color: #fff;
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
}

.mobile-input-wrap input:focus {
  border-color: var(--primary-accent);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-icon-btn {
  position: relative;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  min-width: 44px;
  height: 44px;
  border-radius: 999px;
  padding: 0 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  transition: var(--transition);
  touch-action: manipulation;
}

.nav-icon-btn .badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--primary-accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.online-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--success);
  box-shadow: 0 0 8px var(--success);
}

/* Hero Section */
.hero-section {
  text-align: center;
  padding: 2.5rem 1.25rem 1.5rem;
  max-width: 760px;
  margin: 0 auto;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(168, 85, 247, 0.12);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.25);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.hero-section h1 {
  font-size: 2.35rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.hero-section p {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 580px;
  margin: 0 auto;
}

/* Main Container */
.main-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1rem 1.25rem 6rem;
}

/* Filter Bar (AMP / Mobile Horizontal Scroll) */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.filter-tabs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  padding-bottom: 6px;
  width: 100%;
  max-width: 100%;
}

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

.tab-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  min-height: 42px;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  scroll-snap-align: start;
  transition: var(--transition);
  font-family: inherit;
  touch-action: manipulation;
}

.tab-btn.active {
  background: var(--primary-accent);
  border-color: var(--primary-accent);
  color: #fff;
}

.sort-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.sort-box select {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: #fff;
  height: 38px;
  padding: 0 0.85rem;
  border-radius: var(--radius-sm);
  outline: none;
  font-family: inherit;
  font-size: 0.88rem;
  cursor: pointer;
}

/* Profile Grid (Responsive: 1 col on mobile, 2 col on tablet, 3-4 col on desktop) */
.profile-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 600px) {
  .profile-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 960px) {
  .profile-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1200px) {
  .profile-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Profile Card - AMP Fast Rendering & 0 CLS */
.profile-card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  position: relative;
  content-visibility: auto;
  contain-intrinsic-size: 420px;
}

.card-image-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #151a23;
}

.card-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.online-status-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(10, 12, 16, 0.78);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.online-status-badge.online {
  color: #34d399;
}
.online-status-badge.offline {
  color: var(--text-muted);
}
.online-status-badge.online::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
}

.verified-icon {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(59, 130, 246, 0.9);
  color: #fff;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
}

.card-body {
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-header-info {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

.profile-name {
  font-size: 1.12rem;
  font-weight: 700;
  color: #fff;
}

.profile-age {
  font-size: 0.92rem;
  color: var(--text-muted);
  font-weight: 500;
}

.profile-location {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 0.65rem;
}

.profile-bio {
  font-size: 0.86rem;
  color: #cbd5e1;
  margin-bottom: 0.85rem;
  line-height: 1.45;
  flex-grow: 1;
}

.interest-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
}

.tag {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.74rem;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
}

/* Mobile Bottom Sticky Nav */
.mobile-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(10, 12, 16, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0.5rem 0.5rem calc(0.5rem + env(safe-area-inset-bottom, 0px));
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  color: var(--text-muted);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 600;
  font-family: inherit;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-sm);
  touch-action: manipulation;
  transition: var(--transition);
}

.bottom-nav-item i {
  font-size: 1.15rem;
}

.bottom-nav-item.active,
.bottom-nav-item:active {
  color: var(--primary-accent);
}

.bnav-icon-wrap {
  position: relative;
}

.bnav-badge {
  position: absolute;
  top: -4px;
  right: -8px;
  background: var(--primary-accent);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 4.5rem;
  right: 1.25rem;
  left: 1.25rem;
  z-index: 10001;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

@media (min-width: 600px) {
  .toast-container {
    left: auto;
    bottom: 2rem;
    right: 2rem;
    max-width: 380px;
  }
}

.toast {
  background: var(--bg-secondary);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #fff;
  padding: 0.85rem 1.15rem;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.88rem;
  animation: toastIn 0.25s ease-out forwards;
  pointer-events: auto;
}

.toast i {
  color: var(--success);
  font-size: 1.1rem;
}

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

/* Footer */
.footer {
  border-top: 1px solid var(--border-color);
  background: var(--bg-secondary);
  padding: 2.5rem 1.25rem 5rem;
}

.footer-container {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer-brand h3 {
  font-size: 1.25rem;
  margin-bottom: 0.35rem;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.85rem;
  max-width: 380px;
}

.footer-links {
  display: flex;
  gap: 1.25rem;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
}

.footer-links a:hover {
  color: var(--primary-accent);
}

.footer-bottom {
  max-width: 1280px;
  margin: 1.5rem auto 0;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  text-align: center;
  color: #64748b;
  font-size: 0.78rem;
}

/* Responsive Utilities */
@media (min-width: 769px) {
  .mobile-only {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .desktop-only {
    display: none !important;
  }
  
  .hero-section h1 {
    font-size: 1.85rem;
  }
  
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  
  .sort-box {
    justify-content: space-between;
    width: 100%;
  }
}
