/* LoopCrush shared styles */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0b0a12;
  --bg-soft: #12101c;
  --bg-card: #16141f;
  --text: #f4f2ff;
  --muted: #a9a3c4;
  --accent: #b794f6;
  --accent-2: #8b5cf6;
  --accent-soft: rgba(183, 148, 246, 0.18);
  --glow: rgba(167, 139, 250, 0.45);
  --border: rgba(183, 148, 246, 0.22);
  --danger: #f472b6;
  --success: #86efac;
}

html {
  height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(ellipse 80% 60% at 70% 30%, rgba(124, 58, 237, 0.16), transparent 55%),
    radial-gradient(ellipse 50% 40% at 15% 85%, rgba(91, 33, 182, 0.1), transparent 50%),
    var(--bg);
  color: var(--text);
  line-height: 1.5;
}

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

/* ---- Nav ---- */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(183, 148, 246, 0.12);
  background: rgba(11, 10, 18, 0.7);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.nav-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--glow);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  height: 2.65rem;
  padding: 0 1.2rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  font-family: inherit;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  background: linear-gradient(135deg, #a78bfa, #8b5cf6);
  color: #0b0a12;
  box-shadow: 0 0 20px rgba(167, 139, 250, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 0 28px rgba(167, 139, 250, 0.45);
}

.btn-ghost {
  background: var(--accent-soft);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: rgba(183, 148, 246, 0.28);
}

.btn-crush {
  background: rgba(244, 114, 182, 0.15);
  color: #f9a8d4;
  border: 1px solid rgba(244, 114, 182, 0.35);
}

.btn-crush.active,
.btn-crush:hover {
  background: rgba(244, 114, 182, 0.3);
  color: #fecdd3;
  box-shadow: 0 0 18px rgba(244, 114, 182, 0.25);
}

.btn-sm {
  height: 2.15rem;
  padding: 0 0.9rem;
  font-size: 0.8rem;
}

.btn-block {
  width: 100%;
}

/* ---- Auth pages ---- */
.auth-wrap {
  min-height: calc(100dvh - 60px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
}

.auth-card {
  width: min(100%, 400px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  padding: 2rem 1.75rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.auth-card h1 {
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
}

.auth-card .sub {
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 1.5rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.4rem;
  letter-spacing: 0.02em;
}

.form-group input {
  width: 100%;
  height: 2.75rem;
  padding: 0 0.95rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(183, 148, 246, 0.2);
  background: rgba(11, 10, 18, 0.6);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.15);
}

.form-group input::placeholder {
  color: rgba(169, 163, 196, 0.5);
}

.auth-footer {
  margin-top: 1.25rem;
  text-align: center;
  font-size: 0.88rem;
  color: var(--muted);
}

.auth-footer a {
  color: var(--accent);
  font-weight: 600;
}

.auth-footer a:hover {
  text-decoration: underline;
}

/* ---- Feed layout ---- */
.feed-layout {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1.75rem;
}

.sidebar {
  position: sticky;
  top: 5rem;
  align-self: start;
}

.sidebar-section {
  margin-bottom: 1.5rem;
}

.sidebar-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.65rem;
}

.side-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  border-radius: 0.65rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
}

.side-link:hover,
.side-link.active {
  background: var(--accent-soft);
  color: var(--text);
}

.main-feed h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

/* Loop cards */
.loops-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.15rem;
}

.loop-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 1.1rem;
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.loop-card:hover {
  border-color: rgba(183, 148, 246, 0.4);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

.loop-thumb {
  position: relative;
  aspect-ratio: 9 / 14;
  background: #1a1726;
  overflow: hidden;
}

.loop-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.loop-length {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: rgba(11, 10, 18, 0.75);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.loop-length.short { color: #86efac; }
.loop-length.medium { color: #c4b5fd; }
.loop-length.long { color: #f9a8d4; }

.loop-body {
  padding: 0.9rem 1rem 1rem;
}

.loop-model {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.loop-model-name {
  font-weight: 700;
  font-size: 0.95rem;
}

.loop-model-tag {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.1rem;
}

.loop-actions {
  display: flex;
  gap: 0.45rem;
  margin-top: 0.75rem;
}

/* Empty / filters */
.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1.15rem;
}

.pill {
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--accent-soft);
  border: 1px solid transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
}

.pill:hover,
.pill.active {
  color: var(--text);
  border-color: var(--border);
  background: rgba(183, 148, 246, 0.25);
}

/* User chip in nav */
.user-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.7rem 0.3rem 0.35rem;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid var(--border);
  font-size: 0.82rem;
  font-weight: 600;
}

.user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a78bfa, #7c3aed);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: #0b0a12;
}

/* Crushes panel */
.crush-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.crush-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem;
  border-radius: 0.75rem;
  background: rgba(183, 148, 246, 0.06);
  border: 1px solid transparent;
}

.crush-item:hover {
  border-color: var(--border);
}

.crush-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
}

.crush-item span {
  font-size: 0.85rem;
  font-weight: 600;
}

/* Responsive */
@media (max-width: 800px) {
  .feed-layout {
    grid-template-columns: 1fr;
    padding: 1rem 1rem 2.5rem;
  }
  .sidebar {
    position: static;
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    margin-bottom: 0.25rem;
  }
  .sidebar-section { margin-bottom: 0; }
  .sidebar-label { display: none; }
  .side-link {
    white-space: nowrap;
    padding: 0.45rem 0.8rem;
    font-size: 0.82rem;
  }
  .loops-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.75rem;
  }
}

/* ---- Main feed: one row per model ---- */
.model-row {
  margin-bottom: 2rem;
}

.model-row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}

.model-row-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.model-row-title img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
}

.model-row-title h3 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.model-row-title .tag {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
}

.model-row .loops-grid {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 700px) {
  .model-row .loops-grid {
    grid-template-columns: 1fr;
  }
}

/* Model profile page */
.model-hero {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 1.1rem;
}

.model-hero img {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  box-shadow: 0 0 24px rgba(167, 139, 250, 0.25);
}

.model-hero h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.model-hero .tagline {
  color: var(--muted);
  font-size: 0.95rem;
  margin-top: 0.2rem;
}

.model-hero .meta {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.45rem;
}

.lock-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.9rem 1.1rem;
  margin-bottom: 1.25rem;
  border-radius: 0.9rem;
  background: rgba(244, 114, 182, 0.1);
  border: 1px solid rgba(244, 114, 182, 0.28);
  font-size: 0.9rem;
  color: #f9a8d4;
}

.lock-banner strong { color: #fecdd3; }
