@import url('./tokens.css');

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  height: 100%;
}

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

button {
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  outline: none;
  user-select: none;
}

img, video {
  display: block;
  max-width: 100%;
}

input, textarea, select {
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  outline: none;
  transition: border-color var(--transition-fast);
}

input:focus, textarea:focus, select:focus {
  border-color: var(--muted);
}

/* ==========================================================================
   TYPOGRAPHY & UTILITY CLASSES
   ========================================================================== */
.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}
.accent { color: var(--accent-blue); }
.mint { color: var(--verified-mint); }
.like-heart { color: var(--like-red); }

/* ==========================================================================
   BUTTONS & BADGES
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 16px;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 14px;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.btn-primary {
  background-color: var(--accent-blue);
  color: #FFFFFF;
}
.btn-primary:hover {
  background-color: var(--accent-blue-hover);
}

.btn-secondary {
  background-color: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-secondary:hover {
  background-color: var(--card-hover);
  border-color: var(--border-light);
}

.btn-danger {
  background-color: rgba(255, 48, 64, 0.15);
  color: var(--like-red);
  border: 1px solid rgba(255, 48, 64, 0.3);
}
.btn-danger:hover {
  background-color: rgba(255, 48, 64, 0.25);
}

.btn-ghost {
  color: var(--muted);
}
.btn-ghost:hover {
  color: var(--text);
  background-color: rgba(255, 255, 255, 0.05);
}

.btn-icon {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text);
  transition: background-color var(--transition-fast), transform var(--transition-fast);
}
.btn-icon:hover {
  background-color: rgba(255, 255, 255, 0.08);
}
.btn-icon:active {
  transform: scale(0.92);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
}
.badge-mint {
  background-color: rgba(16, 185, 129, 0.15);
  color: var(--verified-mint);
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.badge-blue {
  background-color: rgba(0, 149, 246, 0.15);
  color: var(--accent-blue);
  border: 1px solid rgba(0, 149, 246, 0.3);
}
.badge-red {
  background-color: var(--like-red);
  color: #fff;
  font-size: 11px;
  padding: 1px 6px;
}

/* ==========================================================================
   APP CONTAINER & LAYOUT
   ========================================================================== */
#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Shell Layout */
.shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  padding: 24px 16px 20px;
  border-right: 1px solid var(--border);
  background-color: var(--bg);
  z-index: 100;
}

.sidebar-logo {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  padding: 0 12px 28px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 48px;
  padding: 0 12px;
  border-radius: var(--radius-btn);
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
  transition: all var(--transition-fast);
  position: relative;
}
.nav-item:hover {
  color: var(--text);
  background-color: rgba(255, 255, 255, 0.05);
}
.nav-item.active {
  color: var(--text);
  font-weight: 700;
}
.nav-item svg {
  width: 24px;
  height: 24px;
  stroke-width: 2;
}

.sidebar-footer {
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100vh;
  overflow-y: auto;
}

.topbar {
  height: var(--navbar-height);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 90;
}
.topbar h1 {
  font-size: 18px;
  font-weight: 700;
}

/* Mobile Tabbar */
.tabbar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-height);
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  z-index: 100;
  justify-content: space-around;
  align-items: center;
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar .tab {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  color: var(--muted);
  position: relative;
}
.tabbar .tab.active {
  color: var(--text);
}

/* ==========================================================================
   LANDING PAGE (Premium Hero & Detailing)
   ========================================================================== */
.landing-nav {
  height: var(--navbar-height);
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.landing-nav-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.landing-links {
  display: flex;
  align-items: center;
  gap: 24px;
}
.landing-links a {
  color: var(--muted);
  font-weight: 500;
  transition: color var(--transition-fast);
}
.landing-links a:hover {
  color: var(--text);
}

.hero-section {
  padding: 80px 24px 60px;
  text-align: center;
  max-width: 880px;
  margin: 0 auto;
}
.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 24px;
}
.hero-pill::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--verified-mint);
  display: inline-block;
}

.hero-headline {
  font-size: 64px;
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -2px;
  margin-bottom: 20px;
}

.hero-subtext {
  font-size: 18px;
  color: var(--muted);
  max-width: 620px;
  margin: 0 auto 36px;
  line-height: 1.6;
}

.hero-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 48px;
}

.stats-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 48px;
  padding: 24px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  max-width: 520px;
  margin: 0 auto;
}
.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.stat-number {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -1px;
}
.stat-label {
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  max-width: 1140px;
  margin: 0 auto 80px;
  padding: 0 24px;
}
.feature-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 28px;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}
.feature-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-light);
}
.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background-color: var(--card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-blue);
  margin-bottom: 20px;
}
.feature-card h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 10px;
}
.feature-card p {
  color: var(--muted);
  line-height: 1.6;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 1140px;
  margin: 0 auto 80px;
  padding: 0 24px;
}
.step-card {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 28px;
  position: relative;
}
.step-number {
  font-size: 32px;
  font-weight: 900;
  color: var(--accent-blue);
  margin-bottom: 12px;
}

.founder-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 36px;
  max-width: 680px;
  margin: 0 auto 80px;
  text-align: center;
}
.founder-quote {
  font-size: 20px;
  font-weight: 500;
  line-height: 1.5;
  margin-bottom: 16px;
}
.founder-author {
  color: var(--muted);
  font-size: 15px;
  margin-bottom: 24px;
}

/* ==========================================================================
   FEED & POSTS (470px Premium)
   ========================================================================== */
.feed-container {
  max-width: var(--post-max-width);
  margin: 24px auto 60px;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Stories Bar */
.stories-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  overflow-x: auto;
  padding: 12px 0 16px;
  scrollbar-width: none;
}
.stories-bar::-webkit-scrollbar { display: none; }

.story-circle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  flex-shrink: 0;
}
.story-ring {
  width: var(--story-size);
  height: var(--story-size);
  border-radius: 50%;
  padding: 2px;
  background: linear-gradient(45deg, #F09433, #E6683C, #DC2743, #CC2366, #BC1888);
  display: flex;
  align-items: center;
  justify-content: center;
}
.story-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: var(--surface);
  border: 2px solid var(--bg);
  object-fit: cover;
}
.story-username {
  font-size: 11px;
  color: var(--text);
  max-width: 64px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Post Card */
.post-card {
  background-color: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  margin-bottom: 12px;
}

.post-header {
  height: 56px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.post-user {
  display: flex;
  align-items: center;
  gap: 10px;
}
.post-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background-color: var(--card);
}
.post-username {
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.post-time {
  color: var(--muted);
  font-size: 12px;
}

/* 4:5 Media Container */
.post-media-container {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  background-color: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
}
.post-media-container img, .post-media-container video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Double-tap heart animation */
.heart-burst {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  color: var(--like-red);
  pointer-events: none;
  opacity: 0;
  transition: transform 400ms cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 300ms ease;
  z-index: 10;
}
.heart-burst.active {
  transform: translate(-50%, -50%) scale(1.4);
  opacity: 0.95;
}

.post-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px 6px;
}
.post-action-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.post-action-btn {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  transition: transform var(--transition-fast);
}
.post-action-btn:active {
  transform: scale(0.85);
}
.post-action-btn.liked {
  color: var(--like-red);
}

.post-body {
  padding: 0 14px 14px;
}
.post-likes {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
}
.post-caption {
  font-size: 14px;
  line-height: 1.4;
  margin-bottom: 6px;
}
.post-caption strong {
  font-weight: 600;
  margin-right: 6px;
}
.post-comments-link {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 6px;
  cursor: pointer;
}

/* ==========================================================================
   REELS (Full-screen Snap, Music Disc, BottomSheet)
   ========================================================================== */
.reels-container {
  height: calc(100vh - var(--navbar-height));
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  scroll-snap-type: y mandatory;
  overflow-y: scroll;
  scrollbar-width: none;
}
.reels-container::-webkit-scrollbar { display: none; }

.reel-item {
  height: 100%;
  scroll-snap-align: start;
  position: relative;
  background-color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-card);
  overflow: hidden;
}
.reel-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Reel Overlay Elements */
.reel-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px 16px;
  background: linear-gradient(180deg, rgba(0,0,0,0.4) 0%, transparent 20%, transparent 60%, rgba(0,0,0,0.85) 100%);
  pointer-events: none;
}
.reel-overlay > * { pointer-events: auto; }

.reel-actions-column {
  position: absolute;
  right: 12px;
  bottom: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  z-index: 20;
}
.reel-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: #fff;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.6));
}
.reel-action-btn span {
  font-size: 12px;
  font-weight: 600;
}
.reel-action-btn.liked {
  color: var(--like-red);
}

/* Music Disc */
.music-disc {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: radial-gradient(circle, #333 30%, #111 70%);
  border: 2px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: spin 3s linear infinite;
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.reel-bottom-info {
  position: absolute;
  left: 16px;
  bottom: 24px;
  right: 80px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.reel-user-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.reel-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid #fff;
}
.reel-username {
  font-weight: 700;
  font-size: 14px;
  color: #fff;
}
.btn-follow-pill {
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid rgba(255,255,255,0.4);
  color: #fff;
}
.btn-follow-pill.following {
  background-color: transparent;
  border-color: rgba(255,255,255,0.2);
  color: var(--muted);
}

.reel-caption-text {
  font-size: 13px;
  line-height: 1.4;
  color: #fff;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.reel-audio-track {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #fff;
}

/* Comment BottomSheet */
.bottom-sheet {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.7);
}
.sheet-content {
  position: relative;
  background-color: var(--surface);
  border-top: 1px solid var(--border);
  border-radius: 16px 16px 0 0;
  height: 60vh;
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sheet);
  animation: slideUp var(--transition-bounce);
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.sheet-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.sheet-handle {
  width: 36px;
  height: 4px;
  background-color: var(--border-light);
  border-radius: 2px;
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
}
.sheet-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.sheet-input-row {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 12px;
  background-color: var(--card);
}

/* ==========================================================================
   CHAT (72px row, 48px avatar, #3797F0 mine, #262626 other, Reel Card 240px)
   ========================================================================== */
.chat-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  height: calc(100vh - var(--navbar-height));
  background-color: var(--bg);
}

.chat-sidebar {
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100%;
}
.chat-sidebar-header {
  height: 64px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.chat-list {
  flex: 1;
  overflow-y: auto;
}
.chat-row {
  height: var(--chat-row-height);
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: background-color var(--transition-fast);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}
.chat-row:hover, .chat-row.active {
  background-color: var(--card);
}

.chat-avatar-wrap {
  position: relative;
  width: var(--chat-avatar-size);
  height: var(--chat-avatar-size);
  flex-shrink: 0;
}
.chat-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background-color: var(--card);
}
.online-dot {
  width: 12px;
  height: 12px;
  background-color: var(--verified-mint);
  border: 2px solid var(--bg);
  border-radius: 50%;
  position: absolute;
  bottom: 0;
  right: 0;
}

.chat-row-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.chat-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.chat-row-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-row-time {
  font-size: 11px;
  color: var(--muted);
}
.chat-row-snippet {
  font-size: 13px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Chat Main Area */
.chat-main {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.chat-header {
  height: 64px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background-color: var(--bg);
}
.chat-recipient {
  display: flex;
  align-items: center;
  gap: 12px;
}

.messages-area {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.message-bubble {
  max-width: 60%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.4;
  position: relative;
  word-break: break-word;
}
.message-mine {
  align-self: flex-end;
  background-color: var(--chat-mine);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.message-other {
  align-self: flex-start;
  background-color: var(--chat-other);
  color: #fff;
  border-bottom-left-radius: 4px;
}

/* Reply Reference */
.message-reply-preview {
  background-color: rgba(0, 0, 0, 0.2);
  border-left: 3px solid #fff;
  padding: 4px 8px;
  border-radius: 4px;
  margin-bottom: 6px;
  font-size: 12px;
}

/* Reel in Chat (240px card) */
.reel-chat-card {
  width: 240px;
  border-radius: var(--radius-card);
  overflow: hidden;
  background-color: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform var(--transition-fast);
}
.reel-chat-card:hover {
  transform: scale(1.02);
}
.reel-chat-thumb {
  width: 100%;
  aspect-ratio: 9 / 16;
  max-height: 280px;
  object-fit: cover;
  background-color: #000;
}
.reel-chat-info {
  padding: 10px;
}
.reel-chat-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
}

/* Reactions Bar */
.message-reactions {
  display: flex;
  gap: 4px;
  margin-top: 4px;
}
.reaction-pill {
  font-size: 12px;
  background-color: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: var(--radius-pill);
}

.chat-input-bar {
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  background-color: var(--bg);
}
.chat-input {
  flex: 1;
  height: 44px;
  padding: 0 16px;
  border-radius: 22px;
}

/* ==========================================================================
   PROFILE (150px Avatar, Counts, "Human #21", 3-Column Grid)
   ========================================================================== */
.profile-container {
  max-width: 935px;
  margin: 32px auto 60px;
  padding: 0 20px;
}
.profile-header {
  display: flex;
  align-items: center;
  gap: 60px;
  margin-bottom: 44px;
}
.profile-avatar-wrap {
  width: var(--profile-avatar-size);
  height: var(--profile-avatar-size);
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--border);
  flex-shrink: 0;
}
.profile-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.profile-top-row {
  display: flex;
  align-items: center;
  gap: 16px;
}
.profile-username {
  font-size: 20px;
  font-weight: 600;
}
.member-pill {
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 700;
  background: rgba(0, 149, 246, 0.15);
  border: 1px solid var(--accent-blue);
  color: var(--accent-blue);
}

.profile-stats-row {
  display: flex;
  gap: 36px;
}
.profile-stat {
  font-size: 15px;
}
.profile-stat strong {
  font-weight: 700;
}

.profile-bio {
  font-size: 14px;
  line-height: 1.5;
  max-width: 460px;
}

.profile-tabs {
  display: flex;
  justify-content: center;
  border-top: 1px solid var(--border);
  gap: 48px;
}
.profile-tab {
  height: 52px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  cursor: pointer;
}
.profile-tab.active {
  color: var(--text);
  border-top: 2px solid var(--text);
  margin-top: -1px;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-top: 12px;
}
.grid-item {
  position: relative;
  aspect-ratio: 1 / 1;
  background-color: var(--card);
  overflow: hidden;
  cursor: pointer;
}
.grid-item img, .grid-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-fast);
}
.grid-item:hover img, .grid-item:hover video {
  transform: scale(1.03);
}

/* ==========================================================================
   WATCH PARTY (2:3 Poster, YouTube Embed, Streaming Badges)
   ========================================================================== */
.watch-container {
  max-width: 1140px;
  margin: 24px auto 60px;
  padding: 0 20px;
}
.watch-filter-tabs {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  overflow-x: auto;
}
.watch-tab-btn {
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  background-color: var(--card);
  border: 1px solid var(--border);
  color: var(--muted);
  transition: all var(--transition-fast);
}
.watch-tab-btn.active, .watch-tab-btn:hover {
  background-color: var(--accent-blue);
  color: #fff;
  border-color: var(--accent-blue);
}

.watch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}
.watch-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}
.watch-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-light);
}

.watch-poster-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  position: relative;
  background-color: #000;
  overflow: hidden;
}
.watch-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.watch-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.4);
  opacity: 0;
  transition: opacity var(--transition-fast);
}
.watch-card:hover .watch-play-overlay {
  opacity: 1;
}

.watch-details {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.watch-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.watch-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
}
.watch-platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.platform-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background-color: var(--card);
  border: 1px solid var(--border);
  color: var(--muted);
}

.disclaimer-banner {
  padding: 14px 20px;
  border-radius: var(--radius-btn);
  background-color: var(--card);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

/* ==========================================================================
   ADMIN CONSOLE (Verified 5d/30d/perm, Announcements, Banners)
   ========================================================================== */
.admin-container {
  max-width: 1140px;
  margin: 24px auto 60px;
  padding: 0 20px;
}
.admin-header {
  margin-bottom: 24px;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
}
.admin-table th, .admin-table td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.admin-table th {
  background-color: var(--card);
  font-weight: 600;
  font-size: 13px;
  color: var(--muted);
}

/* ==========================================================================
   LEGAL PAGES (/privacy, /terms, /about, /contact)
   ========================================================================== */
.legal-page-container {
  max-width: 800px;
  margin: 40px auto 80px;
  padding: 0 24px;
}
.legal-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 44px;
}
.legal-card h1 {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 12px;
}
.legal-date {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 32px;
}
.legal-content section {
  margin-bottom: 28px;
}
.legal-content h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text);
}
.legal-content p, .legal-content ul {
  color: var(--muted);
  line-height: 1.7;
  font-size: 14px;
}
.legal-content ul {
  padding-left: 20px;
}

/* Contact Form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 24px;
}
.form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.form-field label {
  font-size: 13px;
  font-weight: 600;
}
.form-field input, .form-field textarea {
  padding: 12px 14px;
}

/* ==========================================================================
   FOOTER (ON EVERY PAGE: NoChat | About Us | Privacy | Terms | Contact | Made by Denpher)
   ========================================================================== */
.global-footer {
  border-top: 1px solid var(--border);
  padding: 24px 20px;
  background-color: var(--bg);
  margin-top: auto;
}
.footer-content {
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-size: 13px;
  color: var(--muted);
}
.footer-divider {
  color: var(--border-light);
}
.footer-link {
  color: var(--muted);
  transition: color var(--transition-fast);
}
.footer-link:hover {
  color: var(--text);
}
.footer-brand {
  font-weight: 700;
  color: var(--text);
}
.footer-author {
  color: var(--accent-blue);
  font-weight: 600;
}
.footer-author:hover {
  text-decoration: underline;
}

/* ==========================================================================
   MODALS, TOASTS & OVERLAYS
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-box {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  width: 100%;
  max-width: 480px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: scaleUp var(--transition-bounce);
}
@keyframes scaleUp {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
}
.toast-pill {
  background-color: var(--card);
  border: 1px solid var(--border-light);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-md);
  font-weight: 500;
  font-size: 13px;
  animation: slideIn 250ms ease;
}
@keyframes slideIn {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .tabbar { display: flex; }
  .hero-headline { font-size: 40px; }
  .chat-layout { grid-template-columns: 1fr; }
  .chat-sidebar.mobile-hide { display: none; }
  .chat-main.mobile-hide { display: none; }
  .profile-header { gap: 24px; flex-direction: column; align-items: flex-start; }
}
