/* Live Model Studio — Demo Mockup CSS */
:root {
  --bg-dark: #0a0a0f;
  --bg-card: #16161e;
  --bg-input: #1e1e2a;
  --bg-header: #111118;
  --accent: #e84393;
  --accent-hover: #fd79a8;
  --accent-dim: #c44a8a;
  --text: #e8e8f0;
  --text-muted: #8888a0;
  --text-dim: #55556a;
  --border: #2a2a3a;
  --green: #00b894;
  --red: #e74c3c;
  --gold: #f1c40f;
  --blue: #4a9eff;
  --radius: 8px;
  --radius-lg: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg-dark);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* ── Header ── */
.site-header {
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
}
.logo span { color: var(--accent); }

.header-search {
  flex: 0 1 360px;
  position: relative;
}
.header-search input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 8px 16px 8px 36px;
  color: var(--text);
  font-size: 0.875rem;
  outline: none;
}
.header-search input:focus { border-color: var(--accent); }
.header-search .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.875rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn {
  padding: 8px 18px;
  border-radius: 20px;
  border: none;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-gold {
  background: var(--gold);
  color: #000;
}
.btn-gold:hover { background: #f39c12; }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }

.profile-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.2s;
}
.profile-icon:hover { border-color: var(--accent); }

/* ── Category Tabs ── */
.category-bar {
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  display: flex;
  gap: 4px;
  overflow-x: auto;
}
.category-bar a {
  padding: 10px 16px;
  color: var(--text-muted);
  font-size: 0.825rem;
  font-weight: 500;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}
.category-bar a:hover { color: var(--text); }
.category-bar a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ── Room Grid (Homepage) — CB-style layout ── */
.room-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-card);
}

.room-card {
  background: var(--bg-card);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  position: relative;
}
.room-card:nth-child(4n) { border-right: none; }
.room-card:nth-last-child(-n+4) { border-bottom: none; }
.room-card:last-child { border-right: none; }

.room-card:hover {
  z-index: 2;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
.room-card:hover .room-thumb img,
.room-card:hover .room-thumb video {
  transform: scale(1.03);
}
.room-card.is-live:hover {
  border-color: var(--accent-dim);
}

/* Silhouette placeholder card */
.room-card.silhouette-card {
  cursor: default;
}
.room-card.silhouette-card:hover {
  box-shadow: none;
}
.silhouette-svg {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.silhouette-svg svg {
  width: 50%;
  height: 80%;
}

/* Thumbnail — 4:3 aspect like CB */
.room-thumb {
  position: relative;
  width: 100%;
  padding-top: 75%; /* 4:3 ratio */
  background: #1a1a2e;
  overflow: hidden;
}
.room-thumb img,
.room-thumb video {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.15s;
}
.room-thumb .placeholder {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: var(--text-dim);
}
.room-thumb .live-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: var(--red);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.room-thumb .viewer-count {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(0,0,0,0.75);
  color: var(--text);
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 3px;
}
.room-thumb .duration-badge {
  position: absolute;
  bottom: 6px;
  left: 6px;
  background: rgba(0,0,0,0.75);
  color: var(--text-muted);
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 3px;
}

/* Info area below thumb — CB style */
.room-info {
  padding: 8px 10px 10px;
}
.room-info .model-name {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--accent);
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 1px;
  line-height: 1.3;
}
.room-info .model-name-left {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.room-info .model-age {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 400;
  flex-shrink: 0;
}
.room-info .model-location {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 400;
  margin-left: auto;
  white-space: nowrap;
  flex-shrink: 0;
}
.room-info .model-desc {
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}
.room-info .model-tags {
  color: var(--text-dim);
  font-size: 0.72rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.room-info .room-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 3px;
}

/* ── Room Page ── */
.room-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
}

.room-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.room-header .model-name {
  font-size: 1.4rem;
  font-weight: 700;
}
.room-header .model-name .live-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--red);
  margin-right: 8px;
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.room-header .room-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
.fav-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
}
.fav-btn:hover, .fav-btn.active {
  border-color: var(--accent);
  color: var(--accent);
}

/* Video Player */
.video-container {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.video-container .placeholder-stream {
  color: var(--text-dim);
  font-size: 1.1rem;
}
.video-overlay-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
  padding: 20px 16px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.viewer-badge {
  background: rgba(255,255,255,0.15);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
  color: var(--text);
}

/* Chat Section */
.chat-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.chat-messages {
  height: 280px;
  overflow-y: auto;
  padding: 12px 16px;
}
.chat-msg {
  margin-bottom: 6px;
  font-size: 0.875rem;
  line-height: 1.4;
}
.chat-msg .username {
  font-weight: 600;
  cursor: pointer;
}
.chat-msg .username.model { color: var(--accent); }
.chat-msg .username.user { color: var(--blue); }
.chat-msg .username.tipper { color: var(--gold); }
.chat-msg .tip-alert {
  background: linear-gradient(135deg, rgba(241,196,15,0.15), rgba(232,67,147,0.15));
  border: 1px solid rgba(241,196,15,0.3);
  border-radius: 6px;
  padding: 6px 10px;
  margin: 4px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.chat-input-bar {
  display: flex;
  border-top: 1px solid var(--border);
  padding: 8px 12px;
  gap: 8px;
  align-items: center;
}
.chat-input-bar input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 8px 16px;
  color: var(--text);
  font-size: 0.875rem;
  outline: none;
}
.chat-input-bar input:focus { border-color: var(--accent); }
.tip-btn {
  background: var(--gold);
  color: #000;
  border: none;
  border-radius: 20px;
  padding: 8px 16px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
}
.tip-btn:hover { background: #f39c12; }

/* Model Bio Section */
.model-bio {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-top: 16px;
}
.model-bio h3 {
  font-size: 1rem;
  margin-bottom: 12px;
  color: var(--text);
}
.bio-grid {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 6px 16px;
  font-size: 0.875rem;
}
.bio-grid dt { color: var(--text-muted); }
.bio-grid dd { color: var(--text); }

.model-photos {
  margin-top: 16px;
}
.model-photos h3 {
  font-size: 1rem;
  margin-bottom: 12px;
}
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}
.photo-grid .photo-placeholder {
  aspect-ratio: 1;
  background: var(--bg-input);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 1.5rem;
}

/* ── Tip Modal ── */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7);
  z-index: 200;
  align-items: center;
  justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 90%;
  max-width: 400px;
}
.modal h2 {
  font-size: 1.2rem;
  margin-bottom: 16px;
  text-align: center;
}
.modal .close-modal {
  float: right;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.3rem;
  cursor: pointer;
  margin-top: -8px;
}
.tip-amounts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.tip-amounts button {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.2s;
}
.tip-amounts button:hover {
  border-color: var(--gold);
  color: var(--gold);
}
.custom-tip {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.custom-tip input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
}
.balance-line {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 12px;
}
.balance-line strong { color: var(--gold); }

/* ── Login Gate Modal ── */
.login-gate .modal {
  text-align: center;
}
.login-gate .modal p {
  color: var(--text-muted);
  margin-bottom: 20px;
  font-size: 0.95rem;
}
.login-gate .modal .btn { width: 100%; margin-bottom: 10px; }

/* ── Geo Block Page ── */
.geo-block {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  padding: 40px 20px;
  text-align: center;
}
.geo-block-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  max-width: 500px;
}
.geo-block-card h1 {
  color: var(--red);
  font-size: 1.4rem;
  margin-bottom: 16px;
}
.geo-block-card p {
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.6;
}

/* ── Profile Dropdown ── */
.profile-dropdown {
  display: none;
  position: absolute;
  top: 50px;
  right: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 200px;
  z-index: 150;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.profile-dropdown.active { display: block; }
.profile-dropdown a, .profile-dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 16px;
  color: var(--text);
  font-size: 0.875rem;
  border: none;
  background: none;
  cursor: pointer;
  transition: background 0.15s;
}
.profile-dropdown a:hover, .profile-dropdown button:hover {
  background: var(--bg-input);
}
.profile-dropdown .divider {
  border-top: 1px solid var(--border);
  margin: 4px 0;
}
.profile-dropdown .balance-display {
  padding: 10px 16px;
  color: var(--gold);
  font-weight: 600;
  font-size: 0.85rem;
}

/* ── Footer ── */
.site-footer {
  background: var(--bg-header);
  border-top: 1px solid var(--border);
  margin-top: 40px;
  padding: 40px 20px 0;
}
.footer-inner {
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  padding-bottom: 32px;
}
.footer-col h4 {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}
.footer-col a {
  display: block;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 4px 0;
  transition: color 0.2s;
}
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 20px 0;
  text-align: center;
}
.footer-logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  display: block;
  margin-bottom: 6px;
}
.footer-logo span { color: var(--accent); }
.footer-bottom p {
  color: var(--text-dim);
  font-size: 0.75rem;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .room-grid {
    grid-template-columns: repeat(3, 1fr);
    padding: 10px;
  }
  .room-card:nth-child(4n) { border-right: 1px solid var(--border); }
  .room-card:nth-child(3n) { border-right: none; }
  .footer-inner { grid-template-columns: 1fr; gap: 20px; text-align: center; }
  .room-page { padding: 10px; }
  .room-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .room-header .model-name { font-size: 1.1rem; }
  .room-header .room-actions { width: 100%; justify-content: flex-start; }
  .video-container { border-radius: var(--radius) var(--radius) 0 0; }
  .chat-messages { height: 220px; }
  .chat-input-bar { padding: 6px 8px; gap: 6px; }
  .chat-input-bar input { padding: 8px 12px; font-size: 0.85rem; }
  .bio-grid { grid-template-columns: 100px 1fr; }
  .photo-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }
  .category-bar { padding: 0 10px; }
  .category-bar a { padding: 8px 12px; font-size: 0.775rem; }
  .model-bio { padding: 14px; }
  /* Hide Buy Tokens on tablet, keep auth buttons */
  .header-actions .btn-gold { display: none; }
}

@media (max-width: 480px) {
  .site-header {
    padding: 8px 10px;
    height: auto;
    min-height: 48px;
    flex-wrap: wrap;
    gap: 6px;
  }
  .logo { font-size: 1rem; flex-shrink: 0; }
  .header-actions {
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .header-actions .btn-sm { padding: 6px 12px; font-size: 0.78rem; }
  /* Hide Buy Tokens on mobile, keep Log In / Sign Up */
  .header-actions .btn-gold { display: none; }

  .room-grid {
    grid-template-columns: repeat(2, 1fr);
    padding: 8px;
  }
  /* On mobile 2-col, adjust border removal */
  .room-card:nth-child(4n) { border-right: 1px solid var(--border); }
  .room-card:nth-child(2n) { border-right: none; }
  .room-info { padding: 8px 10px; }
  .room-info .model-name { font-size: 0.85rem; }
  .room-info .model-tags { font-size: 0.7rem; }
  .room-info .model-age { font-size: 0.7rem; margin-top: -14px; }

  .room-page { padding: 8px; }
  .room-header .model-name { font-size: 1rem; }
  .chat-messages { height: 180px; }
  .chat-input-bar { flex-wrap: wrap; }
  .chat-input-bar input { min-width: 0; }
  .tip-btn { padding: 8px 12px; font-size: 0.8rem; }

  .category-bar { gap: 0; }
  .category-bar a { padding: 8px 10px; font-size: 0.72rem; }

  .modal { padding: 20px; width: 95%; }
  .modal h2 { font-size: 1.1rem; }

  .model-bio { margin-top: 10px; }
  .bio-grid { grid-template-columns: 90px 1fr; font-size: 0.8rem; }

  .profile-dropdown { top: auto; right: 10px; }
  .profile-icon { width: 32px; height: 32px; font-size: 0.9rem; }

  .footer-inner { gap: 16px; }
  .footer-col h4 { font-size: 0.75rem; margin-bottom: 8px; }
  .footer-col a { font-size: 0.8rem; }
  .site-footer { margin-top: 24px; padding: 24px 16px 0; }
}
