/* ============================================================
   LOOPAWS — Red Social de Vulpium
   Design System: Dark Mode + Glassmorphism + Micro-animations
   ============================================================ */

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

/* ─── TOKENS ─────────────────────────────────────────────── */
:root {
  --bg-primary: #0a0a12;
  --bg-secondary: #12121f;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.07);
  --glass-border: rgba(255, 255, 255, 0.08);

  --accent: #a855f7;
  --accent-2: #7c3aed;
  --accent-glow: rgba(168, 85, 247, 0.35);
  --pink: #ec4899;
  --cyan: #22d3ee;
  --gold: #f59e0b;

  --text-primary: #f0f0f8;
  --text-secondary: #9b9bbf;
  --text-muted: #5a5a7a;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 24px var(--accent-glow);

  --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);

  --sidebar-w: 260px;
  --topbar-h: 62px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Outfit', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

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

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input,
textarea {
  font-family: inherit;
}

/* ─── SCROLLBAR ──────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 5px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--accent-2);
  border-radius: var(--radius-full);
}

/* ─── ANIMATED BG ────────────────────────────────────────── */
.bg-orbs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.bg-orbs span {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.18;
  animation: orb-drift 18s ease-in-out infinite alternate;
}

.bg-orbs span:nth-child(1) {
  width: 500px;
  height: 500px;
  background: var(--accent);
  top: -120px;
  left: -80px;
  animation-duration: 20s;
}

.bg-orbs span:nth-child(2) {
  width: 380px;
  height: 380px;
  background: var(--pink);
  bottom: -80px;
  right: -60px;
  animation-duration: 14s;
  animation-delay: -5s;
}

.bg-orbs span:nth-child(3) {
  width: 280px;
  height: 280px;
  background: var(--cyan);
  top: 40%;
  left: 55%;
  animation-duration: 17s;
  animation-delay: -9s;
}

@keyframes orb-drift {
  from {
    transform: translate(0, 0) scale(1);
  }

  to {
    transform: translate(40px, 30px) scale(1.12);
  }
}

/* ─── LAYOUT ─────────────────────────────────────────────── */
#app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr 300px;
  grid-template-rows: var(--topbar-h) 1fr;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ─── TOP BAR ────────────────────────────────────────────── */
#topbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  background: rgba(10, 10, 18, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--topbar-h);
}

.topbar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.3rem;
  background: linear-gradient(135deg, var(--accent), var(--pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
}

.topbar-logo svg {
  flex-shrink: 0;
}

#topbar-search {
  flex: 1;
  max-width: 460px;
  margin: 0 auto;
  position: relative;
}

#topbar-search input {
  width: 100%;
  padding: 9px 16px 9px 42px;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

#topbar-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

#topbar-search .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.btn-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  transition: all var(--transition);
  position: relative;
}

.btn-icon:hover {
  background: var(--bg-card-hover);
  color: var(--accent);
  border-color: var(--accent);
}

.notif-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pink);
  box-shadow: 0 0 6px var(--pink);
  animation: pulse-badge 1.8s ease-in-out infinite;
}

@keyframes pulse-badge {

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

  50% {
    opacity: .6;
    transform: scale(1.3)
  }
}

.avatar-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--accent);
  cursor: pointer;
  transition: box-shadow var(--transition);
}

.avatar-btn:hover {
  box-shadow: var(--shadow-glow);
}

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

/* ─── SIDEBAR ────────────────────────────────────────────── */
#sidebar {
  grid-row: 2;
  padding: 24px 14px;
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
}

.nav-section-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 12px 12px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.92rem;
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
  position: relative;
}

.nav-item:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.18), rgba(124, 58, 237, 0.12));
  color: var(--accent);
  border: 1px solid rgba(168, 85, 247, 0.22);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 3px;
  border-radius: 0 var(--radius-full) var(--radius-full) 0;
  background: var(--accent);
}

.nav-item svg {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.nav-item .nav-badge {
  margin-left: auto;
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--accent);
  color: white;
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

/* ─── MAIN CONTENT ───────────────────────────────────────── */
#main-content {
  grid-row: 2;
  padding: 28px 24px;
  overflow-y: auto;
  max-height: calc(100vh - var(--topbar-h));
}

/* ─── RIGHT SIDEBAR ──────────────────────────────────────── */
#right-sidebar {
  grid-row: 2;
  padding: 24px 16px;
  border-left: 1px solid var(--glass-border);
  overflow-y: auto;
  max-height: calc(100vh - var(--topbar-h));
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ─── CARDS / GLASS ──────────────────────────────────────── */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 18px;
  backdrop-filter: blur(12px);
  transition: all var(--transition);
}

.glass-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.12);
}

.card-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 14px;
}

/* ─── POSTS ──────────────────────────────────────────────── */
.feed-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 18px;
  transition: all var(--transition);
  animation: fade-up 0.4s ease both;
}

.post-card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-card);
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

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

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

.post-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--glass-border);
  transition: border-color var(--transition);
  flex-shrink: 0;
}

.post-avatar:hover {
  border-color: var(--accent);
}

.post-meta {
  flex: 1;
  min-width: 0;
}

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

.verified-badge {
  color: var(--cyan);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.post-time {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.post-menu-btn {
  color: var(--text-muted);
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.post-menu-btn:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

.post-body {
  margin-bottom: 14px;
}

.post-text {
  line-height: 1.65;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.post-media {
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-top: 12px;
  background: rgba(0, 0, 0, 0.25);
}

.post-media img {
  width: 100%;
  height: auto;
  max-height: 480px;
  object-fit: contain;
  display: block;
  border-radius: var(--radius-md);
}

.post-media video {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  display: block;
  border-radius: var(--radius-md);
}

/* Repost label */
.repost-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  padding: 0 2px;
}

.repost-label svg {
  width: 14px;
  height: 14px;
  color: var(--accent);
}

/* ─── ACTIONS BAR ────────────────────────────────────────── */
.post-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--glass-border);
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: var(--radius-full);
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.action-btn:hover {
  background: rgba(255, 255, 255, 0.06);
}

.action-btn.liked {
  color: var(--pink);
}

.action-btn.favorited {
  color: var(--gold);
}

.action-btn.reposted {
  color: var(--accent);
}

.action-btn svg {
  width: 18px;
  height: 18px;
  transition: transform var(--transition);
}

.action-btn:hover svg {
  transform: scale(1.18);
}

.action-btn.liked svg {
  animation: heart-pop 0.35s ease;
}

.action-btn.favorited svg {
  animation: star-pop 0.35s ease;
}

@keyframes heart-pop {
  0% {
    transform: scale(1)
  }

  50% {
    transform: scale(1.5)
  }

  100% {
    transform: scale(1)
  }
}

@keyframes star-pop {
  0% {
    transform: scale(1) rotate(0)
  }

  50% {
    transform: scale(1.5) rotate(20deg)
  }

  100% {
    transform: scale(1) rotate(0)
  }
}

.action-count {
  font-variant-numeric: tabular-nums;
}

.action-btn.report-btn {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.action-btn.report-btn:hover {
  color: #f87171;
}

/* ─── CREATE POST ────────────────────────────────────────── */
.create-post-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-bottom: 20px;
}

.create-post-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.create-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
  flex-shrink: 0;
}

#post-input {
  flex: 1;
  resize: none;
  min-height: 52px;
  max-height: 200px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 1rem;
  outline: none;
  padding-top: 8px;
  line-height: 1.5;
}

#post-input::placeholder {
  color: var(--text-muted);
}

.create-post-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--glass-border);
  margin-top: 10px;
}

.toolbar-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.toolbar-btn:hover {
  color: var(--accent);
  background: rgba(168, 85, 247, 0.1);
}

.toolbar-btn svg {
  width: 18px;
  height: 18px;
}

.file-preview-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.file-preview-item {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--glass-border);
}

.file-preview-item img,
.file-preview-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-remove-btn {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.progress-bar-wrap {
  height: 4px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-top: 8px;
  display: none;
}

.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--accent), var(--pink));
  transition: width 0.2s ease;
}

.post-char-count {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-left: auto;
}

.post-char-count.warn {
  color: var(--gold);
}

.post-char-count.over {
  color: #f87171;
}

.btn-publish {
  padding: 9px 22px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  font-weight: 700;
  font-size: 0.88rem;
  transition: all var(--transition);
  box-shadow: 0 4px 14px rgba(168, 85, 247, 0.35);
}

.btn-publish:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(168, 85, 247, 0.5);
}

.btn-publish:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* ─── TABS ───────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--glass-border);
}

.tab-btn {
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  transition: all var(--transition);
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
  margin-bottom: -1px;
}

/* ─── PROFILE MINI ───────────────────────────────────────── */
.profile-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
}

.profile-mini:hover {
  background: var(--bg-card-hover);
}

.profile-mini .avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
}

.profile-mini .name {
  font-weight: 600;
  font-size: 0.88rem;
}

.profile-mini .handle {
  font-size: 0.76rem;
  color: var(--text-muted);
}

/* ─── TRENDING ───────────────────────────────────────────── */
.trending-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
}

.trending-item:hover {
  background: var(--bg-card-hover);
}

.trending-rank {
  font-size: 0.72rem;
  color: var(--text-muted);
  width: 18px;
}

.trending-tag {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--accent);
}

.trending-count {
  font-size: 0.73rem;
  color: var(--text-muted);
}

/* ─── SUGGESTIONS ────────────────────────────────────────── */
.suggest-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}

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

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

.suggest-name {
  font-weight: 600;
  font-size: 0.86rem;
  display: flex;
  align-items: center;
  gap: 4px;
}

.suggest-handle {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.btn-follow {
  padding: 5px 14px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  border: 1.5px solid var(--accent);
  color: var(--accent);
  transition: all var(--transition);
}

.btn-follow:hover,
.btn-follow.following {
  background: var(--accent);
  color: white;
}

.btn-follow.following {
  background: var(--accent-2);
  border-color: var(--accent-2);
}

/* ─── MODAL ──────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fade-in 0.2s ease;
}

.modal-overlay.hidden {
  display: none;
}

@keyframes fade-in {
  from {
    opacity: 0
  }

  to {
    opacity: 1
  }
}

.modal-box {
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 28px;
  width: 100%;
  max-width: 440px;
  animation: modal-slide 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

@keyframes modal-slide {
  from {
    transform: translateY(30px) scale(0.95)
  }

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

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  color: var(--text-muted);
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: color var(--transition);
}

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

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-title svg {
  color: var(--accent);
  width: 22px;
  height: 22px;
}

/* ─── FORM INPUTS ────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-input {
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
  transition: all var(--transition);
}

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

/* ─── TOAST ──────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-card);
  pointer-events: all;
  animation: toast-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-size: 0.88rem;
  font-weight: 500;
  max-width: 300px;
}

.toast.success {
  border-color: #22c55e;
}

.toast.error {
  border-color: #f87171;
}

.toast.info {
  border-color: var(--cyan);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(20px)
  }

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

@keyframes toast-out {
  from {
    opacity: 1;
    transform: translateX(0)
  }

  to {
    opacity: 0;
    transform: translateX(20px)
  }
}

/* ─── DM PANEL ───────────────────────────────────────────── */
.dm-panel {
  position: fixed;
  bottom: 0;
  right: 28px;
  z-index: 500;
  width: 320px;
}

.dm-header {
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.dm-body {
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-top: none;
  height: 380px;
  display: flex;
  flex-direction: column;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  overflow: hidden;
  display: none;
}

.dm-body.open {
  display: flex;
}

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

.msg-bubble {
  max-width: 75%;
  padding: 9px 13px;
  border-radius: 16px;
  font-size: 0.87rem;
  line-height: 1.4;
}

.msg-bubble.mine {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  border-bottom-right-radius: 4px;
}

.msg-bubble.theirs {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}

.dm-input-row {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--glass-border);
}

.dm-input-row input {
  flex: 1;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: 0.87rem;
  outline: none;
}

.dm-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.dm-send-btn:hover {
  background: var(--accent-2);
  transform: scale(1.08);
}

/* ─── LOADING STATES ─────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 25%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.05) 75%);
  background-size: 200% 100%;
  border-radius: var(--radius-sm);
  animation: skeleton-wave 1.5s infinite;
}

@keyframes skeleton-wave {
  0% {
    background-position: 200% 0
  }

  100% {
    background-position: -200% 0
  }
}

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.empty-state svg {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  opacity: 0.4;
}

/* ─── SPINNER ────────────────────────────────────────────── */
.spinner {
  width: 24px;
  height: 24px;
  border: 2.5px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto;
}

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

/* ─── LOGIN SCREEN ───────────────────────────────────────── */
#login-screen {
  position: fixed;
  inset: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 1100;
  background: rgba(3, 3, 12, 0.78);
  backdrop-filter: blur(8px);
}

.login-card {
  position: relative;
  background: rgba(18, 18, 31, 0.85);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  width: 100%;
  max-width: 380px;
  backdrop-filter: blur(20px);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  text-align: center;
  animation: modal-slide 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.login-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}

.login-close:hover {
  color: var(--text-primary);
  border-color: var(--accent);
  background: rgba(168, 85, 247, 0.12);
}

.login-logo {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--accent), var(--pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-tagline {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 32px;
}

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 13px 20px;
  background: white;
  color: #1a1a1a;
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: var(--radius-full);
  transition: all var(--transition);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.btn-google:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
}

.btn-google img {
  width: 22px;
  height: 22px;
}

/* ─── RESPONSIVE ─────────────────────────────────────────── */

/* Tablet: ocultar sidebar derecho */
@media (max-width: 1100px) {
  #right-sidebar {
    display: none;
  }

  #app-shell {
    grid-template-columns: var(--sidebar-w) 1fr;
  }
}

/* Tablet pequeña: sidebar más compacto */
@media (max-width: 820px) {
  :root {
    --sidebar-w: 72px;
  }

  .nav-item span,
  .nav-section-label,
  .nav-item .nav-badge {
    display: none;
  }

  .nav-item {
    padding: 10px;
    justify-content: center;
  }

  #sidebar {
    align-items: center;
    padding: 16px 8px;
  }
}

/* ─── MÓVIL ─── */
@media (max-width: 680px) {
  :root {
    --topbar-h: 56px;
    --bottom-nav-h: 60px;
    --sidebar-w: 0px;
    /* sidebar ya no ocupa columna */
  }

  /* ══ Shell: grid de 1 columna, topbar + contenido ══ */
  #app-shell {
    grid-template-columns: 1fr !important;
    grid-template-rows: var(--topbar-h) 1fr;
  }

  /* ══ Topbar: fija arriba ══ */
  #topbar {
    grid-column: 1 / -1;
    grid-row: 1;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--topbar-h);
    padding: 0 16px;
    z-index: 300;
    gap: 12px;
  }

  #topbar-search {
    display: none;
  }

  .topbar-logo {
    font-size: 1.1rem;
  }

  .topbar-actions {
    gap: 6px;
  }

  .btn-icon,
  .avatar-btn {
    width: 34px;
    height: 34px;
  }

  /* ══ Sidebar → barra inferior fija ══ */
  #sidebar {
    grid-column: 1 / -1;
    grid-row: unset;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: unset;
    /* resetear valores de desktop */
    width: 100%;
    height: calc(60px + env(safe-area-inset-bottom));
    flex-direction: row;
    align-items: center;
    justify-content: space-around;
    padding: 0 4px;
    padding-bottom: env(safe-area-inset-bottom);
    background: rgba(10, 10, 18, 0.97);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid var(--glass-border);
    border-right: none;
    z-index: 200;
    overflow: visible;
    gap: 0;
  }

  .nav-section-label,
  .nav-item span,
  .nav-item .nav-badge {
    display: none;
  }

  .nav-item {
    flex: 1;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 8px 2px;
    border-radius: var(--radius-md);
    gap: 0;
    min-width: 0;
    position: relative;
  }

  .nav-item svg {
    width: 22px;
    height: 22px;
  }

  .nav-item.active {
    background: rgba(168, 85, 247, 0.14);
    border: none;
  }

  .nav-item.active::before {
    left: 50%;
    transform: translateX(-50%);
    top: 0;
    bottom: unset;
    width: 22px;
    height: 3px;
    border-radius: 0 0 var(--radius-full) var(--radius-full);
  }

  /* ══ Main content: ocupa toda la columna, debajo del topbar ══ */
  #main-content {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    max-width: 100%;
    max-height: unset;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px 12px;
    padding-top: calc(var(--topbar-h) + 16px);
    padding-bottom: calc(60px + env(safe-area-inset-bottom) + 16px);
  }

  /* ══ Posts ══ */
  .post-card {
    padding: 12px 14px;
    border-radius: var(--radius-md);
  }

  .post-header {
    gap: 10px;
    margin-bottom: 10px;
  }

  .post-avatar {
    width: 36px;
    height: 36px;
  }

  .post-author {
    font-size: 0.88rem;
  }

  .post-text {
    font-size: 0.92rem;
  }

  .post-actions {
    gap: 0;
    flex-wrap: wrap;
  }

  .action-btn {
    padding: 6px 10px;
    font-size: 0.8rem;
    gap: 4px;
  }

  .action-btn svg {
    width: 16px;
    height: 16px;
  }

  /* Reportar al final en su propia fila */
  .action-btn.report-btn {
    margin-left: auto;
    font-size: 0.75rem;
  }

  /* ══ Create post ══ */
  .create-post-card {
    padding: 12px 14px;
    margin-bottom: 14px;
  }

  .create-post-toolbar {
    gap: 2px;
    flex-wrap: wrap;
  }

  .toolbar-btn span {
    display: none;
  }

  .toolbar-btn {
    padding: 6px 10px;
  }

  .btn-publish {
    padding: 8px 18px;
    font-size: 0.85rem;
  }

  .post-char-count {
    font-size: 0.74rem;
  }

  /* ══ Tabs ══ */
  .tabs {
    margin-bottom: 14px;
  }

  .tab-btn {
    padding: 8px 14px;
    font-size: 0.84rem;
  }

  /* ══ Cards ══ */
  .glass-card {
    padding: 14px;
  }

  /* ══ Modal: sube desde abajo ══ */
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .modal-box {
    max-width: 100%;
    width: 100%;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 24px 18px;
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
    animation: modal-slide-up 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  }

  @keyframes modal-slide-up {
    from {
      transform: translateY(100%);
    }

    to {
      transform: translateY(0);
    }
  }

  /* ══ Login ══ */
  .login-card {
    padding: 36px 22px;
  }

  /* ══ DM Panel ══ */
  .dm-panel {
    right: 0;
    left: 0;
    width: 100%;
    bottom: calc(60px + env(safe-area-inset-bottom));
  }

  .dm-body {
    height: 300px;
  }

  /* ══ Toast ══ */
  .toast-container {
    bottom: calc(60px + env(safe-area-inset-bottom) + 12px);
    right: 12px;
    left: 12px;
    align-items: center;
  }

  .toast {
    max-width: 100%;
    width: 100%;
    font-size: 0.84rem;
  }

  /* ══ Right sidebar: oculto ══ */
  #right-sidebar {
    display: none !important;
  }

  /* ══ Orbs: más suaves en móvil ══ */
  .bg-orbs span {
    opacity: 0.08;
    filter: blur(50px);
  }
}
