@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&display=swap');

/* ─── Design Tokens ─────────────────────────────────────────────────────────── */
:root {
  --bg: #0F172A;
  /* Deep Midnight Slate */
  --bg-2: #1E293B;
  --bg-3: #334155;
  --glass: rgba(255, 255, 255, 0.03);
  --glass-hover: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-hover: rgba(139, 92, 246, 0.5);

  --primary: #6366F1;
  --primary-2: #EC4899;
  --primary-3: #F97316;
  --grad: linear-gradient(135deg, #6366F1, #EC4899, #F97316);
  --grad-soft: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(236, 72, 153, 0.08));
  --grad-text: linear-gradient(45deg, #818CF8, #F472B6, #FB923C);
  --grad-story: conic-gradient(from 0deg, #6366F1, #EC4899, #F97316, #6366F1);

  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --info: #0EA5E9;

  --text: #F8FAFC;
  --text-2: #CBD5E1;
  --text-3: #94A3B8;
  --text-muted: #475569;

  --radius: 20px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --radius-full: 999px;

  --shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.2);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4), 0 0 0 1px var(--glass-border);

  --nav-h: 68px;
  --transition: 0.25s cubic-bezier(0.23, 1, 0.32, 1);
  --spring: 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --nav-bg: rgba(15, 23, 42, 0.82);
}

[data-theme="light"] {
  --bg: #F8FAFC;
  /* Porcelain Slate */
  --bg-2: #FFFFFF;
  --bg-3: #F1F5F9;
  --nav-bg: rgba(255, 255, 255, 0.9);

  --glass: rgba(0, 0, 0, 0.02);
  --glass-hover: rgba(0, 0, 0, 0.04);
  --glass-border: rgba(0, 0, 0, 0.08);
  --glass-border-hover: rgba(99, 102, 241, 0.4);

  --text: #0F172A;
  --text-2: #475569;
  --text-3: #64748B;
  --text-muted: #94A3B8;

  --shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.03), 0 0 0 1px var(--glass-border);
}

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

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  font-family: 'Outfit', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  max-width: 100vw;
}

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

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

input,
textarea,
button,
select {
  font-family: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

.hidden {
  display: none !important;
}

/* ─── Scrollbar ──────────────────────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.3);
  border-radius: 99px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(139, 92, 246, 0.6);
}

/* ─── Gradient Text Utility ─────────────────────────────────────────────────── */
.grad-text {
  background: var(--grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── Navbar ─────────────────────────────────────────────────────────────────── */
#bottom-nav {
  display: none;
}

#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-h);
  background: var(--nav-bg);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
  transition: transform 0.3s ease-in-out;
}

#bottom-nav {
  transition: transform 0.3s ease-in-out;
}

#navbar::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--grad);
  opacity: 0.3;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: var(--grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
}

.nav-logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 5px rgba(139, 92, 246, 0.55));
  transition: filter var(--transition), transform var(--transition);
}

.nav-brand:hover .nav-logo {
  filter: drop-shadow(0 0 10px rgba(167, 139, 250, 0.9));
  transform: scale(1.12) rotate(-5deg);
}

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

.nav-search-wrap input {
  width: 100%;
  padding: 9px 16px 9px 40px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  color: var(--text);
  font-size: 0.875rem;
  transition: var(--transition);
  outline: none;
}

.nav-search-wrap input:focus {
  border-color: var(--primary);
  background: var(--glass-hover);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.nav-search-wrap input::placeholder {
  color: var(--text-3);
}

.nav-search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  font-size: 0.9rem;
  pointer-events: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  color: var(--text-2);
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
  white-space: nowrap;
}

.nav-link:hover {
  background: var(--glass-hover);
  color: var(--text);
}

.nav-link.active {
  background: rgba(139, 92, 246, 0.15);
  color: var(--primary);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background: var(--grad);
  border-radius: 99px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-icon-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--text-2);
  transition: var(--transition);
}

.nav-icon-btn:hover {
  background: var(--glass-hover);
  color: var(--text);
  border-color: var(--glass-border-hover);
}

.notif-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  background: var(--grad);
  border-radius: 99px;
  font-size: 0.65rem;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--bg);
}

.nav-avatar-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border-radius: var(--radius-full);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  transition: var(--transition);
}

.nav-avatar-btn:hover {
  border-color: var(--glass-border-hover);
  background: var(--glass-hover);
}

.nav-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--glass-border);
  background: var(--bg-2);
  /* Placeholder bg */
}

.nav-username {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

/* ─── Search Dropdown ────────────────────────────────────────────────────────── */
#search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bg-3);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  z-index: 200;
  max-height: 320px;
  overflow-y: auto;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: var(--transition);
}

.search-result-item:hover {
  background: var(--glass-hover);
}

.search-result-item img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

/* ─── Profile Dropdown ───────────────────────────────────────────────────────── */
#profile-dropdown {
  position: fixed;
  top: calc(var(--nav-h) + 8px);
  right: 16px;
  background: var(--bg-3);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  z-index: 500;
  min-width: 200px;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  color: var(--text-2);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.dropdown-item:hover {
  background: var(--glass-hover);
  color: var(--text);
}

.dropdown-item.danger:hover {
  color: var(--danger);
}

.dropdown-divider {
  height: 1px;
  background: var(--glass-border);
  margin: 4px 0;
}

/* ─── Notification Panel ─────────────────────────────────────────────────────── */
#notif-panel {
  position: fixed;
  top: calc(var(--nav-h) + 8px);
  right: 60px;
  width: 340px;
  max-height: 480px;
  overflow-y: auto;
  background: var(--bg-3);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 500;
}

.notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--glass-border);
}

.notif-header h4 {
  font-size: 1rem;
  font-weight: 700;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  transition: var(--transition);
  cursor: pointer;
}

.notif-item:hover {
  background: var(--glass-hover);
}

.notif-item.unread {
  background: rgba(139, 92, 246, 0.06);
  border-left: 2px solid var(--primary);
}

.notif-item img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.notif-text {
  font-size: 0.875rem;
  line-height: 1.4;
}

.notif-time {
  font-size: 0.75rem;
  color: var(--text-3);
  margin-top: 2px;
}

/* ─── Main Layout ────────────────────────────────────────────────────────────── */
#main-content {
  padding-top: calc(var(--nav-h) + 20px);
  min-height: 100vh;
}

/* ─── Auth Page ──────────────────────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.auth-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: radial-gradient(ellipse 80% 60% at 20% 20%, rgba(124, 58, 237, 0.2) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 80%, rgba(236, 72, 153, 0.15) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 50% 50%, rgba(249, 115, 22, 0.08) 0%, transparent 60%),
    var(--bg);
}

.auth-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: -1;
  animation: float 8s ease-in-out infinite;
}

.auth-orb-1 {
  width: 400px;
  height: 400px;
  background: rgba(124, 58, 237, 0.25);
  top: -100px;
  left: -100px;
}

.auth-orb-2 {
  width: 300px;
  height: 300px;
  background: rgba(236, 72, 153, 0.2);
  bottom: -80px;
  right: -80px;
  animation-delay: -4s;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0) scale(1);
  }

  50% {
    transform: translateY(-20px) scale(1.05);
  }
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: rgba(22, 22, 31, 0.85);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border: 1px solid var(--glass-border);
  border-radius: 28px;
  padding: 40px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(139, 92, 246, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  animation: slideUp 0.6s var(--spring);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 600px) {
  .auth-card {
    padding: 28px 20px;
    border-radius: 20px;
  }
}


.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}

.auth-logo-icon {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  margin: 0 auto 12px;
  background: var(--grad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  box-shadow: 0 8px 32px rgba(124, 58, 237, 0.4);
}

.auth-logo h1 {
  font-size: 1.6rem;
  font-weight: 800;
  background: var(--grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-logo p {
  color: var(--text-3);
  font-size: 0.875rem;
  margin-top: 4px;
}

.auth-tabs {
  display: flex;
  background: var(--glass);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 28px;
}

.auth-tab {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-3);
  transition: var(--transition);
  text-align: center;
}

.auth-tab.active {
  background: var(--grad);
  color: white;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.95rem;
  transition: var(--transition);
  outline: none;
}

.form-group input:hover,
.form-group textarea:hover {
  border-color: rgba(139, 92, 246, 0.3);
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  background: var(--glass-hover);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15), inset 0 1px 2px rgba(139, 92, 246, 0.05);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-3);
}

.form-group input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px var(--glass) inset !important;
  -webkit-text-fill-color: var(--text) !important;
  caret-color: var(--primary) !important;
}

.form-group input:-webkit-autofill::first-line {
  font-size: 0.95rem;
}


.btn-submit {
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: var(--grad);
  color: white;
  font-size: 1rem;
  font-weight: 700;
  transition: var(--spring);
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.35);
  letter-spacing: 0.3px;
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(124, 58, 237, 0.5);
}

.btn-submit:active {
  transform: translateY(0);
}

.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid rgba(139, 92, 246, 0.15);
  font-size: 0.75rem;
  color: var(--text-3);
  letter-spacing: 0.3px;
  font-weight: 500;
}

/* --- Buttons ------------------------------------------------------------------ */
.btn-primary {
  padding: 10px 20px;
  border-radius: var(--radius-full);
  background: var(--grad);
  color: white;
  font-weight: 600;
  font-size: 0.875rem;
  transition: var(--spring);
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.45);
}

.btn-secondary {
  padding: 10px 20px;
  border-radius: var(--radius-full);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--text-2);
  font-weight: 600;
  font-size: 0.875rem;
  transition: var(--transition);
}

.btn-secondary:hover {
  background: var(--glass-hover);
  border-color: var(--glass-border-hover);
  color: var(--text);
}

.btn-danger {
  padding: 10px 20px;
  border-radius: var(--radius-full);
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--danger);
  font-weight: 600;
  font-size: 0.875rem;
  transition: var(--transition);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
}

.btn-sm {
  padding: 7px 14px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  transition: var(--spring);
}

.btn-sm.primary {
  background: var(--grad);
  color: white;
  box-shadow: 0 2px 10px rgba(124, 58, 237, 0.3);
}

.btn-sm.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.45);
}

.btn-sm.secondary {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--text-2);
}

.btn-sm.secondary:hover {
  background: var(--glass-hover);
  color: var(--text);
}

.btn-sm.danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--danger);
}

.btn-sm.danger:hover {
  background: rgba(239, 68, 68, 0.25);
}

.btn-sm:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* --- Cards -------------------------------------------------------------------- */
.card {
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  transition: var(--transition);
}

.card:hover {
  border-color: rgba(139, 92, 246, 0.2);
  box-shadow: var(--shadow-card), var(--shadow-glow);
}

/* --- Loading ------------------------------------------------------------------ */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
}

.spinner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid var(--glass-border);
  border-top-color: var(--primary);
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-3);
}

.empty-state .icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.empty-state h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
}

.empty-state p {
  font-size: 0.875rem;
}

/* --- Toast -------------------------------------------------------------------- */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: var(--bg-3);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  font-size: 0.9rem;
  font-weight: 500;
  min-width: 260px;
  max-width: 360px;
  animation: toastIn 0.35s var(--spring);
}

.toast.success {
  border-left: 3px solid var(--success);
}

.toast.error {
  border-left: 3px solid var(--danger);
}

.toast.warning {
  border-left: 3px solid var(--warning);
}

.toast.info {
  border-left: 3px solid var(--info);
}

.toast.removing {
  animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateX(110%);
  }
}

/* --- Modal -------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal {
  background: var(--bg-3);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6);
  animation: modalIn 0.35s var(--spring);
  max-height: 90vh;
  overflow-y: auto;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 24px 0;
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--glass);
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  font-size: 1rem;
}

.modal-close:hover {
  background: var(--glass-hover);
  color: var(--text);
}

.modal-body {
  padding: 20px 24px;
}

.modal-footer {
  padding: 0 24px 24px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* --- Stories Bar -------------------------------------------------------------- */
.stories-bar {
  display: flex;
  gap: 16px;
  padding: 20px 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.stories-bar::-webkit-scrollbar {
  display: none;
}

.story-bubble {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  flex-shrink: 0;
}

.story-ring {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  padding: 3px;
  background: var(--grad-story);
  position: relative;
  animation: storyPulse 3s ease-in-out infinite;
}

.story-ring.seen {
  background: rgba(255, 255, 255, 0.1);
  animation: none;
}

@keyframes storyPulse {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.4);
  }

  50% {
    box-shadow: 0 0 0 6px rgba(139, 92, 246, 0);
  }
}

.story-ring img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--bg);
}

.story-add-btn {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 2px dashed var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--text-3);
  transition: var(--transition);
  background: var(--glass);
}

.story-add-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(139, 92, 246, 0.1);
}

.story-name {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-2);
  text-align: center;
  max-width: 68px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- Story Viewer ------------------------------------------------------------- */
.story-viewer {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.story-viewer-media {
  max-width: 100%;
  max-height: 100vh;
  object-fit: contain;
}

.story-progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  gap: 4px;
  padding: 12px;
}

.story-progress-seg {
  flex: 1;
  height: 3px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 99px;
  overflow: hidden;
}

.story-progress-fill {
  height: 100%;
  background: white;
  border-radius: 99px;
  transition: width linear;
}

.story-viewer-header {
  position: absolute;
  top: 28px;
  left: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.story-viewer-header img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid white;
}

.story-viewer-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.story-viewer-caption {
  position: absolute;
  bottom: 40px;
  left: 20px;
  right: 20px;
  text-align: center;
  color: white;
  font-size: 1rem;
  font-weight: 500;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

/* --- Feed Layout -------------------------------------------------------------- */
.feed-layout {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px 40px;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
}

.feed-main {
  min-width: 0;
}

.feed-sidebar {
  position: sticky;
  top: calc(var(--nav-h) + 20px);
  height: fit-content;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* --- Create Post -------------------------------------------------------------- */
.create-post-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  transition: var(--transition);
}

.create-post-card:hover {
  border-color: rgba(139, 92, 246, 0.2);
}

.create-post-trigger {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.create-post-trigger img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
}

.create-post-input {
  flex: 1;
  padding: 12px 18px;
  background: var(--bg-2);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  color: var(--text-3);
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
}

.create-post-input:hover {
  border-color: var(--primary);
  color: var(--text-2);
  background: var(--glass);
}

.create-post-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--glass-border);
}

.create-post-action {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  color: var(--text-2);
  font-size: 0.85rem;
  font-weight: 500;
  transition: var(--transition);
  background: var(--glass);
}

.create-post-action:hover {
  background: var(--glass-hover);
  color: var(--text);
}

/* --- Post Card ---------------------------------------------------------------- */
.post-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  transition: var(--transition);
}

.post-card:hover {
  border-color: rgba(139, 92, 246, 0.15);
}

.post-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 18px 0;
}

.post-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  cursor: pointer;
  transition: var(--spring);
}

.post-avatar:hover {
  transform: scale(1.05);
}

.post-author {
  flex: 1;
}

.post-author-name {
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.post-author-name:hover {
  color: var(--primary);
}

.post-meta {
  font-size: 0.78rem;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.expiry-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
}

.expiry-badge.urgent {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.expiry-badge.warning {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.expiry-badge.ok {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.15);
}

.post-options {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: transparent;
  color: var(--text-3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  font-size: 1.1rem;
}

.post-options:hover {
  background: var(--glass-hover);
  color: var(--text);
}

.post-content {
  padding: 14px 18px;
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--text);
}

.post-image {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  cursor: pointer;
  transition: var(--transition);
}

.post-image:hover {
  opacity: 0.92;
}

.post-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  border-top: 1px solid var(--glass-border);
  font-size: 0.8rem;
  color: var(--text-3);
}

.post-reactions-display {
  display: flex;
  align-items: center;
  gap: 4px;
}

.post-actions {
  display: flex;
  gap: 4px;
  padding: 8px 12px;
  border-top: 1px solid var(--glass-border);
}

.post-action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
}

.post-action-btn:hover {
  background: var(--glass-hover);
  color: var(--text);
}

.post-action-btn.reacted {
  color: var(--primary-2);
}

.post-action-btn.saved {
  color: var(--warning);
}

/* --- Reaction Picker ---------------------------------------------------------- */
.reaction-picker-wrap {
  position: relative;
  flex: 1;
}

.reaction-picker {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) scale(0.8);
  background: var(--bg-3);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  padding: 8px 12px;
  display: flex;
  gap: 4px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: var(--spring);
  white-space: nowrap;
  z-index: 10;
}

.reaction-picker-wrap:hover .reaction-picker,
.reaction-picker-wrap:focus-within .reaction-picker {
  opacity: 1;
  pointer-events: all;
  transform: translateX(-50%) scale(1);
}

.reaction-emoji {
  font-size: 1.5rem;
  cursor: pointer;
  transition: var(--spring);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.reaction-emoji:hover {
  transform: scale(1.4) translateY(-4px);
  background: var(--glass-hover);
}

/* --- Comments ----------------------------------------------------------------- */
.comments-section {
  padding: 0 18px 16px;
}

.comment-input-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.comment-input-row img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.comment-input-wrap {
  flex: 1;
  display: flex;
  gap: 8px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  padding: 8px 14px;
  transition: var(--transition);
}

.comment-input-wrap:focus-within {
  border-color: var(--primary);
}

.comment-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 0.875rem;
}

.comment-input::placeholder {
  color: var(--text-3);
}

.comment-send-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 1rem;
  cursor: pointer;
  transition: var(--spring);
}

.comment-send-btn:hover {
  transform: scale(1.2);
}

.comment-item {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.comment-item img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.comment-bubble {
  background: var(--glass);
  border-radius: 14px 14px 14px 4px;
  padding: 10px 14px;
  flex: 1;
}

.comment-author {
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.comment-text {
  font-size: 0.875rem;
  line-height: 1.5;
}

.comment-time {
  font-size: 0.72rem;
  color: var(--text-3);
  margin-top: 4px;
}

/* --- Sidebar Widgets ---------------------------------------------------------- */
.sidebar-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 20px;
}

.sidebar-card h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-2);
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.suggestion-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}

.suggestion-item img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.suggestion-info {
  flex: 1;
  min-width: 0;
}

.suggestion-name {
  font-size: 0.875rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggestion-mutual {
  font-size: 0.75rem;
  color: var(--text-3);
}

.online-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--success);
  border: 2px solid var(--bg);
  position: absolute;
  bottom: 0;
  right: 0;
}

.avatar-wrap {
  position: relative;
  display: inline-block;
}

/*  Profile Page  */
.profile-page {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 16px 40px;
}

.profile-cover {
  height: 280px;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  background: var(--grad-soft);
  border: 1px solid var(--glass-border);
  margin-bottom: -60px;
}

.profile-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover-edit-btn {
  position: absolute;
  bottom: 16px;
  right: 16px;
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  color: white;
  font-size: 0.8rem;
  font-weight: 600;
  transition: var(--transition);
}

.cover-edit-btn:hover {
  background: rgba(0, 0, 0, 0.8);
}

.profile-info-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 80px 28px 28px;
  position: relative;
  margin-bottom: 16px;
}

.profile-avatar-wrap {
  position: absolute;
  top: -50px;
  left: 28px;
}

.profile-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--bg-3);
  box-shadow: 0 0 0 2px var(--primary), 0 8px 24px rgba(0, 0, 0, 0.4);
}

.avatar-edit-btn {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--grad);
  color: white;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-3);
  transition: var(--spring);
}

.avatar-edit-btn:hover {
  transform: scale(1.15);
}

.profile-name {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-bio {
  color: var(--text-2);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.profile-stats {
  display: flex;
  gap: 24px;
  margin-bottom: 20px;
}

.profile-stat {
  text-align: center;
}

.profile-stat-num {
  font-size: 1.4rem;
  font-weight: 800;
  background: var(--grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.profile-stat-label {
  font-size: 0.75rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.profile-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.profile-tabs {
  display: flex;
  gap: 4px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 16px;
}

.profile-tab {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-3);
  transition: var(--transition);
  text-align: center;
}

.profile-tab.active {
  background: var(--grad);
  color: white;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
}

.badge.admin {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge.verified {
  background: rgba(59, 130, 246, 0.15);
  color: var(--info);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

/*  Gallery Page  */
.gallery-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px 40px;
}

.gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.gallery-header h2 {
  font-size: 1.4rem;
  font-weight: 800;
}

.albums-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.album-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: var(--spring);
}

.album-card:hover {
  transform: translateY(-4px);
  border-color: rgba(139, 92, 246, 0.3);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3), var(--shadow-glow);
}

.album-cover {
  height: 140px;
  background: var(--grad-soft);
  position: relative;
  overflow: hidden;
}

.album-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.album-privacy-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 700;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.album-privacy-badge.public {
  background: rgba(16, 185, 129, 0.7);
  color: white;
}

.album-privacy-badge.friends {
  background: rgba(59, 130, 246, 0.7);
  color: white;
}

.album-privacy-badge.private {
  background: rgba(239, 68, 68, 0.7);
  color: white;
}

.album-info {
  padding: 12px;
}

.album-name {
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 2px;
}

.album-count {
  font-size: 0.75rem;
  color: var(--text-3);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.gallery-item {
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 1;
  position: relative;
  cursor: pointer;
  background: var(--glass);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.gallery-item:hover img {
  transform: scale(1.05);
}

.gallery-item-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, transparent 50%);
  opacity: 0;
  transition: var(--transition);
  display: flex;
  align-items: flex-end;
  padding: 10px;
}

.gallery-item:hover .gallery-item-overlay {
  opacity: 1;
}

.gallery-caption {
  font-size: 0.75rem;
  color: white;
  font-weight: 500;
}

.gallery-delete-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.8);
  color: white;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--transition);
}

.gallery-item:hover .gallery-delete-btn {
  opacity: 1;
}

.privacy-selector {
  display: flex;
  gap: 8px;
}

.privacy-option {
  flex: 1;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: var(--glass);
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.8rem;
  font-weight: 600;
}

.privacy-option.selected.public {
  border-color: var(--success);
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

.privacy-option.selected.friends {
  border-color: var(--info);
  background: rgba(59, 130, 246, 0.1);
  color: var(--info);
}

.privacy-option.selected.private {
  border-color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

.upload-progress {
  height: 6px;
  background: var(--glass-border);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 8px;
}

.upload-progress-fill {
  height: 100%;
  background: var(--grad);
  border-radius: 99px;
  transition: width 0.3s ease;
}

/*  Lightbox  */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 4000;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.lightbox img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.lightbox-caption {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  text-align: center;
}

/*  Friends Page  */
.friends-page {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 16px 40px;
}

.friends-page h2 {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 16px;
}

.friends-tabs {
  display: flex;
  gap: 4px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 20px;
}

.friends-tab {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-3);
  transition: var(--transition);
  text-align: center;
}

.friends-tab.active {
  background: var(--grad);
  color: white;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.friends-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.friend-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 24px 16px;
  text-align: center;
  transition: var(--spring);
}

.friend-card:hover {
  transform: translateY(-4px);
  border-color: rgba(139, 92, 246, 0.3);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

.friend-card img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 12px;
  border: 3px solid transparent;
  background: var(--grad);
  background-clip: padding-box;
}

.friend-card h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.friend-card p {
  font-size: 0.78rem;
  color: var(--text-3);
  margin-bottom: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.friend-card-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
}

/*  Messages Page  */
.messages-page {
  display: grid;
  grid-template-columns: 300px 1fr;
  height: calc(100vh - var(--nav-h) - 40px);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.conversations-list {
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.conv-header {
  padding: 20px;
  font-size: 1rem;
  font-weight: 800;
  border-bottom: 1px solid var(--glass-border);
  background: var(--glass);
}

#conv-list {
  flex: 1;
  overflow-y: auto;
}

.conv-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  transition: var(--transition);
}

.conv-item:hover {
  background: var(--glass-hover);
}

.conv-item.active {
  background: rgba(139, 92, 246, 0.1);
  border-left: 3px solid var(--primary);
}

.conv-item img {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.conv-info {
  flex: 1;
  min-width: 0;
}

.conv-name {
  font-weight: 700;
  font-size: 0.9rem;
}

.conv-last {
  font-size: 0.78rem;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
}

.conv-unread {
  background: var(--grad);
  color: white;
  border-radius: 99px;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  flex-shrink: 0;
}

.chat-area {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.no-chat-selected {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  gap: 12px;
}

.no-chat-selected .icon {
  font-size: 3rem;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--glass-border);
  background: var(--glass);
}

.chat-header img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.chat-header h4 {
  font-weight: 700;
}

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

.chat-empty {
  text-align: center;
  color: var(--text-3);
  font-size: 0.875rem;
  padding: 40px;
}

.message-bubble {
  max-width: 70%;
  padding: 10px 16px;
  border-radius: 18px;
  font-size: 0.9rem;
  line-height: 1.5;
  position: relative;
}

.message-bubble.sent {
  background: var(--grad);
  color: white;
  border-radius: 18px 18px 4px 18px;
  align-self: flex-end;
}

.message-bubble.received {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 18px 18px 18px 4px;
}

.message-time {
  font-size: 0.68rem;
  opacity: 0.6;
  margin-top: 4px;
}

.chat-input-area {
  display: flex;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--glass-border);
  background: var(--glass);
}

.chat-input {
  flex: 1;
  padding: 12px 18px;
  background: var(--bg-2);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
}

.chat-input:focus {
  border-color: var(--primary);
}

.chat-send-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--grad);
  color: white;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--spring);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.chat-send-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.5);
}

/*  Search Page  */
.search-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px 40px;
}

.search-page h2 {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 20px;
}

.search-bar-big {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  padding: 14px 20px;
  margin-bottom: 24px;
  transition: var(--transition);
}

.search-bar-big:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.search-bar-big input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 1rem;
}

.search-bar-big input::placeholder {
  color: var(--text-3);
}

.user-result-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  transition: var(--spring);
}

.user-result-card:hover {
  transform: translateX(4px);
  border-color: rgba(139, 92, 246, 0.3);
}

.user-result-card img {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
}

.user-result-info {
  flex: 1;
}

.user-result-info h4 {
  font-weight: 700;
  margin-bottom: 2px;
}

.user-result-info p {
  font-size: 0.8rem;
  color: var(--text-3);
}

/*  Admin Page  */
.admin-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px 40px;
}

.admin-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.admin-header h1 {
  font-size: 1.6rem;
  font-weight: 900;
  background: var(--grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.admin-badge {
  padding: 4px 14px;
  border-radius: var(--radius-full);
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--warning);
  font-size: 0.8rem;
  font-weight: 700;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  transition: var(--spring);
}

.stat-card:hover {
  transform: translateY(-3px);
  border-color: rgba(139, 92, 246, 0.3);
}

.stat-card.success {
  border-color: rgba(16, 185, 129, 0.2);
}

.stat-card.warning {
  border-color: rgba(245, 158, 11, 0.2);
}

.stat-card.danger {
  border-color: rgba(239, 68, 68, 0.2);
}

.stat-num {
  font-size: 2rem;
  font-weight: 900;
  background: var(--grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

.admin-tabs {
  display: flex;
  gap: 4px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.admin-tab {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-3);
  transition: var(--transition);
  text-align: center;
  white-space: nowrap;
}

.admin-tab.active {
  background: var(--grad);
  color: white;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.admin-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--glass-border);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.admin-table thead tr {
  background: var(--glass);
}

.admin-table th {
  padding: 14px 16px;
  text-align: left;
  font-weight: 700;
  color: var(--text-2);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--glass-border);
  white-space: nowrap;
}

.admin-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.admin-table tr:hover td {
  background: var(--glass-hover);
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-cell img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.role-badge {
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
}

.role-badge.admin {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.role-badge.user {
  background: var(--glass);
  color: var(--text-2);
  border: 1px solid var(--glass-border);
}

.banned-badge {
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
  font-size: 0.72rem;
  font-weight: 700;
}

.admin-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.admin-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.admin-gallery-item {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
}

.admin-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/*  Activity Log  */
.activity-log-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.activity-log-table th {
  padding: 12px 14px;
  text-align: left;
  font-weight: 700;
  color: var(--text-2);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--glass-border);
  background: var(--glass);
}

.activity-log-table td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  vertical-align: middle;
}

.activity-log-table tr:hover td {
  background: var(--glass-hover);
}

.action-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
}

.online-users-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.online-user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: var(--glass);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius-sm);
}

.online-user-card img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.online-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  flex-shrink: 0;
  box-shadow: 0 0 6px var(--success);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

/*  Responsive  */
@media (max-width: 768px) {
  .feed-layout {
    grid-template-columns: 1fr;
  }

  .feed-sidebar {
    display: none;
  }

  .messages-page {
    grid-template-columns: 1fr;
  }

  .conversations-list {
    display: none;
  }

  .nav-links {
    display: none;
  }

  .nav-username {
    display: none;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .friends-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* --- Profile Page ------------------------------------------------------------- */
.profile-page {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 16px 40px;
}

.profile-cover {
  height: 280px;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  background: var(--grad-soft);
  border: 1px solid var(--glass-border);
  margin-bottom: -60px;
}

.profile-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover-edit-btn {
  position: absolute;
  bottom: 16px;
  right: 16px;
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  color: white;
  font-size: 0.8rem;
  font-weight: 600;
  transition: var(--transition);
}

.cover-edit-btn:hover {
  background: rgba(0, 0, 0, 0.8);
}

.profile-info-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 80px 28px 28px;
  position: relative;
  margin-bottom: 16px;
}

.profile-avatar-wrap {
  position: absolute;
  top: -50px;
  left: 28px;
}

.profile-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--bg-3);
  box-shadow: 0 0 0 2px var(--primary), 0 8px 24px rgba(0, 0, 0, 0.4);
}

.avatar-edit-btn {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--grad);
  color: white;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-3);
  transition: var(--spring);
}

.avatar-edit-btn:hover {
  transform: scale(1.15);
}

.profile-name {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-bio {
  color: var(--text-2);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.profile-stats {
  display: flex;
  gap: 24px;
  margin-bottom: 20px;
}

.profile-stat {
  text-align: center;
}

.profile-stat-num {
  font-size: 1.4rem;
  font-weight: 800;
  background: var(--grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.profile-stat-label {
  font-size: 0.75rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.profile-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.profile-tabs {
  display: flex;
  gap: 4px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 16px;
}

.profile-tab {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-3);
  transition: var(--transition);
  text-align: center;
}

.profile-tab.active {
  background: var(--grad);
  color: white;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
}

.badge.admin {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge.verified {
  background: rgba(59, 130, 246, 0.15);
  color: var(--info);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

/* --- Gallery Page ------------------------------------------------------------- */
.gallery-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px 40px;
}

.gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.gallery-header h2 {
  font-size: 1.4rem;
  font-weight: 800;
}

.albums-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.album-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: var(--spring);
}

.album-card:hover {
  transform: translateY(-4px);
  border-color: rgba(139, 92, 246, 0.3);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3), var(--shadow-glow);
}

.album-cover {
  height: 140px;
  background: var(--grad-soft);
  position: relative;
  overflow: hidden;
}

.album-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.album-privacy-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 700;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.album-privacy-badge.public {
  background: rgba(16, 185, 129, 0.7);
  color: white;
}

.album-privacy-badge.friends {
  background: rgba(59, 130, 246, 0.7);
  color: white;
}

.album-privacy-badge.private {
  background: rgba(239, 68, 68, 0.7);
  color: white;
}

.album-info {
  padding: 12px;
}

.album-name {
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 2px;
}

.album-count {
  font-size: 0.75rem;
  color: var(--text-3);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.gallery-item {
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 1;
  position: relative;
  cursor: pointer;
  background: var(--glass);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.gallery-item:hover img {
  transform: scale(1.05);
}

.gallery-item-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, transparent 50%);
  opacity: 0;
  transition: var(--transition);
  display: flex;
  align-items: flex-end;
  padding: 10px;
}

.gallery-item:hover .gallery-item-overlay {
  opacity: 1;
}

.gallery-caption {
  font-size: 0.75rem;
  color: white;
  font-weight: 500;
}

.gallery-delete-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.8);
  color: white;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--transition);
}

.gallery-item:hover .gallery-delete-btn {
  opacity: 1;
}

.privacy-selector {
  display: flex;
  gap: 8px;
}

.privacy-option {
  flex: 1;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: var(--glass);
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.8rem;
  font-weight: 600;
}

.privacy-option.selected.public {
  border-color: var(--success);
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

.privacy-option.selected.friends {
  border-color: var(--info);
  background: rgba(59, 130, 246, 0.1);
  color: var(--info);
}

.privacy-option.selected.private {
  border-color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

.upload-progress {
  height: 6px;
  background: var(--glass-border);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 8px;
}

.upload-progress-fill {
  height: 100%;
  background: var(--grad);
  border-radius: 99px;
  transition: width 0.3s ease;
}

/* --- Lightbox ----------------------------------------------------------------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 4000;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.lightbox img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.lightbox-caption {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  text-align: center;
}

/* --- Friends Page ------------------------------------------------------------- */
.friends-page {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 16px 40px;
}

.friends-page h2 {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 16px;
}

.friends-tabs {
  display: flex;
  gap: 4px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 20px;
}

.friends-tab {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-3);
  transition: var(--transition);
  text-align: center;
}

.friends-tab.active {
  background: var(--grad);
  color: white;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.friends-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.friend-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 24px 16px;
  text-align: center;
  transition: var(--spring);
}

.friend-card:hover {
  transform: translateY(-4px);
  border-color: rgba(139, 92, 246, 0.3);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

.friend-card img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 12px;
  border: 3px solid transparent;
  background: var(--grad);
  background-clip: padding-box;
}

.friend-card h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.friend-card p {
  font-size: 0.78rem;
  color: var(--text-3);
  margin-bottom: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.friend-card-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
}

/* --- Messages Page ------------------------------------------------------------ */
.messages-page {
  display: grid;
  grid-template-columns: 300px 1fr;
  height: calc(100vh - var(--nav-h) - 40px);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.conversations-list {
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.conv-header {
  padding: 20px;
  font-size: 1rem;
  font-weight: 800;
  border-bottom: 1px solid var(--glass-border);
  background: var(--glass);
}

#conv-list {
  flex: 1;
  overflow-y: auto;
}

.conv-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  transition: var(--transition);
}

.conv-item:hover {
  background: var(--glass-hover);
}

.conv-item.active {
  background: rgba(139, 92, 246, 0.1);
  border-left: 3px solid var(--primary);
}

.conv-item img {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.conv-info {
  flex: 1;
  min-width: 0;
}

.conv-name {
  font-weight: 700;
  font-size: 0.9rem;
}

.conv-last {
  font-size: 0.78rem;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
}

.conv-unread {
  background: var(--grad);
  color: white;
  border-radius: 99px;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  flex-shrink: 0;
}

.chat-area {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.no-chat-selected {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  gap: 12px;
}

.no-chat-selected .icon {
  font-size: 3rem;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--glass-border);
  background: var(--glass);
}

.chat-header img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.chat-header h4 {
  font-weight: 700;
}

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

.chat-empty {
  text-align: center;
  color: var(--text-3);
  font-size: 0.875rem;
  padding: 40px;
}

.message-bubble {
  max-width: 70%;
  padding: 10px 16px;
  border-radius: 18px;
  font-size: 0.9rem;
  line-height: 1.5;
  position: relative;
}

.message-bubble.sent {
  background: var(--grad);
  color: white;
  border-radius: 18px 18px 4px 18px;
  align-self: flex-end;
}

.message-bubble.received {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 18px 18px 18px 4px;
}

.message-time {
  font-size: 0.68rem;
  opacity: 0.6;
  margin-top: 4px;
}

.chat-input-area {
  display: flex;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--glass-border);
  background: var(--glass);
}

.chat-input {
  flex: 1;
  padding: 12px 18px;
  background: var(--bg-2);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
}

.chat-input:focus {
  border-color: var(--primary);
}

.chat-send-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--grad);
  color: white;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--spring);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.chat-send-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.5);
}

/* --- Search Page -------------------------------------------------------------- */
.search-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px 40px;
}

.search-page h2 {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 20px;
}

.search-bar-big {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  padding: 14px 20px;
  margin-bottom: 24px;
  transition: var(--transition);
}

.search-bar-big:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.search-bar-big input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 1rem;
}

.search-bar-big input::placeholder {
  color: var(--text-3);
}

.user-result-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  transition: var(--spring);
}

.user-result-card:hover {
  transform: translateX(4px);
  border-color: rgba(139, 92, 246, 0.3);
}

.user-result-card img {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
}

.user-result-info {
  flex: 1;
}

.user-result-info h4 {
  font-weight: 700;
  margin-bottom: 2px;
}

.user-result-info p {
  font-size: 0.8rem;
  color: var(--text-3);
}

/* --- Admin Page --------------------------------------------------------------- */
.admin-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px 40px;
}

.admin-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.admin-header h1 {
  font-size: 1.6rem;
  font-weight: 900;
  background: var(--grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.admin-badge {
  padding: 4px 14px;
  border-radius: var(--radius-full);
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--warning);
  font-size: 0.8rem;
  font-weight: 700;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  transition: var(--spring);
}

.stat-card:hover {
  transform: translateY(-3px);
  border-color: rgba(139, 92, 246, 0.3);
}

.stat-card.success {
  border-color: rgba(16, 185, 129, 0.2);
}

.stat-card.warning {
  border-color: rgba(245, 158, 11, 0.2);
}

.stat-card.danger {
  border-color: rgba(239, 68, 68, 0.2);
}

.stat-num {
  font-size: 2rem;
  font-weight: 900;
  background: var(--grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

.admin-tabs {
  display: flex;
  gap: 4px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.admin-tab {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-3);
  transition: var(--transition);
  text-align: center;
  white-space: nowrap;
}

.admin-tab.active {
  background: var(--grad);
  color: white;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.admin-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--glass-border);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.admin-table thead tr {
  background: var(--glass);
}

.admin-table th {
  padding: 14px 16px;
  text-align: left;
  font-weight: 700;
  color: var(--text-2);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--glass-border);
  white-space: nowrap;
}

.admin-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.admin-table tr:hover td {
  background: var(--glass-hover);
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-cell img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.role-badge {
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
}

.role-badge.admin {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.role-badge.user {
  background: var(--glass);
  color: var(--text-2);
  border: 1px solid var(--glass-border);
}

.banned-badge {
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
  font-size: 0.72rem;
  font-weight: 700;
}

.admin-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.admin-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.admin-gallery-item {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
}

.admin-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --- Activity Log ------------------------------------------------------------- */
.activity-log-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.activity-log-table th {
  padding: 12px 14px;
  text-align: left;
  font-weight: 700;
  color: var(--text-2);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--glass-border);
  background: var(--glass);
}

.activity-log-table td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  vertical-align: middle;
}

.activity-log-table tr:hover td {
  background: var(--glass-hover);
}

.action-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
}

.online-users-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.online-user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: var(--glass);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius-sm);
}

.online-user-card img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.online-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  flex-shrink: 0;
  box-shadow: 0 0 6px var(--success);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

/* --- Responsive --------------------------------------------------------------- */
@media (max-width: 768px) {
  .feed-layout {
    grid-template-columns: 1fr;
  }

  .feed-sidebar {
    display: none;
  }

  .messages-page {
    grid-template-columns: 1fr;
  }

  .conversations-list {
    display: none;
  }

  .nav-links {
    display: none;
  }

  .nav-username {
    display: none;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .friends-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/*  Buttons  */
.btn-primary {
  padding: 10px 20px;
  border-radius: var(--radius-full);
  background: var(--grad);
  color: white;
  font-weight: 600;
  font-size: 0.875rem;
  transition: var(--spring);
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.45);
}

.btn-secondary {
  padding: 10px 20px;
  border-radius: var(--radius-full);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--text-2);
  font-weight: 600;
  font-size: 0.875rem;
  transition: var(--transition);
}

.btn-secondary:hover {
  background: var(--glass-hover);
  border-color: var(--glass-border-hover);
  color: var(--text);
}

.btn-danger {
  padding: 10px 20px;
  border-radius: var(--radius-full);
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--danger);
  font-weight: 600;
  font-size: 0.875rem;
  transition: var(--transition);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
}

.btn-sm {
  padding: 7px 14px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  transition: var(--spring);
}

.btn-sm.primary {
  background: var(--grad);
  color: white;
  box-shadow: 0 2px 10px rgba(124, 58, 237, 0.3);
}

.btn-sm.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.45);
}

.btn-sm.secondary {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--text-2);
}

.btn-sm.secondary:hover {
  background: var(--glass-hover);
  color: var(--text);
}

.btn-sm.danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--danger);
}

.btn-sm.danger:hover {
  background: rgba(239, 68, 68, 0.25);
}

.btn-sm:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/*  Cards  */
.card {
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  transition: var(--transition);
}

.card:hover {
  border-color: rgba(139, 92, 246, 0.2);
  box-shadow: var(--shadow-card), var(--shadow-glow);
}

/*  Loading  */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
}

.spinner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid var(--glass-border);
  border-top-color: var(--primary);
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-3);
}

.empty-state .icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.empty-state h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
}

.empty-state p {
  font-size: 0.875rem;
}

/*  Toast  */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: var(--bg-3);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  font-size: 0.9rem;
  font-weight: 500;
  min-width: 260px;
  max-width: 360px;
  animation: toastIn 0.35s var(--spring);
}

.toast.success {
  border-left: 3px solid var(--success);
}

.toast.error {
  border-left: 3px solid var(--danger);
}

.toast.warning {
  border-left: 3px solid var(--warning);
}

.toast.info {
  border-left: 3px solid var(--info);
}

.toast.removing {
  animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateX(110%);
  }
}

/*  Modal  */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal {
  background: var(--bg-3);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6);
  animation: modalIn 0.35s var(--spring);
  max-height: 90vh;
  overflow-y: auto;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 24px 0;
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--glass);
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  font-size: 1rem;
}

.modal-close:hover {
  background: var(--glass-hover);
  color: var(--text);
}

.modal-body {
  padding: 20px 24px;
}

.modal-footer {
  padding: 0 24px 24px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/*  Stories Bar  */
.stories-bar {
  display: flex;
  gap: 16px;
  padding: 20px 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.stories-bar::-webkit-scrollbar {
  display: none;
}

.story-bubble {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  flex-shrink: 0;
}

.story-ring {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  padding: 3px;
  background: var(--grad-story);
  position: relative;
  animation: storyPulse 3s ease-in-out infinite;
}

.story-ring.seen {
  background: rgba(255, 255, 255, 0.1);
  animation: none;
}

@keyframes storyPulse {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.4);
  }

  50% {
    box-shadow: 0 0 0 6px rgba(139, 92, 246, 0);
  }
}

.story-ring img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--bg);
}

.story-add-btn {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 2px dashed var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--text-3);
  transition: var(--transition);
  background: var(--glass);
}

.story-add-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(139, 92, 246, 0.1);
}

.story-name {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-2);
  text-align: center;
  max-width: 68px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/*  Story Viewer  */
.story-viewer {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.story-viewer-media {
  max-width: 100%;
  max-height: 100vh;
  object-fit: contain;
}

.story-progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  gap: 4px;
  padding: 12px;
}

.story-progress-seg {
  flex: 1;
  height: 3px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 99px;
  overflow: hidden;
}

.story-progress-fill {
  height: 100%;
  background: white;
  border-radius: 99px;
  transition: width linear;
}

.story-viewer-header {
  position: absolute;
  top: 28px;
  left: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.story-viewer-header img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid white;
}

.story-viewer-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.story-viewer-caption {
  position: absolute;
  bottom: 40px;
  left: 20px;
  right: 20px;
  text-align: center;
  color: white;
  font-size: 1rem;
  font-weight: 500;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

/*  Feed Layout  */
.feed-layout {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px 40px;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
}

.feed-main {
  min-width: 0;
}

.feed-sidebar {
  position: sticky;
  top: calc(var(--nav-h) + 20px);
  height: fit-content;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/*  Create Post  */
.create-post-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  transition: var(--transition);
}

.create-post-card:hover {
  border-color: rgba(139, 92, 246, 0.2);
}

.create-post-trigger {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.create-post-trigger img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
}

.create-post-input {
  flex: 1;
  padding: 12px 18px;
  background: var(--bg-2);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  color: var(--text-3);
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
}

.create-post-input:hover {
  border-color: var(--primary);
  color: var(--text-2);
  background: var(--glass);
}

.create-post-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--glass-border);
}

.create-post-action {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  color: var(--text-2);
  font-size: 0.85rem;
  font-weight: 500;
  transition: var(--transition);
  background: var(--glass);
}

.create-post-action:hover {
  background: var(--glass-hover);
  color: var(--text);
}

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

.post-card:hover {
  border-color: rgba(139, 92, 246, 0.15);
}

.post-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 18px 0;
}

.post-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  cursor: pointer;
  transition: var(--spring);
}

.post-avatar:hover {
  transform: scale(1.05);
}

.post-author {
  flex: 1;
}

.post-author-name {
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.post-author-name:hover {
  color: var(--primary);
}

.post-meta {
  font-size: 0.78rem;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.expiry-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
}

.expiry-badge.urgent {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.expiry-badge.warning {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.expiry-badge.ok {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.15);
}

.post-options {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: transparent;
  color: var(--text-3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  font-size: 1.1rem;
}

.post-options:hover {
  background: var(--glass-hover);
  color: var(--text);
}

.post-content {
  padding: 14px 18px;
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--text);
}

.post-image {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  cursor: pointer;
  transition: var(--transition);
}

.post-image:hover {
  opacity: 0.92;
}

.post-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  border-top: 1px solid var(--glass-border);
  font-size: 0.8rem;
  color: var(--text-3);
}

.post-reactions-display {
  display: flex;
  align-items: center;
  gap: 4px;
}

.post-actions {
  display: flex;
  gap: 4px;
  padding: 8px 12px;
  border-top: 1px solid var(--glass-border);
}

.post-action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
}

.post-action-btn:hover {
  background: var(--glass-hover);
  color: var(--text);
}

.post-action-btn.reacted {
  color: var(--primary-2);
}

.post-action-btn.saved {
  color: var(--warning);
}

/*  Reaction Picker  */
.reaction-picker-wrap {
  position: relative;
  flex: 1;
}

.reaction-picker {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) scale(0.8);
  background: var(--bg-3);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  padding: 8px 12px;
  display: flex;
  gap: 4px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: var(--spring);
  white-space: nowrap;
  z-index: 10;
}

.reaction-picker-wrap:hover .reaction-picker,
.reaction-picker-wrap:focus-within .reaction-picker {
  opacity: 1;
  pointer-events: all;
  transform: translateX(-50%) scale(1);
}

.reaction-emoji {
  font-size: 1.5rem;
  cursor: pointer;
  transition: var(--spring);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.reaction-emoji:hover {
  transform: scale(1.4) translateY(-4px);
  background: var(--glass-hover);
}

/*  Comments  */
.comments-section {
  padding: 0 18px 16px;
}

.comment-input-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.comment-input-row img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.comment-input-wrap {
  flex: 1;
  display: flex;
  gap: 8px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  padding: 8px 14px;
  transition: var(--transition);
}

.comment-input-wrap:focus-within {
  border-color: var(--primary);
}

.comment-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 0.875rem;
}

.comment-input::placeholder {
  color: var(--text-3);
}

.comment-send-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 1rem;
  cursor: pointer;
  transition: var(--spring);
}

.comment-send-btn:hover {
  transform: scale(1.2);
}

.comment-item {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.comment-item img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.comment-bubble {
  background: var(--glass);
  border-radius: 14px 14px 14px 4px;
  padding: 10px 14px;
  flex: 1;
}

.comment-author {
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.comment-text {
  font-size: 0.875rem;
  line-height: 1.5;
}

.comment-time {
  font-size: 0.72rem;
  color: var(--text-3);
  margin-top: 4px;
}

/*  Sidebar Widgets  */
.sidebar-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 20px;
}

.sidebar-card h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-2);
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.suggestion-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}

.suggestion-item img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.suggestion-info {
  flex: 1;
  min-width: 0;
}

.suggestion-name {
  font-size: 0.875rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggestion-mutual {
  font-size: 0.75rem;
  color: var(--text-3);
}

.online-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--success);
  border: 2px solid var(--bg);
  position: absolute;
  bottom: 0;
  right: 0;
}

.avatar-wrap {
  position: relative;
  display: inline-block;
}

/* ─── Gallery Page ─────────────────────────────────────────────────────────── */
.gallery-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px 40px;
}

.gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.gallery-header h2 {
  font-size: 1.4rem;
  font-weight: 800;
}

/* ─── Albums Grid ──────────────────────────────────────────────────────────── */
.albums-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.album-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.album-card:hover {
  transform: translateY(-4px);
  border-color: rgba(139, 92, 246, 0.4);
  box-shadow: 0 8px 32px rgba(139, 92, 246, 0.15);
}

.album-cover {
  width: 100%;
  aspect-ratio: 1;
  background: var(--bg-3);
  position: relative;
  overflow: hidden;
}

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

.album-privacy-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.album-privacy-badge.public {
  background: rgba(16, 185, 129, 0.25);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.album-privacy-badge.friends {
  background: rgba(59, 130, 246, 0.25);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.album-privacy-badge.private {
  background: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.album-info {
  padding: 12px;
}

.album-name {
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.album-count {
  font-size: 0.75rem;
  color: var(--text-3);
}

/* ─── Photos Grid ──────────────────────────────────────────────────────────── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.gallery-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-3);
  border: 1px solid var(--glass-border);
  transition: transform var(--transition), box-shadow var(--transition);
}

.gallery-item:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 1;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--transition);
}

.gallery-item:hover img {
  transform: scale(1.05);
}

.gallery-item-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, transparent 50%);
  opacity: 0;
  transition: opacity var(--transition);
  display: flex;
  align-items: flex-end;
  padding: 10px;
}

.gallery-item:hover .gallery-item-overlay {
  opacity: 1;
}

.gallery-caption {
  font-size: 0.78rem;
  color: white;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}

.gallery-delete-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.85);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition), transform var(--transition);
  backdrop-filter: blur(4px);
  border: none;
  cursor: pointer;
}

.gallery-item:hover .gallery-delete-btn {
  opacity: 1;
}

.gallery-delete-btn:hover {
  transform: scale(1.15);
  background: rgba(239, 68, 68, 1);
}

/* ─── Privacy Selector ─────────────────────────────────────────────────────── */
.privacy-selector {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.privacy-option {
  flex: 1;
  min-width: 80px;
  padding: 10px 8px;
  border-radius: var(--radius-sm);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  text-align: center;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-2);
}

.privacy-option:hover {
  background: var(--glass-hover);
  color: var(--text);
}

.privacy-option.selected {
  background: rgba(139, 92, 246, 0.2);
  border-color: var(--primary);
  color: var(--text);
}

/* ─── Upload Progress ──────────────────────────────────────────────────────── */
.upload-progress {
  height: 6px;
  background: var(--glass);
  border-radius: 99px;
  overflow: hidden;
}

.upload-progress-fill {
  height: 100%;
  background: var(--grad);
  border-radius: 99px;
  transition: width 0.3s ease;
}

/* ─── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
  }

  .albums-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
  }

  .gallery-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ─── Lightbox ─────────────────────────────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.lightbox img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.8);
  animation: modalIn 0.3s var(--spring);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.lightbox-caption {
  margin-top: 16px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  text-align: center;
  max-width: 600px;
}

/* ─── Messages Page ─────────────────────────────────────────────────────────── */
.messages-page {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 0;
  height: calc(100vh - var(--nav-h) - 60px);
  min-height: 500px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  overflow: hidden;
}

/* Conversations sidebar */
.conversations-list {
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.conv-header {
  padding: 16px 20px;
  font-size: 1rem;
  font-weight: 700;
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
}

#conv-list {
  flex: 1;
  overflow-y: auto;
}

.conv-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  transition: background var(--transition);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.conv-item:hover {
  background: var(--glass-hover);
}

.conv-item.active {
  background: rgba(139, 92, 246, 0.12);
  border-left: 3px solid var(--primary);
}

.conv-item img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.conv-info {
  flex: 1;
  min-width: 0;
}

.conv-name {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conv-last {
  font-size: 0.78rem;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.conv-unread {
  background: var(--primary);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: 99px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  flex-shrink: 0;
}

/* Chat area */
.chat-area {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.no-chat-selected {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  gap: 12px;
}

.no-chat-selected .icon {
  font-size: 3rem;
}

.no-chat-selected p {
  font-size: 0.9rem;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
}

.chat-header img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.chat-header h4 {
  font-size: 0.95rem;
  font-weight: 700;
}

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

.chat-empty {
  text-align: center;
  color: var(--text-3);
  font-size: 0.9rem;
  margin: auto;
}

.message-bubble {
  max-width: 70%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 0.9rem;
  line-height: 1.5;
  word-break: break-word;
  position: relative;
  transition: transform 0.2s ease;
}

.message-wrapper {
  margin-bottom: 2px;
  width: 100%;
}

.message-wrapper:hover .message-bubble {
  transform: translateY(-2px);
}

.message-bubble.sent {
  background: var(--primary);
  color: white;
  border-bottom-right-radius: 4px;
}

.message-bubble.received {
  background: var(--glass-hover);
  border: 1px solid var(--glass-border);
  color: var(--text);
  border-bottom-left-radius: 4px;
}

.edited-tag {
  font-size: 0.65rem;
  opacity: 0.5;
  margin-left: 5px;
  font-style: italic;
}

.message-time {
  font-size: 0.65rem;
  opacity: 0.65;
  margin-top: 4px;
  text-align: right;
}

/* Reactions */
.reactions-container {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.msg-reactions {
  display: flex;
  gap: 4px;
  background: var(--glass);
  padding: 2px 6px;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(4px);
}

.reaction-badge {
  font-size: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 2px;
}

.reaction-badge .count {
  font-weight: 700;
  font-size: 0.7rem;
}

/* Context Menu */
.msg-context-menu {
  position: fixed;
  z-index: 10000;
  min-width: 180px;
  background: var(--bg-2);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  animation: modalIn 0.2s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.reaction-bar {
  display: flex;
  justify-content: space-around;
  padding: 10px;
  border-bottom: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.03);
}

.reaction-bar span {
  font-size: 1.4rem;
  cursor: pointer;
  transition: transform 0.2s;
}

.reaction-bar span:hover {
  transform: scale(1.3);
}

.menu-items {
  padding: 5px 0;
}

.menu-item {
  padding: 10px 16px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  gap: 10px;
}

.menu-item:hover {
  background: var(--glass-hover);
}

.menu-item.danger {
  color: #ff4d4d;
}

.editing-active {
  border-color: var(--warning) !important;
  background: rgba(255, 165, 0, 0.05) !important;
}

/* Typing Indicator */
.typing-status {
  font-size: 0.7rem;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 4px;
  height: 16px;
}

.typing-indicator {
  display: inline-flex;
  gap: 3px;
  align-items: center;
}

.typing-indicator span {
  width: 5px;
  height: 5px;
  background: var(--primary);
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) {
  animation-delay: 0s;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingBounce {

  0%,
  80%,
  100% {
    transform: scale(0);
    opacity: 0.4;
  }

  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Date Banners */
.chat-date-banner {
  text-align: center;
  margin: 12px 0 8px;
  position: relative;
}

.chat-date-banner::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--glass-border);
}

.chat-date-banner::after {
  content: attr(data-label);
}

.chat-date-banner {
  font-size: 0.72rem;
  color: var(--text-3);
  font-weight: 600;
  letter-spacing: 0.3px;
}

.chat-date-banner>* {
  position: relative;
}

.chat-date-banner {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.chat-date-banner::before,
.chat-date-banner::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--glass-border);
  position: static;
}


.chat-input-area {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--glass-border);
  flex-shrink: 0;
}

.chat-input {
  flex: 1;
  padding: 10px 16px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
}

.chat-input:focus {
  border-color: var(--primary);
  background: var(--glass-hover);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.chat-input::placeholder {
  color: var(--text-3);
}

.chat-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--grad);
  color: white;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--spring);
  box-shadow: 0 2px 10px rgba(124, 58, 237, 0.35);
}

.chat-send-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.5);
}

@media (max-width: 640px) {
  .messages-page {
    grid-template-columns: 1fr;
    grid-template-rows: 200px 1fr;
  }

  .conversations-list {
    border-right: none;
    border-bottom: 1px solid var(--glass-border);
  }
}

/* ─── Search Page ───────────────────────────────────────────────────────────── */
.search-page {
  max-width: 700px;
  margin: 0 auto;
  padding: 0 16px 40px;
}

.search-page h2 {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 20px;
}

.search-bar-big {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  padding: 12px 20px;
  margin-bottom: 24px;
  transition: var(--transition);
}

.search-bar-big:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.search-bar-big input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 1rem;
}

.search-bar-big input::placeholder {
  color: var(--text-3);
}

.search-results {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.user-result-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 16px;
  transition: var(--transition);
}

.user-result-card:hover {
  border-color: rgba(139, 92, 246, 0.3);
  background: var(--glass-hover);
}

.user-result-card img {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.user-result-info {
  flex: 1;
  min-width: 0;
}

.user-result-info h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.user-result-info p {
  font-size: 0.8rem;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── Story Viewer ──────────────────────────────────────────────────────────── */
.story-viewer {
  position: fixed;
  inset: 0;
  z-index: 9500;
  background: black;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.story-progress-bar {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  gap: 4px;
  z-index: 10;
}

.story-progress-seg {
  flex: 1;
  height: 3px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  overflow: hidden;
}

.story-progress-fill {
  background: white;
  height: 100%;
  width: 0;
}

.story-viewer-header {
  position: absolute;
  top: 24px;
  left: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 10;
}

.story-viewer-header img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.story-viewer-media {
  max-width: 100vw;
  max-height: 100vh;
  object-fit: contain;
}

.story-viewer-caption {
  position: absolute;
  bottom: 40px;
  left: 0;
  right: 0;
  text-align: center;
  color: white;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
  font-size: 1.1rem;
  padding: 0 20px;
  z-index: 10;
}

.story-controls-top-right {
  position: absolute;
  top: 24px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 20;
}

.story-control-btn {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.story-control-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

.story-control-btn.danger {
  background: rgba(239, 68, 68, 0.6);
  border-color: rgba(239, 68, 68, 0.4);
}

.story-control-btn.danger:hover {
  background: rgba(239, 68, 68, 0.8);
}

.story-viewer-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  transition: transform 0.2s, background 0.2s;
}

.story-viewer-close:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: scale(1.1);
}

/* Story Rings */
.story-ring {
  padding: 2px;
  border-radius: 50%;
  background: var(--grad-story);
}

.story-ring.seen {
  background: var(--glass-border);
}

.story-ring img {
  border: 2px solid var(--bg);
  border-radius: 50%;
  display: block;
}

/* ─── Mobile Responsiveness ────────────────────────────────────────────────── */
@media (max-width: 768px) {
  :root {
    --nav-h: 56px;
  }

  /* Navbar */
  .nav-links,
  .nav-search-wrap,
  .nav-actions,
  .nav-username,
  .nav-avatar-btn span {
    display: none !important;
  }

  #navbar {
    justify-content: center;
    padding: 0 16px;
    box-shadow: 0 1px 12px rgba(0, 0, 0, 0.4);
    border-bottom: 1px solid var(--glass-border);
    background: rgba(10, 10, 15, 0.75);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
  }

  [data-theme="light"] #navbar {
    background: rgba(255, 255, 255, 0.85);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 1px 12px resgba(0, 0, 0, 0.05);
  }

  .nav-search-icon,
  #notif-btn {
    display: none !important;
  }

  .nav-brand {
    transform: scale(1.05);
    font-weight: 800;
  }

  /* Bottom Nav Accessibility */
  .bottom-nav-item {
    flex: 1;
    /* Uniform width for better hit targets */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-3);
    position: relative;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.1s ease;
  }

  .bottom-nav-item:active {
    transform: scale(0.92);
    /* Tap feedback */
  }

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

  .bottom-nav-item.active .nav-label {
    opacity: 1;
    font-weight: 700;
  }

  /* Bottom Nav */
  #bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 72px;
    /* Increased for labels */
    background: var(--nav-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid var(--glass-border);
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.3);
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .nav-label {
    display: block;
    font-size: 0.65rem;
    font-weight: 600;
    margin-top: 4px;
    letter-spacing: 0.02em;
    opacity: 0.8;
  }

  .bottom-nav-item.active .nav-label {
    opacity: 1;
  }

  [data-theme="light"] #bottom-nav {
    background: rgba(255, 255, 255, 0.85);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
  }

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

  .bottom-nav-item img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid transparent;
    transition: var(--transition);
    background: var(--bg-2);
  }

  .bottom-nav-item.active img {
    border-color: var(--primary);
    transform: scale(1.1);
  }

  .bottom-nav-item .nav-icon {
    font-size: 1.5rem;
    line-height: 1;
    transition: transform 0.2s var(--spring), color 0.2s;
  }

  .add-icon-wrap {
    background: var(--grad);
    width: 42px;
    height: 42px;
    border-radius: 14px;
    /* Squircle style */
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
    margin-bottom: -2px;
  }

  .add-post-btn .nav-icon {
    font-size: 1.2rem;
    color: white !important;
  }

  .mobile-only-flex {
    display: none !important;
  }

  @media (max-width: 768px) {
    .mobile-only-flex {
      display: flex !important;
    }

    #theme-toggle-top {
      font-size: 1.2rem;
      padding: 8px;
    }
  }
}

/* ─── Layout ─────────────────────────────────────────────────────────────────── */
#main-content {
  padding-bottom: 80px;
  padding-top: calc(var(--nav-h) + 30px);
}

.feed-layout {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 0;
}

.feed-sidebar {
  display: none;
}

.feed-main {
  width: 100%;
  gap: 0;
  /* Remove gap between posts to use native borders */
  display: flex;
  flex-direction: column;
}

.create-post-card {
  border-radius: 0;
  border: none;
  border-bottom: 5px solid var(--glass-border);
  margin: -10px 0 0;
  padding: 16px;
  width: 100%;
  background: var(--bg);
}

.post-card {
  border-radius: 0;
  border: none;
  border-bottom: 5px solid var(--glass-border);
  margin: 0;
  padding: 16px 16px;
  width: 100%;
  background: var(--bg);
}

.post-header {
  margin-bottom: 12px;
}

.post-content {
  margin-bottom: 12px;
}

/* Make post images full width natively */
.post-image {
  margin-left: -16px;
  width: calc(100% + 32px);
  max-width: none;
  /* Intentional for edge-to-edge */
  border-radius: 0;
}


/* Messages Page Mobile */
.messages-page {
  display: block;
  width: 100%;
  height: calc(100vh - var(--nav-h) - 70px);
  border: none;
  background: transparent;
  border-radius: 0;
}

.conversations-list {
  width: 100%;
  height: 100%;
  border-right: none;
}

.chat-area {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2000;
  background: var(--bg);
  height: 100%;
}

.messages-page.show-chat .chat-area {
  display: flex;
  flex-direction: column;
}

.messages-page.show-chat .conversations-list {
  display: none;
}

.mobile-chat-back {
  display: flex !important;
  margin-right: 12px;
  font-size: 1.4rem;
  cursor: pointer;
}

.chat-header {
  padding-top: calc(10px + env(safe-area-inset-top));
}

/* ─── Messenger Alerts Section ────────────────────────────────────────────── */
.messenger-alerts-section {
  padding: 16px 0;
  border-bottom: 1px solid var(--glass-border);
  margin-bottom: 8px;
}

.alerts-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.alerts-badge {
  background: var(--danger);
  color: white;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.7rem;
}

.alerts-scroll-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 0 16px;
  scrollbar-width: none;
}

.alerts-scroll-row::-webkit-scrollbar {
  display: none;
}

.alert-mini-item {
  position: relative;
  flex: 0 0 52px;
  height: 52px;
  cursor: pointer;
}

.alert-mini-item img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary);
  padding: 2px;
  background: var(--bg);
}

.alert-mini-item.unread .alert-dot {
  position: absolute;
  top: 0;
  right: 0;
  width: 12px;
  height: 12px;
  background: var(--primary);
  border: 2px solid var(--bg);
  border-radius: 50%;
}

.alert-mini-item:not(.unread) img {
  border-color: var(--glass-border);
}

/* ─── Mobile Adjustments ─────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .post-actions {
    gap: 4px;
  }

  .post-action-btn {
    padding: 8px 10px;
    font-size: 0.8rem;
    flex: 1;
    justify-content: center;
  }

  /* Hide text on very small screens, keep icons */
  .post-action-btn span {
    display: none;
  }
}

@media (max-width: 380px) {
  .post-action-btn {
    font-size: 0;
    /* Hide text */
  }

  .post-action-btn::before {
    font-size: 1.1rem;
    content: attr(data-icon);
  }

  /* Manually show icons if not using data attribute yet */
  #react-btn-content {
    display: none;
  }
}

/* Typography & Spacing Polish */
body {
  font-size: 15px;
}

h1,
h2,
h3,
h4 {
  letter-spacing: -0.02em;
}

.post-header .author-name {
  font-size: 0.95rem;
  font-weight: 700;
}

.post-content {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text);
}

.post-stats {
  padding: 12px 0 4px;
  font-size: 0.85rem;
  color: var(--text-2);
}

.post-actions {
  border-top: 1px solid var(--glass-border);
  padding-top: 8px;
  margin-top: 8px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ─── Mobile Profile Fixes ───────────────────────────────────────────────────── */
.cover-edit-btn {
  position: absolute;
  bottom: 16px;
  right: 16px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  z-index: 10;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}

.admin-user-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  padding: 16px 0;
}

.admin-user-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 16px;
  transition: var(--transition);
}

.admin-user-card.banned {
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.05);
}

.admin-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

/* ─── Admin Tables ───────────────────────────────────────────────────────────── */
.admin-table-wrap {
  width: 100%;
  overflow-x: auto;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  margin-bottom: 24px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.admin-table th,
.admin-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--glass-border);
  font-size: 0.9rem;
}

.admin-table th {
  font-weight: 700;
  color: var(--text-2);
  background: rgba(0, 0, 0, 0.2);
}

.admin-table tbody tr:hover {
  background: var(--glass-hover);
}

.admin-table td button {
  white-space: nowrap;
}

/* ─── Friends Search ─────────────────────────────────────────────────────────── */
.friends-search-bar input {
  width: 100%;
  padding: 12px 16px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition);
}

.friends-search-bar input:focus {
  border-color: var(--primary);
  background: var(--glass-hover);
}


.cover-edit-btn:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: translateY(-2px);
}

@media (max-width: 600px) {
  .cover-edit-btn {
    bottom: 12px;
    right: 12px;
    padding: 6px 10px;
    font-size: 0.75rem;
  }

  .profile-actions {
    flex-wrap: wrap;
  }

  .profile-actions button {
    flex: 1;
    white-space: nowrap;
  }

  /* Fix Reaction Picker on Mobile */
  .reaction-picker {
    left: 50%;
    transform: translateX(-50%) translateY(12px) scale(0.8);
    transform-origin: top center;
    bottom: auto;
    top: calc(100% + 8px);
  }

  .reaction-picker-wrap:hover .reaction-picker,
  .reaction-picker-wrap:focus-within .reaction-picker {
    opacity: 1;
    pointer-events: all;
    transform: translateX(-50%) translateY(0) scale(1);
  }

  /* Fixed Dropdowns for Mobile */
  #notif-panel,
  #profile-dropdown {
    position: fixed;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) scale(1) !important;
    width: 90% !important;
    max-width: 360px !important;
    max-height: 70vh;
    border-radius: var(--radius);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    z-index: 10000;
  }

  .notif-panel.hidden,
  .profile-dropdown.hidden {
    display: none !important;
  }

  /* Friends Page Mobile Fixes */
  .friends-page {
    padding: 0 12px 40px;
  }

  .friends-tabs {
    overflow-x: auto;
    white-space: nowrap;
    justify-content: flex-start;
    padding: 6px;
    gap: 8px;
    scrollbar-width: none;
  }

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

  .friends-tab {
    flex: 0 0 auto;
    padding: 8px 16px;
    font-size: 0.8rem;
  }
}

/* Fix image corners since card overflow is visible */
.post-image {
  border-radius: var(--radius-sm);
  margin-top: -1px;
  /* overlapping border fix */
}

/* ─── Reels ──────────────────────────────────────────────────────────────────── */
.reels-page {
  max-width: 480px;
  margin: 0 auto;
  padding: 0;
  height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
}

.reels-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--glass-border);
}

.reels-header h2 {
  font-size: 1.3rem;
  font-weight: 800;
  margin: 0;
}

.reels-container {
  flex: 1;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.reels-container::-webkit-scrollbar {
  display: none;
}

.reels-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-3);
  gap: 8px;
}

.reels-empty .icon {
  font-size: 3rem;
}

.reel-item {
  scroll-snap-align: start;
  height: calc(100vh - 140px);
  position: relative;
  background: #000;
  border-radius: 16px;
  overflow: hidden;
  margin: 6px 0;
}

.reel-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
}

.reel-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 60px;
  padding: 20px 16px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  color: white;
  pointer-events: none;
}

.reel-overlay>* {
  pointer-events: auto;
}

.reel-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  cursor: pointer;
}

.reel-user-info img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.5);
}

.reel-user-info span {
  font-weight: 700;
  font-size: 0.9rem;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.reel-caption {
  font-size: 0.85rem;
  line-height: 1.4;
  max-height: 60px;
  overflow: hidden;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.reel-actions {
  position: absolute;
  right: 10px;
  bottom: 80px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  z-index: 5;
}

.reel-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 1.5rem;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.5));
  transition: transform 0.2s;
}

.reel-action-btn:active {
  transform: scale(1.3);
}

.reel-action-btn.liked span:first-child {
  animation: heartPop 0.4s cubic-bezier(0.17, 0.89, 0.32, 1.49);
}

@keyframes heartPop {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.4);
  }

  100% {
    transform: scale(1);
  }
}

.reel-action-btn .count {
  font-size: 0.7rem;
  font-weight: 700;
}

/* Reel Comments Panel */
.reel-comments-panel {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: var(--bg-2);
  border-radius: 16px 16px 0 0;
  flex-direction: column;
  z-index: 10;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }

  to {
    transform: translateY(0);
  }
}

.reel-comments-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.reel-comment {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  align-items: flex-start;
}

.reel-comment img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.reel-comment div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.85rem;
}

.reel-comment strong {
  font-size: 0.8rem;
  color: var(--text-2);
}

.reel-comment-input {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--glass-border);
}

.reel-comment-input input {
  flex: 1;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 8px 14px;
  color: var(--text);
  font-size: 0.85rem;
  outline: none;
}

.reel-comment-input button {
  background: var(--primary);
  border: none;
  color: white;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
}

.reel-comment-input button:hover {
  opacity: 0.85;
}

@media (max-width: 768px) {
  .reels-page {
    height: calc(100vh - 120px);
  }

  .reel-item {
    border-radius: 0;
    margin: 0;
    height: calc(100vh - 180px);
  }
}

/* ─── Floating Action Button (Mobile) ────────────────────────────────────────── */
.fab-camera {
  display: none;
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #ec4899);
  border: none;
  color: white;
  font-size: 1.8rem;
  font-weight: 300;
  cursor: pointer;
  z-index: 999;
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.5);
  transition: transform 0.3s cubic-bezier(0.17, 0.89, 0.32, 1.49), box-shadow 0.3s;
  align-items: center;
  justify-content: center;
}

.fab-camera:not(.hidden) {
  display: flex;
}

.fab-camera:active {
  transform: scale(0.9) rotate(45deg);
}

.fab-camera:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 28px rgba(124, 58, 237, 0.6);
}

.fab-camera span {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}


/* Camera Options */
.camera-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.camera-option-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  width: 100%;
  font-size: 1rem;
  font-weight: 600;
}

.camera-option-btn:hover {
  background: var(--glass-hover);
  transform: translateX(4px);
}

.camera-option-icon {
  font-size: 1.6rem;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(124, 58, 237, 0.1);
  border-radius: 12px;
}

.camera-option-desc {
  display: block;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-3);
  margin-top: 2px;
}

/* ─── Reels Page ──────────────────────────────────────────────────────────── */
.reels-page {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--nav-h));
  max-width: 100%;
  margin: 0;
  padding: 0;
  background: #000;
}

@media (max-width: 768px) {
  .reels-page {
    height: calc(100vh - var(--nav-h) - 65px); /* Accounts for bottom nav height */
  }
}

.reels-header {
  position: absolute;
  top: 10px;
  left: 20px;
  z-index: 10;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}

.reels-container {
  flex: 1;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  -ms-overflow-style: none; /* IE and Edge */
  scrollbar-width: none; /* Firefox */
  height: 100%;
}
.reels-container::-webkit-scrollbar {
  display: none;
}

.reel-item {
  position: relative;
  width: 100%;
  height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  background: #000;
  overflow: hidden;
}

.reel-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: pointer;
}

.reel-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 120px 20px 30px;
  background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
  pointer-events: none;
  color: #fff;
  z-index: 2;
}

.reel-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  pointer-events: auto;
  cursor: pointer;
}

.reel-user-info img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid #fff;
}

.reel-caption {
  font-size: 0.95rem;
  line-height: 1.4;
  margin-bottom: 10px;
}

.reel-actions {
  position: absolute;
  right: 15px;
  bottom: 100px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  pointer-events: auto;
  z-index: 3;
}

.reel-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  transition: transform 0.2s;
  text-shadow: 0 2px 4px rgba(0,0,0,0.6);
}

.reel-action-btn:hover {
  transform: scale(1.1);
}

.reel-action-btn span:first-child {
  font-size: 1.8rem;
}

.reel-action-btn.liked span:first-child {
  animation: pop 0.3s ease;
}

@keyframes pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.reel-comments-panel {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 65%;
  background: var(--bg);
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  display: flex;
  flex-direction: column;
  z-index: 10;
  box-shadow: 0 -5px 25px rgba(0,0,0,0.5);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.reel-comments-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--glass-border);
  background: var(--glass);
}

.reel-comments-list {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.reel-comment {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.reel-comment img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.reel-comment-input {
  display: flex;
  padding: 15px;
  border-top: 1px solid var(--glass-border);
  gap: 10px;
  background: var(--bg);
  align-items: center;
}

.reel-comment-input input {
  flex: 1;
  padding: 10px 15px;
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: var(--text);
  outline: none;
}
.reel-comment-input button {
  background: var(--primary);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}