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

:root {
  --bg: #0a0912;
  --surface: #13111f;
  --card: #1e1a2e;
  --border: rgba(168,85,247,0.15);
  --border-hover: rgba(168,85,247,0.35);
  --purple: #a855f7;
  --purple-dark: #7e22ce;
  --pink: #ec4899;
  --pink-dark: #db2777;
  --text: #f3e8ff;
  --text-muted: #a855f7;
  --text-dim: #581c87;
  --grad: linear-gradient(135deg, #7e22ce, #db2777);
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--dim); border-radius: 3px; }

/* Layout */
.app-layout { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed;
  left: 0; top: 0;
  width: 260px; height: 100%;
  background: rgba(30,26,46,0.6);
  backdrop-filter: blur(12px);
  border-right: 1px solid var(--border);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  z-index: 40;
}

.main-content {
  margin-left: 260px;
  flex: 1;
  padding: 32px 20px;
  max-width: 680px;
}

.logo { font-size: 26px; font-weight: 900; letter-spacing: -0.5px; background: var(--grad); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.logo-sub { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

/* Nav */
.nav-links { flex: 1; margin-top: 32px; display: flex; flex-direction: column; gap: 4px; }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px; text-decoration: none; color: var(--text-muted); font-size: 14px; font-weight: 500; transition: all .2s; }
.nav-link:hover { color: white; background: rgba(255,255,255,0.05); }
.nav-link.active { color: white; background: linear-gradient(135deg, rgba(126,34,206,0.4), rgba(219,39,119,0.15)); border: 1px solid rgba(168,85,247,0.25); }
.nav-link svg { width: 18px; height: 18px; flex-shrink: 0; }

/* User section in sidebar */
.sidebar-user { padding-top: 16px; border-top: 1px solid var(--border); }
.sidebar-user-info { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.sidebar-user-name { font-size: 13px; font-weight: 600; color: white; }
.sidebar-user-email { font-size: 11px; color: var(--text-dim); }
.logout-btn { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); background: none; border: none; cursor: pointer; padding: 6px 8px; border-radius: 8px; transition: all .2s; width: 100%; }
.logout-btn:hover { color: var(--pink); background: rgba(255,255,255,0.05); }

/* Avatar */
.avatar { border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.avatar-placeholder { border-radius: 50%; background: var(--grad); display: flex; align-items: center; justify-content: center; color: white; font-weight: 700; flex-shrink: 0; }

/* Cards */
.card { background: rgba(30,26,46,0.8); border: 1px solid var(--border); border-radius: 18px; overflow: hidden; }
.glass { background: rgba(30,26,46,0.6); backdrop-filter: blur(12px); border: 1px solid var(--border); border-radius: 16px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 14px; font-weight: 600; padding: 10px 20px; border-radius: 12px; border: none; cursor: pointer; transition: all .2s; text-decoration: none; }
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--grad); color: white; }
.btn-primary:hover { filter: brightness(1.1); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { color: white; background: rgba(255,255,255,0.05); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-danger { background: rgba(239,68,68,0.15); color: #f87171; border: 1px solid rgba(239,68,68,0.2); }
.btn-danger:hover { background: rgba(239,68,68,0.25); }

/* Forms */
.input { width: 100%; background: rgba(255,255,255,0.05); border: 1px solid rgba(168,85,247,0.2); border-radius: 12px; padding: 12px 16px; color: white; font-size: 14px; font-family: inherit; transition: border .2s; outline: none; }
.input:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(168,85,247,0.1); }
.input::placeholder { color: rgba(168,85,247,0.4); }
textarea.input { resize: vertical; min-height: 100px; }
.input-group { position: relative; }
.input-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: rgba(168,85,247,0.6); }
.input-icon-right { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: rgba(168,85,247,0.6); }
.input-icon-right:hover { color: var(--purple); }
.input.has-icon { padding-left: 44px; }
.label { display: block; font-size: 12px; font-weight: 500; color: var(--text-muted); margin-bottom: 6px; }
.form-group { margin-bottom: 16px; }
.char-count { text-align: right; font-size: 11px; color: var(--text-dim); margin-top: 4px; }

/* Login page */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; position: relative; overflow: hidden; }
.login-glow-1 { position: absolute; top: -160px; left: -160px; width: 400px; height: 400px; background: rgba(126,34,206,0.15); border-radius: 50%; filter: blur(80px); pointer-events: none; }
.login-glow-2 { position: absolute; bottom: -160px; right: -160px; width: 400px; height: 400px; background: rgba(219,39,119,0.12); border-radius: 50%; filter: blur(80px); pointer-events: none; }
.login-box { width: 100%; max-width: 380px; position: relative; }
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo .logo { font-size: 36px; }
.login-logo p { font-size: 14px; color: var(--text-muted); margin-top: 8px; }
.login-card { background: rgba(30,26,46,0.8); border: 1px solid var(--border); border-radius: 20px; padding: 28px; }
.login-card h2 { font-size: 18px; font-weight: 700; margin-bottom: 20px; }
.login-footer { text-align: center; font-size: 12px; color: var(--text-dim); margin-top: 16px; }

/* Page header */
.page-header { margin-bottom: 24px; }
.page-title { font-size: 24px; font-weight: 800; background: var(--grad); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.page-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* Countdown */
.countdown { background: rgba(30,26,46,0.6); border: 1px solid var(--border); border-radius: 16px; padding: 16px; text-align: center; margin-bottom: 20px; }
.countdown-label { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }
.countdown-label svg { width: 14px; height: 14px; }
.countdown-units { display: flex; align-items: center; justify-content: center; gap: 8px; }
.countdown-unit { text-align: center; }
.countdown-value { background: rgba(126,34,206,0.3); border: 1px solid rgba(126,34,206,0.25); border-radius: 10px; padding: 8px 12px; min-width: 52px; font-size: 22px; font-weight: 700; color: white; font-variant-numeric: tabular-nums; }
.countdown-lbl { font-size: 10px; color: var(--text-dim); margin-top: 4px; }
.countdown-sep { font-size: 20px; font-weight: 700; color: rgba(126,34,206,0.5); padding-bottom: 16px; }

/* Pending banner */
.pending-banner { background: rgba(30,26,46,0.6); border: 1px solid rgba(168,85,247,0.2); border-radius: 14px; padding: 14px 16px; display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.pending-icon { width: 36px; height: 36px; background: rgba(126,34,206,0.3); border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.pending-icon svg { width: 16px; height: 16px; color: var(--text-muted); }
.pending-text p:first-child { font-size: 14px; font-weight: 500; color: var(--text); }
.pending-text p:last-child { font-size: 12px; color: rgba(168,85,247,0.6); margin-top: 2px; }

/* Post cards */
.post-card { margin-bottom: 16px; }
.post-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 12px; }
.post-user { display: flex; align-items: center; gap: 10px; }
.post-user-name { font-size: 14px; font-weight: 600; color: white; transition: color 0.15s; }
.post-user-name:hover { color: var(--purple-light, #c084fc); }
.post-user-time { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.post-delete { background: none; border: none; cursor: pointer; color: rgba(126,34,206,0.6); padding: 6px; border-radius: 8px; transition: all .2s; }
.post-delete:hover { color: var(--pink); background: rgba(255,255,255,0.05); }
.post-delete svg { width: 15px; height: 15px; }

.post-text { padding: 0 16px 12px; font-size: 15px; line-height: 1.6; color: var(--text); white-space: pre-wrap; }
.post-image { width: 100%; max-height: 500px; object-fit: cover; display: block; }
.post-video { width: 100%; max-height: 500px; display: block; }
.post-video-revealed { cursor: pointer; }
.post-caption { padding: 8px 16px; font-size: 14px; color: #ffffff; font-weight: 500; }

.post-actions { display: flex; align-items: center; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--border); }
.action-btn { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; background: none; border: none; cursor: pointer; transition: all .2s; color: var(--text-muted); padding: 4px; border-radius: 8px; }
.action-btn:hover { color: white; }
.action-btn svg { width: 18px; height: 18px; }
.action-btn.liked { color: var(--pink); }
.action-btn.liked svg { fill: var(--pink); }

/* Comments */
.comments-section { padding: 12px 16px; border-top: 1px solid var(--border); }
.comment { display: flex; gap: 8px; margin-bottom: 10px; }
.comment-bubble { flex: 1; background: rgba(255,255,255,0.04); border-radius: 10px; padding: 8px 12px; }
.comment-author { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.comment-text { font-size: 13px; color: var(--text); margin-top: 2px; }
.comment-form { display: flex; gap: 8px; margin-top: 10px; align-items: center; }
.comment-input { flex: 1; background: rgba(255,255,255,0.05); border: 1px solid rgba(168,85,247,0.2); border-radius: 20px; padding: 8px 14px; color: white; font-size: 13px; outline: none; transition: border .2s; font-family: inherit; }
.comment-input:focus { border-color: var(--purple); }
.comment-submit { background: none; border: none; cursor: pointer; color: var(--text-muted); transition: color .2s; }
.comment-submit:hover { color: var(--purple); }
.comment-submit svg { width: 18px; height: 18px; }

/* Empty state */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-icon { width: 64px; height: 64px; background: rgba(126,34,206,0.2); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }
.empty-icon svg { width: 28px; height: 28px; color: var(--text-muted); }
.empty-title { font-size: 16px; font-weight: 600; color: white; margin-bottom: 8px; }
.empty-text { font-size: 13px; color: var(--text-muted); max-width: 280px; margin: 0 auto; line-height: 1.6; }

/* Submit page */
.type-selector { display: flex; gap: 8px; margin-bottom: 24px; }
.type-btn { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; border-radius: 12px; border: 1px solid var(--border); background: transparent; color: var(--text-muted); font-size: 14px; font-weight: 600; cursor: pointer; transition: all .2s; font-family: inherit; }
.type-btn:hover { color: white; background: rgba(255,255,255,0.05); }
.type-btn.active { background: var(--grad); color: white; border-color: transparent; }
.type-btn svg { width: 16px; height: 16px; }

.upload-zone { border: 2px dashed rgba(126,34,206,0.3); border-radius: 16px; padding: 48px 20px; text-align: center; cursor: pointer; transition: border .2s; }
.upload-zone:hover { border-color: var(--purple); }
.upload-zone svg { width: 40px; height: 40px; color: var(--text-muted); margin: 0 auto 12px; display: block; }
.upload-zone p { font-size: 14px; color: var(--text); font-weight: 500; }
.upload-zone span { font-size: 12px; color: var(--text-muted); }
.file-preview { position: relative; border-radius: 16px; overflow: hidden; }
.file-preview img, .file-preview video { width: 100%; max-height: 320px; object-fit: contain; background: #000; display: block; }
.file-preview-remove { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; background: rgba(0,0,0,0.6); border-radius: 50%; border: none; cursor: pointer; color: white; display: flex; align-items: center; justify-content: center; }
.file-preview-remove svg { width: 14px; height: 14px; }

/* Profile */
.profile-header { padding: 24px; margin-bottom: 16px; }
.profile-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 16px; }
.profile-name { font-size: 20px; font-weight: 700; color: white; margin-top: 8px; }
.profile-role { display: inline-block; font-size: 11px; background: rgba(126,34,206,0.3); color: var(--text-muted); border: 1px solid rgba(126,34,206,0.3); border-radius: 20px; padding: 2px 10px; margin-top: 4px; }
.profile-bio { font-size: 13px; color: var(--text-muted); line-height: 1.6; margin-top: 8px; }
.profile-stats { display: flex; gap: 20px; margin-top: 16px; }
.stat-value { font-weight: 700; color: white; }
.stat-label { font-size: 12px; color: var(--text-muted); }

/* Admin */
.admin-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 28px; }
.admin-action-card { background: rgba(30,26,46,0.6); border: 1px solid var(--border); border-radius: 14px; padding: 18px; cursor: pointer; transition: border .2s; text-align: left; font-family: inherit; color: inherit; }
.admin-action-card:hover { border-color: var(--border-hover); }
.admin-action-card svg { width: 20px; height: 20px; color: var(--text-muted); margin-bottom: 8px; display: block; }
.admin-action-card p { font-size: 13px; font-weight: 600; color: white; }
.admin-action-card span { font-size: 12px; color: var(--text-muted); }

.members-list { background: rgba(30,26,46,0.6); border: 1px solid var(--border); border-radius: 16px; padding: 20px; }
.members-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.members-header h2 { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.members-header svg { width: 18px; height: 18px; color: var(--text-muted); }
.member-row { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-radius: 10px; transition: background .2s; }
.member-row:hover { background: rgba(255,255,255,0.03); }
.member-info { flex: 1; min-width: 0; }
.member-name { font-size: 13px; font-weight: 600; color: white; }
.member-email { font-size: 11px; color: var(--text-dim); margin-top: 1px; }
.member-delete { background: none; border: none; cursor: pointer; color: rgba(126,34,206,0.5); padding: 6px; border-radius: 8px; transition: all .2s; }
.member-delete:hover { color: var(--pink); background: rgba(255,255,255,0.05); }
.member-delete svg { width: 15px; height: 15px; }
.role-badge { font-size: 10px; background: rgba(126,34,206,0.3); color: var(--text-muted); border: 1px solid rgba(126,34,206,0.3); border-radius: 20px; padding: 2px 8px; }

/* Add member form */
.add-member-form { background: rgba(126,34,206,0.1); border: 1px solid rgba(126,34,206,0.2); border-radius: 12px; padding: 16px; margin-bottom: 16px; }
.add-member-form h3 { font-size: 13px; font-weight: 600; color: var(--text-muted); margin-bottom: 12px; }

/* Skeleton */
.skeleton { background: linear-gradient(90deg, rgba(126,34,206,0.1) 25%, rgba(126,34,206,0.2) 50%, rgba(126,34,206,0.1) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Toast */
.toast-container { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { background: rgba(30,26,46,0.95); border: 1px solid rgba(168,85,247,0.3); border-radius: 12px; padding: 12px 20px; font-size: 14px; color: white; pointer-events: auto; animation: slideUp .3s ease; white-space: nowrap; }
.toast.success { border-color: rgba(168,85,247,0.5); }
.toast.error { border-color: rgba(239,68,68,0.4); color: #fca5a5; }
@keyframes slideUp { from { transform: translateY(10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* Hidden post blur */
.post-media-wrap { position: relative; overflow: hidden; border-radius: 12px; }
.post-media-hidden { min-height: 220px; background: var(--surface2); }
.post-media-hidden img,
.post-media-hidden video { filter: blur(22px); transform: scale(1.12); min-height: 220px; object-fit: cover; width: 100%; display: block; }
.post-blur-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
.post-blur-overlay svg { color: rgba(200,185,230,0.85); filter: drop-shadow(0 1px 3px rgba(0,0,0,0.5)); width: 32px; height: 32px; }
.post-blur-overlay p { font-size: 13px; font-weight: 600; color: rgba(200,185,230,0.85); text-shadow: 0 1px 4px rgba(0,0,0,0.5); letter-spacing: 0.02em; }
.post-blurred-text { color: #ffffff; font-weight: 700; font-size: 17px; user-select: none; }
.post-blur-hint { display: block; font-size: 14px; color: #b8a9d4; margin-top: 8px; font-weight: 600; }

/* Reveal badge */
.lock-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); }
.lock-badge svg { width: 13px; height: 13px; }

/* Profile modal */
.profile-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(6px); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; opacity: 0; transition: opacity .2s; pointer-events: none; }
.profile-modal-overlay.active { opacity: 1; pointer-events: all; }
.profile-modal { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; width: 100%; max-width: 420px; max-height: 85vh; overflow-y: auto; padding: 24px; position: relative; transform: translateY(20px); transition: transform .2s; }
.profile-modal-overlay.active .profile-modal { transform: translateY(0); }
.profile-modal-close { position: absolute; top: 16px; right: 16px; background: var(--surface2); border: none; color: var(--text-muted); width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-size: 18px; display: flex; align-items: center; justify-content: center; }
.profile-modal-close:hover { color: white; }
.profile-modal-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.profile-modal-name { font-size: 18px; font-weight: 700; color: white; }
.profile-modal-meta { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.profile-modal-bio { font-size: 14px; color: var(--text); line-height: 1.6; margin: 12px 0; }
.profile-modal-block { background: rgba(168,85,247,0.08); border-left: 3px solid var(--purple); border-radius: 0 10px 10px 0; padding: 10px 14px; margin-top: 10px; }
.profile-modal-block.pink { background: rgba(236,72,153,0.08); border-color: var(--pink); }
.profile-modal-block-label { font-size: 11px; color: var(--text-muted); font-weight: 600; margin-bottom: 4px; }
.profile-modal-block-text { font-size: 14px; color: var(--text); line-height: 1.6; }
.profile-modal-link { display: block; text-align: center; margin-top: 18px; color: var(--purple-light, #c084fc); font-size: 13px; text-decoration: none; font-weight: 600; }
.profile-modal-link:hover { text-decoration: underline; }
.profile-modal-stats { display: flex; gap: 20px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.profile-modal-stat-val { font-size: 20px; font-weight: 800; color: white; }
.profile-modal-stat-lbl { font-size: 11px; color: var(--text-muted); }

/* Lightbox */
.lightbox-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.95); z-index: 2000; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .2s; pointer-events: none; }
.lightbox-overlay.active { opacity: 1; pointer-events: all; }
.lightbox-overlay img { max-width: 95vw; max-height: 92vh; object-fit: contain; border-radius: 8px; transform: scale(0.95); transition: transform .2s; }
.lightbox-overlay.active img { transform: scale(1); }
.lightbox-close { position: fixed; top: 16px; right: 16px; background: rgba(255,255,255,0.15); border: none; color: white; width: 44px; height: 44px; border-radius: 50%; font-size: 22px; cursor: pointer; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(8px); transition: background .15s; }
.lightbox-close:hover { background: rgba(255,255,255,0.25); }

/* Spinner */
.spinner { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,0.2); border-top-color: white; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Mobile bottom nav */
.mobile-nav { display: none; }

@media (max-width: 768px) {
  .sidebar { display: none; }
  .main-content { margin-left: 0; padding: 16px 12px 80px; max-width: 100%; }
  .mobile-nav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: rgba(30,26,46,0.9);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    z-index: 40;
    padding: 8px 0 12px;
    justify-content: space-around;
  }
  .mobile-nav a { display: flex; flex-direction: column; align-items: center; gap: 3px; text-decoration: none; color: rgba(126,34,206,0.6); font-size: 10px; padding: 4px 12px; transition: color .2s; }
  .mobile-nav a.active, .mobile-nav a:hover { color: var(--text-muted); }
  .mobile-nav svg { width: 22px; height: 22px; }
  .admin-actions { grid-template-columns: 1fr; }
}

/* Utils */
.text-grad { background: var(--grad); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.w-full { width: 100%; }
.hidden { display: none !important; }
