/* ==========================================================================
   HAVANA — Social + Dating Platform Stylesheet
   Facebook + Tinder inspired | Mobile-first | CSS Custom Properties
   ========================================================================== */

/* ==========================================================================
   1. CSS VARIABLES & THEME
   ========================================================================== */
:root {
  /* Brand Colors */
  --primary: #1877f2;
  --primary-dark: #1558b0;
  --primary-light: #e7f0fd;
  --secondary: #e4405f;
  --secondary-dark: #c0314f;
  --secondary-light: #fdeef1;
  --success: #42b72a;
  --success-light: #eafbe7;
  --warning: #f7b928;
  --warning-light: #fff8e6;
  --danger: #e53935;
  --danger-light: #fdecea;

  /* Surfaces */
  --bg: #f0f2f5;
  --card-bg: #ffffff;
  --nav-bg: #ffffff;
  --sidebar-admin-bg: #18191a;

  /* Text */
  --text: #050505;
  --text-secondary: #65676b;
  --text-muted: #8a8d91;
  --text-inverse: #ffffff;

  /* Borders & Shadows */
  --border: #dddfe2;
  --border-light: #f0f2f5;
  --shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.2);

  /* Radii */
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 4px;
  --radius-full: 9999px;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Layout */
  --nav-height: 56px;
  --sidebar-left-width: 240px;
  --sidebar-right-width: 300px;

  /* Typography */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 2rem;

  /* Transitions */
  --transition: 0.2s ease;
  --transition-slow: 0.4s ease;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #1877f2 0%, #6a3de8 100%);
  --gradient-secondary: linear-gradient(135deg, #e4405f 0%, #ff6b35 100%);
  --gradient-auth: linear-gradient(135deg, #1877f2 0%, #6a3de8 60%, #e4405f 100%);
  --gradient-match: linear-gradient(135deg, #e4405f 0%, #ff6b35 50%, #f7b928 100%);
  --z-base: 1;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 300;
  --z-modal: 400;
  --z-toast: 500;
}

/* Dark mode placeholder variables */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #18191a;
    --card-bg: #242526;
    --nav-bg: #242526;
    --text: #e4e6eb;
    --text-secondary: #b0b3b8;
    --text-muted: #8a8d91;
    --border: #3e4042;
    --border-light: #3e4042;
    --primary-light: #1c2c4a;
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
  }
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  font-size: var(--font-size-base);
  color: var(--text);
  background-color: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

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

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--primary-dark);
}

button {
  font-family: var(--font);
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
}

input,
textarea,
select {
  font-family: var(--font);
  font-size: var(--font-size-base);
}

ul,
ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
}

p {
  color: var(--text);
}

/* Utility: visually hidden */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ==========================================================================
   3. NAVIGATION BAR
   ========================================================================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--nav-bg);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  padding: 0 var(--space-md);
  gap: var(--space-sm);
  z-index: var(--z-fixed);
}

.navbar__logo {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  flex-shrink: 0;
  text-decoration: none;
}

.navbar__logo-icon {
  width: 40px;
  height: 40px;
  background: var(--gradient-primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: -1px;
}

.navbar__logo-text {
  font-size: var(--font-size-xl);
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: none;
}

@media (min-width: 768px) {
  .navbar__logo-text {
    display: block;
  }
}

.navbar__search {
  flex: 1;
  max-width: 240px;
  position: relative;
}

.navbar__search-input {
  width: 100%;
  height: 40px;
  background: var(--bg);
  border: 1.5px solid transparent;
  border-radius: var(--radius-full);
  padding: 0 var(--space-md) 0 40px;
  font-size: var(--font-size-sm);
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.navbar__search-input::placeholder {
  color: var(--text-muted);
}

.navbar__search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.navbar__search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1rem;
  pointer-events: none;
}

.navbar__nav {
  display: none;
  align-items: center;
  gap: 4px;
  flex: 1;
  justify-content: space-evenly;
}

@media (min-width: 960px) {
  .navbar__nav {
    display: flex;
  }
}

.navbar__nav-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 112px;
  height: 44px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 1.25rem;
  transition: background var(--transition), color var(--transition);
  position: relative;
  text-decoration: none;
}

.navbar__nav-link:hover {
  background: var(--bg);
  color: var(--primary);
}

.navbar__nav-link.active {
  color: var(--primary);
}

.navbar__nav-link.active::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary);
  border-radius: var(--radius-full);
}

.navbar__inner {
  display: flex;
  align-items: center;
  width: 100%;
  gap: var(--space-sm);
}

/* Notification icon inside nav */
.navbar__nav-link--icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 1.25rem;
  transition: background var(--transition), color var(--transition);
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
}

.navbar__nav-link--icon:hover {
  background: var(--bg);
  color: var(--primary);
}

.navbar__nav-item {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.navbar__actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-left: auto;
  flex-shrink: 0;
}

.navbar__action-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  font-size: 1.1rem;
  position: relative;
  transition: background var(--transition);
  cursor: pointer;
  border: none;
}

.navbar__action-btn:hover {
  background: var(--border);
}

.navbar__badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 700;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  border: 2px solid var(--nav-bg);
  line-height: 1;
}

.navbar__badge--pulse {
  animation: pulse 2s infinite;
}

.navbar__avatar {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  cursor: pointer;
  border: 2px solid var(--border);
  transition: border-color var(--transition);
}

.navbar__avatar:hover {
  border-color: var(--primary);
}

/* ==========================================================================
   4. AUTH PAGES (LOGIN / SIGNUP)
   ========================================================================== */
.auth-page {
  min-height: 100vh;
  background: var(--gradient-auth);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  position: relative;
  overflow: hidden;
}

.auth-page::before,
.auth-page::after {
  content: "";
  position: absolute;
  border-radius: var(--radius-full);
  opacity: 0.12;
}

.auth-page::before {
  width: 400px;
  height: 400px;
  background: white;
  top: -100px;
  right: -100px;
  animation: floatBlob 8s ease-in-out infinite;
}

.auth-page::after {
  width: 300px;
  height: 300px;
  background: white;
  bottom: -80px;
  left: -80px;
  animation: floatBlob 10s ease-in-out infinite reverse;
}

.auth-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xl);
  padding: var(--space-2xl) var(--space-xl);
  width: 100%;
  max-width: 440px;
  position: relative;
  z-index: 1;
  animation: slideUpFade 0.4s ease both;
}

.auth-card__logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
}

.auth-card__logo-icon {
  width: 56px;
  height: 56px;
  background: var(--gradient-primary);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  font-weight: 900;
}

.auth-card__logo-name {
  font-size: var(--font-size-2xl);
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-card__title {
  font-size: var(--font-size-xl);
  font-weight: 700;
  text-align: center;
  margin-bottom: var(--space-xs);
}

.auth-card__subtitle {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: var(--space-xl);
}

/* Step indicators for signup */
.auth-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: var(--space-xl);
}

.auth-steps__step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  position: relative;
}

.auth-steps__step + .auth-steps__step::before {
  content: "";
  position: absolute;
  right: 100%;
  top: 16px;
  width: 40px;
  height: 2px;
  background: var(--border);
  margin-right: -2px;
}

.auth-steps__step.completed + .auth-steps__step::before {
  background: var(--primary);
}

.auth-steps__circle {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-xs);
  font-weight: 700;
  color: var(--text-muted);
  background: var(--card-bg);
  transition: all var(--transition);
}

.auth-steps__step.active .auth-steps__circle {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}

.auth-steps__step.completed .auth-steps__circle {
  border-color: var(--success);
  background: var(--success);
  color: white;
}

.auth-steps__label {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
}

.auth-steps__step.active .auth-steps__label {
  color: var(--primary);
  font-weight: 600;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin: var(--space-lg) 0;
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-card__footer {
  text-align: center;
  margin-top: var(--space-lg);
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

.auth-card__footer a {
  font-weight: 600;
}

/* ── Google Sign-In (Continue with Gmail) ─────────────────────────── */
.google-signin-block {
  margin: var(--space-md) 0 0;
}

.google-signin-block iframe {
  width: 100% !important;
}

.google-signin-note {
  margin: var(--space-md) 0 0;
  text-align: center;
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

/* ==========================================================================
   5. DASHBOARD LAYOUT
   ========================================================================== */
.layout {
  padding-top: var(--nav-height);
  min-height: 100vh;
}

.layout__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
  max-width: 1280px;
  margin: 0 auto;
  padding: var(--space-md);
  align-items: start;
}

@media (min-width: 768px) {
  .layout__inner {
    grid-template-columns: var(--sidebar-left-width) 1fr;
  }
}

@media (min-width: 1100px) {
  .layout__inner {
    grid-template-columns: var(--sidebar-left-width) 1fr var(--sidebar-right-width);
  }
}

.layout__sidebar-left,
.layout__sidebar-right {
  display: none;
}

@media (min-width: 768px) {
  .layout__sidebar-left {
    display: block;
    position: sticky;
    top: calc(var(--nav-height) + var(--space-md));
    max-height: calc(100vh - var(--nav-height) - var(--space-xl));
    overflow-y: auto;
    scrollbar-width: none;
  }
  .layout__sidebar-left::-webkit-scrollbar {
    display: none;
  }
}

@media (min-width: 1100px) {
  .layout__sidebar-right {
    display: block;
    position: sticky;
    top: calc(var(--nav-height) + var(--space-md));
    max-height: calc(100vh - var(--nav-height) - var(--space-xl));
    overflow-y: auto;
    scrollbar-width: none;
  }
  .layout__sidebar-right::-webkit-scrollbar {
    display: none;
  }
}

.layout__feed {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

/* Sidebar nav items */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--space-sm) 0;
}

.sidebar-nav__item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 10px var(--space-sm);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: var(--font-size-base);
  font-weight: 500;
  text-decoration: none;
  transition: background var(--transition);
  cursor: pointer;
}

.sidebar-nav__item:hover {
  background: var(--bg);
  color: var(--primary);
}

.sidebar-nav__item.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
}

.sidebar-nav__icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.sidebar-nav__item.active .sidebar-nav__icon {
  background: var(--primary-light);
}

.sidebar-section-title {
  font-size: var(--font-size-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: var(--space-md) var(--space-sm) var(--space-xs);
}

/* ==========================================================================
   6. POST CARD — Facebook Style
   ========================================================================== */
.post-card {
  position: relative;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06), 0 2px 8px rgba(0,0,0,0.04);
  overflow: hidden;
  transition: box-shadow 0.25s ease, transform 0.25s ease, opacity 0.3s ease, max-height 0.4s ease;
  margin-bottom: var(--space-md);
}

.post-card.minimized {
  max-height: 60px;
  opacity: 0.6;
  overflow: hidden;
}

.post-card.minimized .post-card__header {
  padding-bottom: 0;
}

.post-card.minimized .post-card__actions {
  display: none;
}

.post-card.minimized .post-card__body {
  display: none;
}

.post-card.minimized .post-card__comments {
  display: none;
}

.post-card:hover {
  box-shadow: 0 2px 4px rgba(0,0,0,0.08), 0 8px 24px rgba(0,0,0,0.1);
  transform: translateY(-1px);
}

.post-card__header {
  position: relative;
  z-index: 1;
  background: var(--card-bg);
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-md) 4px;
}

.post-card__avatar {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  object-fit: cover;
  flex-shrink: 0;
  cursor: pointer;
  border: 2px solid var(--border-light);
  transition: border-color 0.2s ease;
}

.post-card__avatar:hover {
  border-color: var(--primary);
}

.post-card__avatar-link {
  position: relative;
  display: inline-block;
}

.post-card__avatar-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 16px;
  height: 16px;
  background: var(--primary);
  border: 2px solid var(--card-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  color: #fff;
}

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

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

.post-card__name {
  font-weight: 600;
  font-size: var(--font-size-sm);
  color: var(--text);
  cursor: pointer;
  line-height: 1.3;
}

.post-card__name:hover {
  text-decoration: underline;
}

.post-card__verified {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  background: var(--primary);
  border-radius: 50%;
  color: #fff;
  font-size: 9px;
  flex-shrink: 0;
}

.post-card__time {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.post-card__time svg {
  opacity: 0.5;
}

.post-card__options {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.2s ease;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -1px;
  background: none;
  border: none;
}

.post-card__options:hover {
  background: var(--bg);
}

.post-card__body {
  position: relative;
  z-index: 1;
  background: var(--card-bg);
}

.post-card__content {
  padding: 8px var(--space-md) var(--space-sm);
  font-size: var(--font-size-base);
  color: var(--text);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.post-card__content.large-text {
  font-size: var(--font-size-xl);
  font-weight: 500;
}

.post-card__content.truncated {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card__see-more {
  display: inline;
  color: var(--text-secondary);
  font-weight: 600;
  cursor: pointer;
  font-size: var(--font-size-sm);
  margin-left: 4px;
}

.post-card__see-more:hover {
  text-decoration: underline;
}

.post-card__media {
  width: 100%;
  background: #000;
  margin: var(--space-sm) 0 0;
}

.post-card__media--hero {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  border: none;
  margin: 0;
}

.post-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.2s ease;
  background: var(--bg);
}

.post-card__image:hover {
  opacity: 0.97;
}

.post-card__media-grid {
  display: grid;
  gap: 2px;
  background: var(--card-bg);
}

.post-card__media-grid .post-card__img-wrap {
  overflow: hidden;
  cursor: pointer;
  position: relative;
}

.post-card__media-grid .post-card__img-wrap img,
.post-card__media-grid .post-card__img-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.2s ease;
}

.post-card__media-grid .post-card__img-wrap:hover img,
.post-card__media-grid .post-card__img-wrap:hover video {
  opacity: 0.93;
}

.post-card__media-grid .post-card__img-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.5rem;
  font-weight: 700;
  pointer-events: none;
}

/* Stats bar — Facebook style */
.post-card__stats {
  position: relative;
  z-index: 1;
  background: var(--card-bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px var(--space-md);
  min-height: 36px;
}

.post-card__stats-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.post-card__stats-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.post-card__reactions {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  cursor: pointer;
}

.post-card__reactions:hover {
  text-decoration: underline;
}

.post-card__reactions-icons {
  display: flex;
  align-items: center;
  margin-right: 2px;
}

.react-icon {
  font-size: 16px;
  line-height: 1;
  display: inline-flex;
  border: 2px solid var(--card-bg);
  border-radius: 50%;
}

.react-thumb {
  z-index: 2;
  position: relative;
}

.react-heart {
  margin-left: -6px;
  z-index: 1;
  position: relative;
}

.react-laugh {
  margin-left: -6px;
  z-index: 0;
  position: relative;
}

.post-card__stat-item {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-weight: 500;
}

.post-card__stat-item:hover {
  text-decoration: underline;
  color: var(--primary);
}

.post-card__stat-item--active {
  color: var(--primary);
}

/* Subject line for feeling/activity/location */
.post-card__subject {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px var(--space-md) var(--space-sm);
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--text);
}
.post-card__subject .subject-feeling {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--primary-light);
  color: var(--primary);
  padding: 4px 12px;
  border-radius: 20px;
}
.post-card__subject .subject-activity {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--secondary-light);
  color: var(--secondary);
  padding: 4px 12px;
  border-radius: 20px;
}
.post-card__subject .subject-location {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--warning-light);
  color: var(--warning);
  padding: 4px 12px;
  border-radius: 20px;
}

/* Action buttons — Facebook style */
.post-card__actions {
  position: relative;
  z-index: 1;
  background: var(--card-bg);
  display: flex;
  padding: 0 4px;
  border-top: 1px solid var(--border);
  margin: 0;
}

.post-card__action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 4px;
  border-radius: 4px;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  border: none;
  background: none;
  height: 40px;
  margin: 2px 2px;
}

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

.post-card__action-btn.liked {
  color: var(--primary);
}

.post-card__action-btn.liked .like-icon {
  fill: var(--primary);
  stroke: var(--primary);
  animation: likePop 0.3s ease;
}

.post-card__action-btn.liked:hover {
  background: var(--primary-light);
}

.post-card__action-btn--comment:hover {
  background: var(--success-light);
  color: var(--success);
}

.post-card__action-btn--share:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.post-card__action-btn svg {
  transition: transform 0.2s ease;
}

.post-card__action-btn:hover svg {
  transform: scale(1.1);
}

@keyframes likePop {
  0% { transform: scale(1); }
  40% { transform: scale(1.3); }
  70% { transform: scale(0.9); }
  100% { transform: scale(1); }
}

.post-card__action-divider {
  width: 1px;
  background: var(--border-light);
  margin: 8px 0;
  flex-shrink: 0;
}

/* Comments — Facebook style */
.post-card__comments {
  position: relative;
  z-index: 1;
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  padding: var(--space-sm) var(--space-md) var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.post-card__comment {
  display: flex;
  gap: var(--space-sm);
  align-items: flex-start;
  animation: commentFadeIn 0.3s ease;
}

@keyframes commentFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.post-card__comment-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  object-fit: cover;
  flex-shrink: 0;
}

.post-card__comment-bubble {
  background: var(--bg);
  border-radius: 18px;
  padding: 8px 12px;
  flex: 1;
  position: relative;
}

.post-card__comment-name {
  font-weight: 700;
  font-size: var(--font-size-xs);
  color: var(--text);
}

.post-card__comment-name:hover {
  text-decoration: underline;
  cursor: pointer;
}

.post-card__comment-text {
  font-size: var(--font-size-sm);
  color: var(--text);
  line-height: 1.4;
}

.post-card__comment-actions {
  display: flex;
  gap: var(--space-md);
  margin-top: 2px;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  padding-left: 44px;
}

.post-card__comment-actions span {
  cursor: pointer;
  font-weight: 600;
  transition: color var(--transition);
}

.post-card__comment-actions span:hover {
  color: var(--primary);
}

.post-card__comment-like-btn:hover {
  color: var(--primary) !important;
}

.post-card__comment-reply-btn:hover {
  color: var(--primary) !important;
}

.post-card__comment-input {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
  margin-top: var(--space-xs);
}

.post-card__comment-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  background: var(--bg);
  border-radius: var(--radius-full);
  padding-left: var(--space-md);
  border: 1.5px solid transparent;
  transition: border-color var(--transition);
}

.post-card__comment-input-wrap:focus-within {
  border-color: var(--primary);
  background: var(--card-bg);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.post-card__comment-input-wrap input {
  flex: 1;
  height: 36px;
  background: transparent;
  border: none;
  outline: none;
  font-size: var(--font-size-sm);
  color: var(--text);
}

.post-card__comment-input-wrap input::placeholder {
  color: var(--text-muted);
}

.post-card__comment-emoji {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  opacity: 0.6;
  transition: opacity 0.2s ease;
  margin-right: 4px;
}

.post-card__comment-emoji:hover {
  opacity: 1;
}

.post-card__show-comments {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  padding: var(--space-xs) 0;
  display: block;
  transition: color var(--transition);
  background: none;
  border: none;
  font-family: inherit;
}
.post-card__show-comments:hover {
  color: var(--primary);
}

.post-card__empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl) var(--space-md);
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  gap: var(--space-sm);
}

.post-card__empty-state svg {
  opacity: 0.3;
}

.post-card__show-comments:hover {
  color: var(--primary);
}

/* ==========================================================================
   7. POST CREATION BOX
   ========================================================================== */
.create-post {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--space-md);
  position: relative;
  transition: max-height 0.4s ease, opacity 0.3s ease, margin-bottom 0.3s ease, padding 0.3s ease;
}

.create-post__minimize {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: background 0.2s ease, color 0.2s ease;
  z-index: 2;
}

.create-post__minimize:hover {
  background: var(--hover-bg, rgba(0,0,0,0.06));
  color: var(--text-primary);
}

.create-post__float-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #5856d6, #7c6fcf);
  color: white;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(88,86,214,0.4);
  margin: 0 auto var(--space-md) auto;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.create-post__float-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(88,86,214,0.55);
}

.create-post__float-btn.hidden {
  display: none;
}

.create-post__top {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
}

.create-post__avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  object-fit: cover;
  flex-shrink: 0;
}

.create-post__input {
  flex: 1;
  height: 40px;
  background: var(--bg);
  border: 1.5px solid transparent;
  border-radius: var(--radius-full);
  padding: 0 var(--space-md);
  font-size: var(--font-size-base);
  color: var(--text);
  cursor: text;
  transition: border-color var(--transition), background var(--transition);
  outline: none;
}

.create-post__input:hover {
  background: var(--border);
}

.create-post__input:focus {
  border-color: var(--primary);
  background: var(--card-bg);
}

.create-post__divider {
  height: 1px;
  background: var(--border-light);
  margin: var(--space-sm) 0;
}

.create-post__actions {
  display: flex;
  align-items: center;
  justify-content: space-around;
}

.create-post__action {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 8px var(--space-md);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition);
  border: none;
  background: none;
  white-space: nowrap;
}

.create-post__action:hover {
  background: var(--bg);
}

.create-post__action-icon {
  font-size: 1.25rem;
}

.create-post__action-icon.photo {
  color: #45bd62;
}

.create-post__action-icon.video {
  color: #f3425f;
}

.create-post__action-icon.feeling {
  color: #f7b928;
}

/* Expanded create-post */
.create-post__expanded {
  margin-top: var(--space-sm);
}

.create-post__textarea {
  width: 100%;
  min-height: 80px;
  border: none;
  outline: none;
  font-size: var(--font-size-lg);
  color: var(--text);
  resize: none;
  background: transparent;
  padding: var(--space-xs) 0;
  line-height: 1.5;
}

.create-post__textarea::placeholder {
  color: var(--text-muted);
}

/* ==========================================================================
   8. USER / SUGGESTION CARD
   ========================================================================== */
.user-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}

.user-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.user-card__avatar-wrap {
  position: relative;
  width: 72px;
  height: 72px;
}

.user-card__avatar {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 3px solid var(--border);
}

.user-card__name {
  font-weight: 700;
  font-size: var(--font-size-base);
  color: var(--text);
}

.user-card__bio {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.user-card__location {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.user-card__mutual {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.user-card__mutual-avatars {
  display: flex;
  justify-content: center;
  margin-bottom: 4px;
}

.user-card__mutual-avatars img {
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  border: 2px solid var(--card-bg);
  margin-left: -6px;
}

.user-card__mutual-avatars img:first-child {
  margin-left: 0;
}

.user-card__actions {
  display: flex;
  gap: var(--space-sm);
  width: 100%;
  margin-top: var(--space-xs);
}

/* Horizontal suggestion card (compact) */
.suggestion-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) 0;
}

.suggestion-item__avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  object-fit: cover;
  flex-shrink: 0;
}

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

.suggestion-item__name {
  font-weight: 700;
  font-size: var(--font-size-sm);
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.suggestion-item__sub {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.suggestion-item__actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

/* Widget card (right sidebar wrapper) */
.widget-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
}

.widget-card__title {
  font-size: var(--font-size-base);
  font-weight: 700;
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.widget-card__title a {
  font-size: var(--font-size-sm);
  font-weight: 600;
}

/* ==========================================================================
   9. PROFILE PAGE
   ========================================================================== */
.profile-page {
  padding-top: var(--nav-height);
}

.profile-cover {
  position: relative;
  width: 100%;
  height: 220px;
  background: var(--gradient-primary);
  overflow: hidden;
}

@media (min-width: 768px) {
  .profile-cover {
    height: 350px;
  }
}

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

.profile-cover__edit {
  position: absolute;
  bottom: var(--space-md);
  right: var(--space-md);
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: var(--font-size-sm);
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  backdrop-filter: blur(4px);
  transition: background var(--transition);
}

.profile-cover__edit:hover {
  background: rgba(0, 0, 0, 0.8);
}

.profile-info-section {
  background: var(--card-bg);
  box-shadow: var(--shadow);
}

.profile-info-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 var(--space-lg) var(--space-md);
}

.profile-avatar-row {
  display: flex;
  align-items: flex-end;
  gap: var(--space-lg);
  padding-bottom: var(--space-md);
  flex-wrap: wrap;
}

.profile-avatar-wrap {
  position: relative;
  margin-top: -50px;
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .profile-avatar-wrap {
    margin-top: -80px;
  }
}

.profile-avatar {
  width: 120px;
  height: 120px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 4px solid var(--card-bg);
  box-shadow: var(--shadow-md);
}

.profile-avatar__edit {
  position: absolute;
  bottom: 6px;
  right: 6px;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-full);
  background: var(--bg);
  border: 2px solid var(--card-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.75rem;
  color: var(--text);
  transition: background var(--transition);
}

.profile-avatar__edit:hover {
  background: var(--border);
}

.profile-details {
  flex: 1;
  min-width: 0;
  padding-bottom: var(--space-sm);
}

.profile-details__name {
  font-size: var(--font-size-2xl);
  font-weight: 800;
  color: var(--text);
}

.profile-details__bio {
  font-size: var(--font-size-base);
  color: var(--text-secondary);
  margin-top: 4px;
}

.profile-details__meta {
  display: flex;
  gap: var(--space-md);
  margin-top: var(--space-sm);
  flex-wrap: wrap;
}

.profile-details__meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

.profile-actions {
  display: flex;
  gap: var(--space-sm);
  margin-left: auto;
  align-items: flex-end;
  flex-wrap: wrap;
}

/* Stats bar */
.profile-stats {
  display: flex;
  gap: var(--space-xl);
  padding: var(--space-md) 0;
  border-top: 1px solid var(--border-light);
  flex-wrap: wrap;
}

.profile-stats__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: color var(--transition);
}

.profile-stats__item:hover {
  color: var(--primary);
}

.profile-stats__number {
  font-size: var(--font-size-xl);
  font-weight: 800;
  color: var(--text);
}

.profile-stats__label {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  font-weight: 500;
}

/* Profile tabs */
.profile-tabs {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  border-top: 1px solid var(--border-light);
  background: var(--card-bg);
}

.profile-tabs__tab {
  padding: var(--space-md) var(--space-lg);
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: color var(--transition), border-color var(--transition);
  white-space: nowrap;
  text-decoration: none;
  display: block;
}

.profile-tabs__tab:hover {
  color: var(--primary);
  background: var(--bg);
}

.profile-tabs__tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Profile content area */
.profile-content {
  max-width: 1080px;
  margin: var(--space-md) auto;
  padding: 0 var(--space-md);
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

@media (min-width: 768px) {
  .profile-content {
    grid-template-columns: 320px 1fr;
  }
}

/* ==========================================================================
   10. CHAT SYSTEM
   ========================================================================== */
.chat-launcher {
  position: fixed;
  bottom: var(--space-lg);
  right: var(--space-lg);
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: var(--gradient-primary);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: var(--shadow-lg);
  z-index: var(--z-fixed);
  transition: transform var(--transition), box-shadow var(--transition);
}

.chat-launcher:hover {
  transform: scale(1.08);
  box-shadow: var(--shadow-xl);
}

.chat-launcher__badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  background: var(--secondary);
  color: white;
  font-size: 10px;
  font-weight: 700;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
  animation: pulse 2s infinite;
}

/* Chat list panel */
.chat-list-panel {
  position: fixed;
  bottom: calc(var(--space-lg) + 64px);
  right: var(--space-lg);
  width: 300px;
  max-height: 420px;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xl);
  z-index: var(--z-fixed);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform-origin: bottom right;
  animation: scaleIn 0.2s ease both;
}

.chat-list-panel.hidden {
  display: none;
}

.chat-list-panel__header {
  padding: var(--space-md);
  font-weight: 700;
  font-size: var(--font-size-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

.chat-list-panel__search {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

.chat-list-panel__search input {
  width: 100%;
  height: 34px;
  border-radius: var(--radius-full);
  background: var(--bg);
  border: none;
  outline: none;
  padding: 0 var(--space-md);
  font-size: var(--font-size-sm);
  color: var(--text);
}

.chat-list-panel__list {
  overflow-y: auto;
  flex: 1;
}

.chat-list-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  cursor: pointer;
  transition: background var(--transition);
}

.chat-list-item:hover {
  background: var(--bg);
}

.chat-list-item__avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.chat-list-item__avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  object-fit: cover;
}

.chat-list-item__info {
  flex: 1;
  min-width: 0;
}

.chat-list-item__name {
  font-weight: 700;
  font-size: var(--font-size-sm);
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-list-item__preview {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-list-item.unread .chat-list-item__preview {
  color: var(--text);
  font-weight: 600;
}

.chat-list-item__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.chat-list-item__time {
  font-size: 10px;
  color: var(--text-muted);
}

.chat-list-item__unread-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--primary);
}

/* Unread badge (count) on chat list items */
.chat-list-item__badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 20px;
  height: 20px;
  background: var(--secondary, #e53935);
  color: white;
  font-size: 10px;
  font-weight: 800;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border: 2px solid var(--card-bg, #fff);
  line-height: 1;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  animation: popIn 0.3s ease;
}

@keyframes popIn {
  0% { transform: scale(0); }
  60% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* Individual chat window */
/* ─── Chat Window ──────────────────────────────────────────────────────────── */
.chat-window {
  position: fixed;
  bottom: 0;
  right: calc(var(--space-lg) + 64px);
  width: 340px;
  height: min(680px, calc(100vh - 100px));
  background: var(--cht-window-bg, var(--card-bg));
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow:
    0 -2px 24px rgba(0,0,0,0.12),
    0 8px 40px rgba(0,0,0,0.08),
    0 0 0 1px rgba(255,255,255,0.06) inset;
  z-index: var(--z-fixed);
  display: flex;
  flex-direction: column;
  overflow: visible;
  animation: slideUpFade 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
  transform: translateZ(0);
  will-change: transform, opacity;
}

.chat-window::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,0.04) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

.chat-window > * {
  position: relative;
  z-index: 1;
}

.chat-window:nth-child(2) {
  right: calc(var(--space-lg) + 64px + 336px);
}

.chat-window__header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--cht-hdr-bg, var(--primary));
  color: var(--cht-hdr-text, white);
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.chat-window__header::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.06) 50%, transparent 100%);
  background-size: 200% 100%;
  animation: headerShimmer 4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes headerShimmer {
  0%, 100% { background-position: 200% 0; }
  50% { background-position: -200% 0; }
}

.chat-window__header-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 2px solid var(--cht-hdr-border, rgba(255,255,255,0.3));
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 0 0 0 rgba(255,255,255,0);
}

.chat-window__header-avatar:hover {
  transform: scale(1.08);
  box-shadow: 0 0 16px rgba(255,255,255,0.25);
}

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

.chat-window__header-name {
  font-weight: 700;
  font-size: var(--font-size-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-window__header-status {
  font-size: var(--font-size-xs);
  opacity: 0.85;
}

.chat-window__header-actions {
  display: flex;
  gap: 4px;
}

.chat-window__header-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.1);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.875rem;
  transition: background var(--transition), transform 0.2s, box-shadow 0.2s;
}

.chat-window__header-btn:hover {
  background: rgba(255,255,255,0.3);
  transform: scale(1.1);
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.chat-window__header-btn:active {
  transform: scale(0.92);
}

.chat-window__messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-sm) var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  background: var(--cht-bg, transparent);
  background-image: var(--cht-bg-img, none);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
  z-index: 0;
  animation: var(--cht-bg-anim, none);
  scroll-behavior: smooth;
}

.chat-window__messages::-webkit-scrollbar {
  width: 4px;
}

.chat-window__messages::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.15);
  border-radius: 4px;
}

.chat-window__messages::-webkit-scrollbar-track {
  background: transparent;
}

/* Background dim overlay for readability */
.chat-window__messages::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--cht-bg-overlay, transparent);
  pointer-events: none;
  z-index: 0;
  transition: background 0.3s ease;
}

/* Ensure bubbles appear above the overlay */
.chat-window__messages > * {
  position: relative;
  z-index: 1;
}

.chat-bubble {
  max-width: 75%;
  padding: 8px 12px;
  border-radius: 18px;
  font-size: var(--font-size-sm);
  line-height: 1.4;
  word-break: break-word;
  position: relative;
  animation: bubbleIn3D 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
  transform: translateZ(0);
  will-change: transform;
}

@keyframes bubbleIn3D {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.chat-bubble--sent {
  background: var(--cht-sent-bg, var(--primary));
  color: var(--cht-sent-text, white);
  border-bottom-right-radius: var(--cht-sent-bbr, 4px);
  align-self: flex-end;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1), 0 0 0 1px rgba(255,255,255,0.06) inset;
  transition: transform 0.2s, box-shadow 0.2s;
}

.chat-bubble--sent:hover {
  transform: translateY(-1px) scale(1.01);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12), 0 0 0 1px rgba(255,255,255,0.08) inset;
}

.chat-bubble--received {
  background: var(--cht-rcv-bg, var(--bg));
  color: var(--cht-rcv-text, var(--text));
  border-bottom-left-radius: var(--cht-rcv-bbl, 4px);
  align-self: flex-start;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  transition: transform 0.2s, box-shadow 0.2s;
}

.chat-bubble--received:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 12px rgba(0,0,0,0.08);
}

.chat-bubble__time {
  font-size: 10px;
  opacity: 0.7;
  margin-top: 2px;
  text-align: right;
  display: block;
}

.chat-bubble--received .chat-bubble__time {
  text-align: left;
}

/* Typing indicator */
.chat-typing {
  display: flex;
  gap: 5px;
  align-items: center;
  padding: 10px 14px;
  background: var(--cht-rcv-bg, var(--bg));
  border-radius: 18px;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  width: fit-content;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.chat-typing__dot {
  width: 7px;
  height: 7px;
  border-radius: var(--radius-full);
  background: var(--cht-accent, var(--primary));
  animation: typingDot3D 1.4s ease-in-out infinite;
  transform: translateZ(0);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.chat-typing__dot:nth-child(2) {
  animation-delay: 0.2s;
}

.chat-typing__dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingDot3D {
  0%, 60%, 100% {
    transform: translateY(0) scale(1);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-8px) scale(1.15);
    opacity: 1;
  }
}

.chat-window__input-area {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm);
  border-top: 1px solid var(--cht-in-border, var(--border-light));
  background: var(--cht-in-area-bg, transparent);
  flex-shrink: 0;
  position: relative;
  backdrop-filter: blur(8px);
}

.chat-window__input {
  flex: 1;
  min-width: 110px;
  min-height: 36px;
  max-height: 66px;
  background: var(--cht-in-bg, var(--bg));
  border: none;
  border-radius: 6px;
  padding: 0 5px;
  font-size: 0.65rem;
  color: var(--text);
  resize: none;
  outline: none;
  overflow: auto;
  line-height: 1.2;
  transition: box-shadow 0.2s;
}

.chat-window__input:focus {
  box-shadow: 0 0 0 2px var(--cht-accent, var(--primary));
}
  overflow: auto;
  line-height: 1.2;
}

.chat-window__input::placeholder {
  color: var(--text-muted);
}

.chat-window__send-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  background: var(--cht-accent, var(--primary));
  border: none;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.875rem;
  transition: background var(--transition), transform 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15), 0 0 0 1px rgba(255,255,255,0.1) inset;
  position: relative;
  overflow: hidden;
}

.chat-window__send-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.2) 0%, transparent 60%);
  pointer-events: none;
}

.chat-window__send-btn:hover {
  background: var(--cht-accent-hover, var(--primary-dark));
  transform: scale(1.08);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2), 0 0 0 1px rgba(255,255,255,0.15) inset;
}

.chat-window__send-btn:active {
  transform: scale(0.92);
}

.chat-window__send-btn svg {
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.15));
}

.chat-window__emoji-btn,
.chat-window__attach-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  background: none;
  border: none;
  color: var(--cht-icon-color, var(--primary));
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: 500;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
}

.chat-window__emoji-btn:hover,
.chat-window__attach-btn:hover {
  background: var(--cht-icon-hover-bg, var(--primary-light));
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.chat-window__emoji-btn:active,
.chat-window__attach-btn:active {
  transform: scale(0.92);
}

/* Picker toolbar in chat input */
.chat-window__picker-toolbar {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

.chat-window__picker-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: none;
  border: none;
  color: var(--cht-picker-color, var(--text-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: background 0.2s ease, color var(--transition), transform 0.15s ease, box-shadow 0.2s;
  flex-shrink: 0;
  padding: 0;
}

.chat-window__picker-btn:hover {
  background: var(--cht-picker-hover-bg, var(--primary-light));
  color: var(--cht-picker-hover-color, var(--primary));
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.chat-window__picker-btn:active {
  transform: scale(0.92);
}

/* Media picker panel */
.chat-media-picker {
  border-top: 1px solid var(--border-light);
  background: var(--card-bg);
  display: flex;
  flex-direction: column;
  animation: slideUpFade 0.15s ease both;
  position: relative;
  /* overflow: visible so hover preview can float above */
  overflow: visible;
  flex-shrink: 0;
}

/* The scrollable body is height-constrained, not the outer container */
.chat-media-picker .chat-media-picker__body {
  max-height: 210px;
  overflow-y: auto;
}

/* Header contains search + category tabs */
.chat-media-picker__header {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--border-light);
}

.chat-media-picker__header .chat-media-picker__search {
  border-bottom: none;
  padding: 6px 8px 4px;
}

.chat-media-picker__header .chat-media-picker__tabs {
  border-bottom: none;
  padding: 0 8px 6px;
}

.chat-media-picker__tabs {
  display: flex;
  gap: 2px;
  padding: 6px 8px;
  overflow-x: auto;
  flex-shrink: 0;
  scrollbar-width: none;
  border-bottom: 1px solid var(--border-light);
}

.chat-media-picker__tabs::-webkit-scrollbar {
  display: none;
}

.chat-media-picker__tab {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 600;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
}

.chat-media-picker__tab.active {
  background: var(--primary);
  color: white;
}

.chat-media-picker__tab:hover:not(.active) {
  background: var(--bg);
}

.chat-media-picker__body {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
}

.chat-media-picker__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}

.chat-media-picker__emoji {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: none;
  border: none;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  padding: 0;
}

.chat-media-picker__emoji:hover {
  background: var(--bg);
  transform: scale(1.2);
}

.chat-media-picker__grid--media {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.chat-media-picker__media {
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color var(--transition), transform var(--transition);
  padding: 0;
  aspect-ratio: 1;
}

.chat-media-picker__media:hover {
  border-color: var(--primary);
  transform: scale(1.02);
}

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

.chat-media-picker__media--sticker {
  background: var(--bg);
}

.chat-media-picker__search {
  padding: 6px 8px;
  flex-shrink: 0;
}

.chat-media-picker__search-input {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 12px;
  background: var(--bg);
  color: var(--text);
  outline: none;
  box-sizing: border-box;
  transition: border-color var(--transition);
}

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

.chat-media-picker__search-input::placeholder {
  color: var(--text-muted);
}

/* Emoji modal */
.emoji-modal-overlay {
  z-index: 10000 !important;
  backdrop-filter: blur(6px);
}

.emoji-modal {
  max-width: 480px !important;
  max-height: 70vh !important;
  width: 90vw !important;
  border-radius: var(--radius) !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}

.emoji-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

.emoji-modal__title {
  font-weight: 600;
  font-size: var(--font-size-base);
  color: var(--text);
}

.emoji-modal__close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  border-radius: var(--radius-xs);
  transition: color var(--transition), background var(--transition);
}

.emoji-modal__close:hover {
  color: var(--text);
  background: var(--bg);
}

.emoji-modal__tabs {
  display: flex;
  gap: 2px;
  padding: 6px 8px;
  overflow-x: auto;
  flex-shrink: 0;
  scrollbar-width: none;
  border-bottom: 1px solid var(--border-light);
}

.emoji-modal__tabs::-webkit-scrollbar {
  display: none;
}

.emoji-modal__tab {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 600;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
}

.emoji-modal__tab.active {
  background: var(--primary);
  color: white;
}

.emoji-modal__tab:hover:not(.active) {
  background: var(--bg);
}

.emoji-modal__body {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  min-height: 200px;
}

.emoji-modal__loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
}

.emoji-modal__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}

.emoji-modal__emoji {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  background: none;
  border: none;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  padding: 0;
}

.emoji-modal__emoji:hover {
  background: var(--bg);
  transform: scale(1.25);
}

.emoji-modal__emoji img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  pointer-events: none;
}

/* Animated emoji in chat bubble */
.chat-media-bubble__emoji-gif {
  width: 80px;
  max-width: 100%;
  border-radius: 8px;
  display: block;
}

/* Media message bubbles */
.chat-media-bubble {
  max-width: 100%;
}

.chat-media-bubble__img {
  width: 180px;
  max-width: 100%;
  border-radius: 12px;
  display: block;
  cursor: pointer;
  transition: opacity var(--transition);
}

.chat-media-bubble__img:hover {
  opacity: 0.9;
}

.chat-media-bubble__caption {
  font-size: var(--font-size-xs);
  opacity: 0.85;
  margin-top: 4px;
}

.chat-media-bubble--sticker .chat-media-bubble__sticker {
  width: 140px;
  max-width: 100%;
  border-radius: 8px;
  display: block;
}

.chat-media-bubble--emoji {
  font-size: 32px;
  line-height: 1.2;
}

/* File bubbles (image, video, file attachment) */
.chat-file-bubble {
  max-width: 100%;
}

.chat-file-bubble--image .chat-file-bubble__img {
  width: 200px;
  max-width: 100%;
  border-radius: 12px;
  display: block;
  cursor: pointer;
  transition: opacity var(--transition);
}

.chat-file-bubble--image .chat-file-bubble__img:hover {
  opacity: 0.9;
}

.chat-file-bubble--video .chat-file-bubble__video {
  width: 220px;
  max-width: 100%;
  border-radius: 12px;
  display: block;
  max-height: 260px;
}

.chat-file-bubble--file {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
  min-width: 180px;
}

.chat-file-bubble__icon {
  font-size: 24px;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-file-bubble__info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chat-file-bubble__name {
  font-size: 0.8rem;
  font-weight: 500;
  color: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-file-bubble__size {
  font-size: 0.7rem;
  opacity: 0.7;
}

.chat-file-bubble__download {
  font-size: 18px;
  flex-shrink: 0;
  text-decoration: none;
  opacity: 0.8;
  transition: opacity 0.15s, transform 0.15s;
  cursor: pointer;
}

.chat-file-bubble__download:hover {
  opacity: 1;
  transform: scale(1.15);
}

.chat-file-bubble__caption {
  font-size: var(--font-size-xs);
  opacity: 0.85;
  margin-top: 4px;
}

/* Date separator in chat */
.chat-date-separator {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--text-muted);
  font-size: var(--font-size-xs);
  margin: var(--space-xs) 0;
}

.chat-date-separator::before,
.chat-date-separator::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-light);
}

/* ==========================================================================
   11. NOTIFICATIONS DROPDOWN
   ========================================================================== */
.notifications-dropdown {
  position: fixed;
  top: calc(var(--nav-height) + 8px);
  right: var(--space-md);
  width: 360px;
  max-height: 480px;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xl);
  z-index: var(--z-dropdown);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: scaleIn 0.18s ease both;
  transform-origin: top right;
}

.notifications-dropdown.hidden {
  display: none;
}

.notifications-dropdown__header {
  padding: var(--space-md);
  font-weight: 800;
  font-size: var(--font-size-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.notifications-dropdown__header-action {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
}

.notifications-dropdown__tabs {
  display: flex;
  padding: 0 var(--space-md);
  gap: var(--space-xs);
  flex-shrink: 0;
  margin-bottom: var(--space-xs);
}

.notifications-dropdown__tab {
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  background: none;
  border: none;
  color: var(--text-secondary);
}

.notifications-dropdown__tab.active {
  background: var(--primary-light);
  color: var(--primary);
}

.notifications-dropdown__tab:hover {
  background: var(--bg);
}

.notifications-dropdown__list {
  overflow-y: auto;
  flex: 1;
}

.notification-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  cursor: pointer;
  transition: background var(--transition);
  position: relative;
}

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

.notification-item.unread {
  background: var(--primary-light);
}

.notification-item.unread:hover {
  background: #d5e8fc;
}

.notification-item__avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.notification-item__avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  object-fit: cover;
}

.notification-item__icon {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  border: 2px solid var(--card-bg);
}

.notification-item__icon--like {
  background: var(--primary);
  color: white;
}

.notification-item__icon--comment {
  background: var(--success);
  color: white;
}

.notification-item__icon--share {
  background: var(--warning);
  color: white;
}

.notification-item__icon--friend {
  background: var(--secondary);
  color: white;
}

.notification-item__icon--match {
  background: var(--gradient-match);
  color: white;
}

.notification-item--clickable {
  transition: background-color 0.2s ease;
}

.notification-item--clickable:hover {
  background-color: var(--bg);
}

.notification-item--clickable:active {
  background-color: var(--primary-light);
}

.notification-item__actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.notification-item__content {
  flex: 1;
  min-width: 0;
}

.notification-item__text {
  font-size: var(--font-size-sm);
  color: var(--text);
  line-height: 1.4;
}

.notification-item__text strong {
  font-weight: 700;
}

.notification-item__time {
  font-size: var(--font-size-xs);
  color: var(--primary);
  font-weight: 600;
  margin-top: 2px;
  display: block;
}

.notification-item__actions {
   display: flex;
   gap: var(--space-xs);
   margin-top: var(--space-xs);
   flex-shrink: 0;
}

/* Unread dot indicator */
.notification-item__unread-dot {
   position: absolute;
   top: 12px;
   right: 12px;
   width: 8px;
   height: 8px;
   background: var(--primary);
   border-radius: 50%;
}

/* Ensure action buttons are small */
.notification-item__actions .btn--xs {
   padding: 2px 6px;
   font-size: var(--font-size-xs);
}

/* ==========================================================================
   12. FRIEND REQUESTS
   ========================================================================== */
.friend-requests {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--space-md);
}

.friend-requests__title {
  font-size: var(--font-size-lg);
  font-weight: 800;
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.friend-request-item {
  display: flex;
  gap: var(--space-sm);
  align-items: flex-start;
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--border-light);
}

.friend-request-item:last-child {
  border-bottom: none;
}

.friend-request-item__avatar {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}

.friend-request-item__info {
  flex: 1;
  min-width: 0;
}

.friend-request-item__name {
  font-weight: 700;
  font-size: var(--font-size-sm);
  color: var(--text);
}

.friend-request-item__mutual {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  margin-top: 2px;
}

.friend-request-item__actions {
  display: flex;
  gap: var(--space-xs);
  margin-top: var(--space-xs);
}

/* ==========================================================================
   13. ADMIN DASHBOARD
   ========================================================================== */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: var(--sidebar-left-width);
  background: var(--sidebar-admin-bg);
  color: #e4e6eb;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: var(--z-fixed);
  overflow-y: auto;
  flex-shrink: 0;
}

.admin-sidebar__logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-lg) var(--space-md);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  text-decoration: none;
}

.admin-sidebar__logo-icon {
  width: 36px;
  height: 36px;
  background: var(--gradient-primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 900;
  color: white;
}

.admin-sidebar__logo-text {
  font-weight: 800;
  font-size: var(--font-size-base);
  color: white;
}

.admin-sidebar__logo-badge {
  font-size: var(--font-size-xs);
  background: var(--secondary);
  color: white;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  font-weight: 700;
  margin-left: auto;
}

.admin-nav {
  flex: 1;
  padding: var(--space-md) 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.admin-nav__section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.35);
  padding: var(--space-md) var(--space-md) var(--space-xs);
}

.admin-nav__item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px var(--space-md);
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  text-decoration: none;
  font-size: var(--font-size-sm);
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
  position: relative;
  margin: 0 var(--space-xs);
  border-radius: var(--radius-sm);
}

.admin-nav__item:hover {
  background: rgba(255,255,255,0.08);
  color: white;
}

.admin-nav__item.active {
  background: var(--primary);
  color: white;
  font-weight: 700;
}

.admin-nav__icon {
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}

.admin-nav__badge {
  margin-left: auto;
  background: var(--secondary);
  color: white;
  font-size: 10px;
  font-weight: 700;
  border-radius: var(--radius-full);
  padding: 1px 6px;
  min-width: 20px;
  text-align: center;
}

.admin-sidebar__footer {
  padding: var(--space-md);
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.admin-sidebar__footer-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  object-fit: cover;
}

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

.admin-sidebar__footer-name {
  font-size: var(--font-size-sm);
  font-weight: 700;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-sidebar__footer-role {
  font-size: var(--font-size-xs);
  color: rgba(255,255,255,0.5);
}

/* Admin main content */
.admin-main {
  flex: 1;
  margin-left: var(--sidebar-left-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.admin-topbar {
  position: sticky;
  top: 0;
  height: var(--nav-height);
  background: var(--card-bg);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  padding: 0 var(--space-xl);
  gap: var(--space-md);
  z-index: var(--z-sticky);
}

.admin-topbar__title {
  font-weight: 800;
  font-size: var(--font-size-lg);
}

.admin-topbar__spacer {
  flex: 1;
}

.admin-content {
  flex: 1;
  padding: var(--space-xl);
  background: var(--bg);
}

.admin-page-title {
  font-size: var(--font-size-2xl);
  font-weight: 800;
  margin-bottom: var(--space-xl);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* Admin stats cards */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.admin-stat-card {
  border-radius: var(--radius);
  padding: var(--space-lg);
  color: white;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.admin-stat-card::after {
  content: "";
  position: absolute;
  width: 100px;
  height: 100px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.12);
  top: -20px;
  right: -20px;
}

.admin-stat-card--blue {
  background: linear-gradient(135deg, #1877f2, #1558b0);
}

.admin-stat-card--pink {
  background: linear-gradient(135deg, #e4405f, #c0314f);
}

.admin-stat-card--green {
  background: linear-gradient(135deg, #42b72a, #2d8a1b);
}

.admin-stat-card--orange {
  background: linear-gradient(135deg, #f7b928, #e09000);
}

.admin-stat-card--purple {
  background: linear-gradient(135deg, #7c3aed, #5b21b6);
}

.admin-stat-card__label {
  font-size: var(--font-size-sm);
  opacity: 0.85;
  margin-bottom: var(--space-xs);
  font-weight: 500;
}

.admin-stat-card__value {
  font-size: var(--font-size-3xl);
  font-weight: 900;
  line-height: 1;
  margin-bottom: var(--space-xs);
}

.admin-stat-card__change {
  font-size: var(--font-size-xs);
  opacity: 0.85;
  display: flex;
  align-items: center;
  gap: 4px;
}

.admin-stat-card__icon {
  position: absolute;
  bottom: var(--space-md);
  right: var(--space-md);
  font-size: 2.5rem;
  opacity: 0.2;
}

/* Admin table */
.admin-table-wrap {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: var(--space-xl);
}

.admin-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-light);
}

.admin-table-title {
  font-weight: 700;
  font-size: var(--font-size-lg);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
}

.admin-table th {
  padding: 12px var(--space-lg);
  text-align: left;
  font-weight: 700;
  color: var(--text-secondary);
  background: var(--bg);
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.admin-table td {
  padding: 12px var(--space-lg);
  border-bottom: 1px solid var(--border-light);
  color: var(--text);
  vertical-align: middle;
}

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

.admin-table tbody tr:nth-child(even) td {
  background: rgba(0,0,0,0.015);
}

.admin-table tbody tr:hover td {
  background: var(--primary-light);
}

.admin-table__user {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.admin-table__avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  object-fit: cover;
}

.admin-table__name {
  font-weight: 600;
}

.admin-table__email {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

/* Status badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.badge--active {
  background: var(--success-light);
  color: var(--success);
}

.badge--active::before {
  background: var(--success);
}

.badge--blocked {
  background: var(--danger-light);
  color: var(--danger);
}

.badge--blocked::before {
  background: var(--danger);
}

.badge--admin {
  background: var(--primary-light);
  color: var(--primary);
}

.badge--admin::before {
  background: var(--primary);
}

.badge--pending {
  background: var(--warning-light);
  color: #a07000;
}

.badge--pending::before {
  background: var(--warning);
}

.badge--plain {
  background: var(--bg);
  color: var(--text-secondary);
}

.badge--plain::before {
  display: none;
}

/* Admin action buttons row */
.admin-table__actions {
  display: flex;
  gap: var(--space-xs);
}

/* ==========================================================================
   14. ONLINE STATUS DOT
   ========================================================================== */
.online-dot {
  width: 12px;
  height: 12px;
  border-radius: var(--radius-full);
  background: var(--success);
  border: 2px solid var(--card-bg);
  position: absolute;
  bottom: 1px;
  right: 1px;
  flex-shrink: 0;
}

.online-dot--lg {
  width: 14px;
  height: 14px;
}

.online-dot--sm {
  width: 10px;
  height: 10px;
}

/* ==========================================================================
   15. STORY BAR
   ========================================================================== */
.story-bar {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--space-md);
  overflow: hidden;
}

.story-bar__scroll {
  display: flex;
  gap: var(--space-sm);
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 4px;
  scroll-snap-type: x mandatory;
}

.story-bar__scroll::-webkit-scrollbar {
  display: none;
}

.story-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  cursor: pointer;
  scroll-snap-align: start;
  width: 64px;
}

.story-item__circle {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  padding: 2px;
  background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
  transition: transform var(--transition), box-shadow var(--transition);
  position: relative;
}

.story-item.seen .story-item__circle {
  background: var(--border);
}

.story-item__circle:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(228, 64, 95, 0.35);
}

.story-item__img {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 2.5px solid var(--card-bg);
}

.story-item__add {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  background: var(--primary);
  border: 2px solid var(--card-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.story-item__name {
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--text);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}

/* ==========================================================================
   16. MODAL
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  animation: fadeIn 0.2s ease both;
  backdrop-filter: blur(4px);
}

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

.modal {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: modalIn 0.25s ease both;
  overflow: hidden;
}

.modal--sm {
  max-width: 360px;
}

.modal--lg {
  max-width: 720px;
}

.modal__header {
  display: flex;
  align-items: center;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

.modal__title {
  flex: 1;
  font-weight: 800;
  font-size: var(--font-size-lg);
  text-align: center;
  padding: 0 var(--space-lg);
}

.modal__close {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--bg);
  border: none;
  color: var(--text);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition);
  margin-left: auto;
  flex-shrink: 0;
}

.modal__close:hover {
  background: var(--border);
}

.modal__body {
  overflow-y: auto;
  padding: var(--space-lg);
  flex: 1;
}

.modal__footer {
  display: flex;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--border-light);
  flex-shrink: 0;
  justify-content: flex-end;
}

/* ==========================================================================
   17. BUTTONS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: 8px var(--space-md);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  font-weight: 700;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background var(--transition), color var(--transition),
    box-shadow var(--transition), transform var(--transition),
    border-color var(--transition);
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.3;
  user-select: none;
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Sizes */
.btn--xs {
  padding: 4px 10px;
  font-size: var(--font-size-xs);
  border-radius: var(--radius-xs);
  gap: 3px;
}

.btn--sm {
  padding: 6px 12px;
  font-size: var(--font-size-xs);
}

.btn--lg {
  padding: 12px 28px;
  font-size: var(--font-size-base);
  border-radius: var(--radius);
}

.btn--full {
  width: 100%;
}

.btn--round {
  border-radius: var(--radius-full);
}

.btn--icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-full);
}

.btn--icon.btn--sm {
  width: 30px;
  height: 30px;
}

.btn--icon.btn--lg {
  width: 44px;
  height: 44px;
}

/* Variants */
.btn--primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.btn--primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  box-shadow: 0 4px 12px rgba(24, 119, 242, 0.35);
}

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

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

.btn--danger {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}

.btn--danger:hover {
  background: #c62828;
  border-color: #c62828;
  box-shadow: 0 4px 12px rgba(229, 57, 53, 0.35);
}

.btn--success {
  background: var(--success);
  color: white;
  border-color: var(--success);
}

.btn--success:hover {
  background: #2d8a1b;
  border-color: #2d8a1b;
  box-shadow: 0 4px 12px rgba(66, 183, 42, 0.35);
}

.btn--outline-primary {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

.btn--outline-primary:hover {
  background: var(--primary-light);
}

.btn--outline-secondary {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}

.btn--outline-secondary:hover {
  background: var(--bg);
  color: var(--text);
}

.btn--outline-danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger);
}

.btn--outline-danger:hover {
  background: var(--danger-light);
}

.btn--ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}

.btn--ghost:hover {
  background: var(--bg);
  color: var(--text);
}

/* ==========================================================================
   18. FORMS
   ========================================================================== */
.form-group {
  margin-bottom: var(--space-md);
}

.form-label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-xs);
}

.form-label--required::after {
  content: " *";
  color: var(--danger);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  height: 44px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 var(--space-md);
  font-size: var(--font-size-base);
  color: var(--text);
  background: var(--card-bg);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  appearance: none;
}

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

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.form-input.error,
.form-select.error,
.form-textarea.error {
  border-color: var(--danger);
  box-shadow: none;
}

.form-input.error:focus,
.form-select.error:focus,
.form-textarea.error:focus {
  box-shadow: 0 0 0 3px var(--danger-light);
}

.form-input.success {
  border-color: var(--success);
}

.form-textarea {
  height: auto;
  min-height: 100px;
  padding: var(--space-sm) var(--space-md);
  resize: vertical;
  line-height: 1.5;
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2365676b' d='M1.41 0L6 4.58 10.59 0 12 1.41l-6 6-6-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-md) center;
  padding-right: 40px;
  cursor: pointer;
}

.form-error {
  font-size: var(--font-size-xs);
  color: var(--danger);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.form-hint {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  margin-top: 4px;
}

/* Input with icon */
.form-input-wrap {
  position: relative;
}

.form-input-wrap .form-input {
  padding-left: 40px;
}

.form-input-wrap .form-input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1rem;
  pointer-events: none;
}

.form-input-wrap .form-input-suffix {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--transition);
}

.form-input-wrap .form-input-suffix:hover {
  color: var(--text);
}

.form-input-wrap.has-suffix .form-input {
  padding-right: 40px;
}

/* Checkbox & Radio */
.form-check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  cursor: pointer;
}

.form-check__input {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-radius: var(--radius-xs);
  cursor: pointer;
  appearance: none;
  background: var(--card-bg);
  flex-shrink: 0;
  margin-top: 2px;
  transition: border-color var(--transition), background var(--transition);
}

.form-check__input[type="radio"] {
  border-radius: var(--radius-full);
}

.form-check__input:checked {
  background: var(--primary);
  border-color: var(--primary);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='white' d='M6.5 12L2 7.5l1.5-1.5 3 3 6-6L14 4.5z'/%3E%3C/svg%3E");
  background-size: 12px;
  background-position: center;
  background-repeat: no-repeat;
}

.form-check__input[type="radio"]:checked {
  background-image: none;
  box-shadow: inset 0 0 0 3px var(--card-bg);
}

.form-check__label {
  font-size: var(--font-size-sm);
  color: var(--text);
  line-height: 1.4;
}

/* ==========================================================================
   19. LOADING SKELETON
   ========================================================================== */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--border-light) 25%,
    rgba(255, 255, 255, 0.5) 50%,
    var(--border-light) 75%
  );
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: var(--radius-xs);
  display: block;
}

.skeleton--text {
  height: 14px;
  border-radius: var(--radius-full);
}

.skeleton--text-sm {
  height: 10px;
  border-radius: var(--radius-full);
}

.skeleton--circle {
  border-radius: var(--radius-full);
}

.skeleton--btn {
  height: 36px;
  border-radius: var(--radius-sm);
}

.skeleton-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--space-md);
}

.skeleton-card__header {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
  margin-bottom: var(--space-md);
}

.skeleton-card__content {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.skeleton-card__image {
  width: 100%;
  height: 200px;
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   20. TOAST NOTIFICATIONS
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: var(--space-lg);
  right: var(--space-lg);
  display: flex;
  flex-direction: column-reverse;
  gap: var(--space-sm);
  z-index: var(--z-toast);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: var(--space-sm) var(--space-md);
  min-width: 280px;
  max-width: 360px;
  pointer-events: all;
  border-left: 4px solid var(--primary);
  animation: toastIn 0.3s ease both;
  position: relative;
}

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

.toast--success {
  border-left-color: var(--success);
}

.toast--error {
  border-left-color: var(--danger);
}

.toast--warning {
  border-left-color: var(--warning);
}

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

.toast__icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.toast--success .toast__icon {
  color: var(--success);
}

.toast--error .toast__icon {
  color: var(--danger);
}

.toast--warning .toast__icon {
  color: var(--warning);
}

.toast--info .toast__icon {
  color: var(--primary);
}

.toast__content {
  flex: 1;
  min-width: 0;
}

.toast__title {
  font-weight: 700;
  font-size: var(--font-size-sm);
  color: var(--text);
  margin-bottom: 2px;
}

.toast__message {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  line-height: 1.4;
}

.toast__close {
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
  flex-shrink: 0;
}

.toast__close:hover {
  background: var(--bg);
  color: var(--text);
}

.toast__progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--primary);
  border-radius: 0 0 0 var(--radius-sm);
  animation: toastProgress 4s linear forwards;
}

.toast--success .toast__progress {
  background: var(--success);
}

.toast--error .toast__progress {
  background: var(--danger);
}

.toast--warning .toast__progress {
  background: var(--warning);
}

/* ==========================================================================
   21. SEARCH RESULTS DROPDOWN
   ========================================================================== */
.search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-xl);
  z-index: var(--z-dropdown);
  overflow: hidden;
  animation: scaleIn 0.15s ease both;
  transform-origin: top center;
  max-height: 420px;
  overflow-y: auto;
}

.search-dropdown.hidden {
  display: none;
}

.search-dropdown__section-title {
  padding: var(--space-sm) var(--space-md) var(--space-xs);
  font-size: var(--font-size-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 8px var(--space-md);
  cursor: pointer;
  transition: background var(--transition);
  text-decoration: none;
}

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

.search-result-item__avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  object-fit: cover;
  flex-shrink: 0;
}

.search-result-item__icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 1rem;
  flex-shrink: 0;
}

.search-result-item__info {
  flex: 1;
  min-width: 0;
}

.search-result-item__name {
  font-weight: 600;
  font-size: var(--font-size-sm);
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-item__meta {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.search-result-item__name em {
  font-style: normal;
  color: var(--primary);
  font-weight: 700;
}

.search-dropdown__empty {
  padding: var(--space-xl) var(--space-md);
  text-align: center;
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}

/* ==========================================================================
   22. CONNECT / MATCH BUTTON
   ========================================================================== */
.btn--match {
  background: var(--gradient-match);
  color: white;
  border: none;
  border-radius: var(--radius-full);
  padding: 10px var(--space-lg);
  font-weight: 700;
  font-size: var(--font-size-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
  box-shadow: 0 4px 16px rgba(228, 64, 95, 0.4);
  position: relative;
  overflow: hidden;
}

.btn--match::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background var(--transition);
}

.btn--match:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(228, 64, 95, 0.55);
}

.btn--match:hover::before {
  background: rgba(255,255,255,0.1);
}

.btn--match:active {
  transform: scale(0.97);
}

.btn--match.matched {
  animation: matchPop 0.5s ease both;
}

.btn--match .heart-icon {
  display: inline-block;
  transition: transform var(--transition);
}

.btn--match:hover .heart-icon {
  animation: heartbeat 0.5s ease;
}

/* Tinder-style like/dislike buttons */
.swipe-actions {
  display: flex;
  justify-content: center;
  gap: var(--space-xl);
  padding: var(--space-md);
}

.swipe-btn {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  border: 3px solid;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  box-shadow: var(--shadow-md);
}

.swipe-btn--dislike {
  border-color: var(--danger);
  color: var(--danger);
}

.swipe-btn--dislike:hover {
  background: var(--danger);
  color: white;
  transform: scale(1.1) rotate(-10deg);
  box-shadow: 0 6px 16px rgba(229, 57, 53, 0.4);
}

.swipe-btn--like {
  border-color: var(--secondary);
  color: var(--secondary);
}

.swipe-btn--like:hover {
  background: var(--secondary);
  color: white;
  transform: scale(1.1) rotate(10deg);
  box-shadow: 0 6px 16px rgba(228, 64, 95, 0.4);
}

.swipe-btn--superlike {
  width: 48px;
  height: 48px;
  font-size: 1.1rem;
  border-color: var(--warning);
  color: var(--warning);
}

.swipe-btn--superlike:hover {
  background: var(--warning);
  color: white;
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(247, 185, 40, 0.4);
}

/* Match overlay / banner */
.match-banner {
  background: var(--gradient-match);
  color: white;
  text-align: center;
  padding: var(--space-2xl) var(--space-lg);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  animation: matchIn 0.5s ease both;
}

.match-banner::before,
.match-banner::after {
  content: "🎉";
  position: absolute;
  font-size: 3rem;
  opacity: 0.15;
  animation: confettiFloat 2s ease-in-out infinite;
}

.match-banner::before {
  top: 10px;
  left: 20px;
}

.match-banner::after {
  bottom: 10px;
  right: 20px;
  animation-delay: 0.5s;
}

.match-banner__icon {
  font-size: 3rem;
  display: block;
  margin-bottom: var(--space-sm);
  animation: heartbeat 1s ease 0.3s both;
}

.match-banner__title {
  font-size: var(--font-size-2xl);
  font-weight: 900;
  margin-bottom: var(--space-xs);
  color: white;
}

.match-banner__sub {
  font-size: var(--font-size-base);
  opacity: 0.9;
}

/* ==========================================================================
   23. MATCH POPUP — full-screen overlay
   ========================================================================== */

.match-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal, 9999);
  animation: fadeIn 0.3s ease both;
}

.match-popup {
  background: var(--gradient-match);
  color: white;
  text-align: center;
  padding: var(--space-2xl) var(--space-xl);
  border-radius: var(--radius-lg, 20px);
  max-width: 440px;
  width: calc(100% - var(--space-xl));
  position: relative;
  overflow: hidden;
  animation: matchIn 0.5s ease both;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.match-popup__hearts {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.match-popup__hearts span {
  position: absolute;
  font-size: 1.2rem;
  animation: floatHeart 3s ease-in-out infinite;
  opacity: 0.3;
}

.match-popup__hearts span:nth-child(1)  { top: 5%;  left: 10%; animation-delay: 0s;   font-size: 1.4rem; }
.match-popup__hearts span:nth-child(2)  { top: 15%; left: 80%; animation-delay: 0.3s; font-size: 1rem;   }
.match-popup__hearts span:nth-child(3)  { top: 40%; left: 5%;  animation-delay: 0.6s; font-size: 1.6rem; }
.match-popup__hearts span:nth-child(4)  { top: 60%; left: 85%; animation-delay: 0.9s; font-size: 1.1rem; }
.match-popup__hearts span:nth-child(5)  { top: 75%; left: 15%; animation-delay: 1.2s; font-size: 1.3rem; }
.match-popup__hearts span:nth-child(6)  { top: 10%; left: 45%; animation-delay: 1.5s; font-size: 0.9rem; }
.match-popup__hearts span:nth-child(7)  { top: 50%; left: 50%; animation-delay: 1.8s; font-size: 1.5rem; }
.match-popup__hearts span:nth-child(8)  { top: 80%; left: 70%; animation-delay: 2.1s; font-size: 1rem;   }
.match-popup__hearts span:nth-child(9)  { top: 25%; left: 25%; animation-delay: 2.4s; font-size: 1.2rem; }
.match-popup__hearts span:nth-child(10) { top: 70%; left: 35%; animation-delay: 2.7s; font-size: 1.1rem; }

.match-popup__avatars {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.match-popup__avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  animation: avatarPop 0.5s ease both;
}

.match-popup__avatar:first-child {
  animation-delay: 0.1s;
}

.match-popup__avatar:last-child {
  animation-delay: 0.3s;
}

.match-popup__heart-big {
  font-size: 2.4rem;
  animation: heartbeat 1s ease 0.5s infinite;
  filter: drop-shadow(0 2px 8px rgba(255, 64, 129, 0.4));
}

.match-popup__title {
  font-size: 1.8rem;
  font-weight: 900;
  line-height: 1.3;
  margin-bottom: var(--space-xs);
  color: white;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.match-popup__sub {
  font-size: var(--font-size-base);
  opacity: 0.9;
  margin-bottom: var(--space-lg);
}

.match-popup__actions {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ═══════════════════════════════════════════════════════════════════
   CHAT BACKGROUND ANIMATIONS
   ═══════════════════════════════════════════════════════════════════ */

/* Aurora — slow-shifting gradient */
@keyframes bgAurora {
  0% { background-position: 0% 50%; }
  25% { background-position: 100% 0%; }
  50% { background-position: 100% 100%; }
  75% { background-position: 0% 100%; }
  100% { background-position: 0% 50%; }
}

.chat-bg-anim-aurora {
  --cht-bg-anim: bgAurora 12s ease infinite;
  background-size: 400% 400% !important;
}

/* Waves — undulating motion */
@keyframes bgWaves {
  0% { background-position: 0% 50%; transform: scale(1); }
  50% { background-position: 100% 50%; transform: scale(1.02); }
  100% { background-position: 0% 50%; transform: scale(1); }
}

.chat-bg-anim-waves {
  --cht-bg-anim: bgWaves 8s ease-in-out infinite;
  background-size: 200% 200% !important;
}

/* Gentle Pulse — breathing effect */
@keyframes bgPulse {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 1; }
}

.chat-bg-anim-pulse {
  --cht-bg-anim: bgPulse 4s ease-in-out infinite;
}

/* Drift — slow horizontal pan */
@keyframes bgDrift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.chat-bg-anim-drift {
  --cht-bg-anim: bgDrift 15s ease-in-out infinite;
  background-size: 150% 150% !important;
}

/* Twinkle — subtle shimmer effect (uses pseudo-element) */
@keyframes bgTwinkle {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.6; }
}

.chat-bg-anim-twinkle::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(2px 2px at 20% 30%, rgba(255,255,255,0.3), transparent),
              radial-gradient(2px 2px at 40% 70%, rgba(255,255,255,0.2), transparent),
              radial-gradient(1px 1px at 60% 20%, rgba(255,255,255,0.4), transparent),
              radial-gradient(1px 1px at 80% 80%, rgba(255,255,255,0.2), transparent),
              radial-gradient(2px 2px at 10% 90%, rgba(255,255,255,0.3), transparent);
  background-size: 200% 200%;
  animation: bgTwinkle 3s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

/* ═══════════════════════════════════════════════════════════════════
   CHAT BACKGROUND PATTERNS (WhatsApp-style SVG textures)
   ═══════════════════════════════════════════════════════════════════ */

/* Dots pattern */
.chat-bg-pattern-dots {
  background-image: var(--cht-bg-img, radial-gradient(circle, rgba(0,0,0,0.06) 1px, transparent 1px));
  background-size: 20px 20px !important;
}

/* Diagonal lines */
.chat-bg-pattern-lines {
  background-image: var(--cht-bg-img, repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(0,0,0,0.04) 10px, rgba(0,0,0,0.04) 11px));
  background-size: 100% 100% !important;
}

/* Grid pattern */
.chat-bg-pattern-grid {
  background-image: var(--cht-bg-img, linear-gradient(rgba(0,0,0,0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(0,0,0,0.05) 1px, transparent 1px));
  background-size: 30px 30px !important;
}

/* Zigzag pattern */
.chat-bg-pattern-zigzag {
  background-image: var(--cht-bg-img, repeating-linear-gradient(-45deg, transparent, transparent 5px, rgba(0,0,0,0.03) 5px, rgba(0,0,0,0.03) 6px), repeating-linear-gradient(45deg, transparent, transparent 5px, rgba(0,0,0,0.03) 5px, rgba(0,0,0,0.03) 6px));
  background-size: 20px 20px !important;
}

/* Circles pattern */
.chat-bg-pattern-circles {
  background-image: var(--cht-bg-img, radial-gradient(circle at 25% 25%, rgba(0,0,0,0.04) 0%, rgba(0,0,0,0.04) 8%, transparent 8%), radial-gradient(circle at 75% 75%, rgba(0,0,0,0.04) 0%, rgba(0,0,0,0.04) 8%, transparent 8%));
  background-size: 40px 40px !important;
}

/* ░ pattern (subtle dots) */
.chat-bg-pattern-subtle {
  background-image: var(--cht-bg-img, radial-gradient(rgba(0,0,0,0.03) 1.5px, transparent 1.5px));
  background-size: 12px 12px !important;
}

/* ═══════════════════════════════════════════════════════════════════
   BACKGROUND DIM SLIDER IN THEME PICKER
   ═══════════════════════════════════════════════════════════════════ */

.chat-theme-picker__dim-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.chat-theme-picker__dim-row label {
  font-size: var(--font-size-sm);
  color: var(--text);
  min-width: 90px;
  flex-shrink: 0;
}

.chat-theme-picker__dim-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  outline: none;
  cursor: pointer;
}

.chat-theme-picker__dim-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.chat-theme-picker__dim-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.chat-theme-picker__dim-value {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  min-width: 36px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* Background presets mini-grid */
.chat-theme-picker__patterns {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-xs);
  margin-bottom: var(--space-md);
}

.chat-theme-picker__pattern-item {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  overflow: hidden;
  transition: all var(--transition);
  background: var(--bg);
}

.chat-theme-picker__pattern-item:hover {
  border-color: var(--primary-light);
  transform: scale(1.05);
}

.chat-theme-picker__pattern-item.active {
  border-color: var(--primary);
}

.chat-theme-picker__pattern-none {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--card-bg);
}

/* Animation presets mini-grid */
.chat-theme-picker__anim-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-xs);
  margin-bottom: var(--space-md);
}

.chat-theme-picker__anim-item {
  padding: var(--space-xs);
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  text-align: center;
  font-size: var(--font-size-xs);
  color: var(--text);
  background: var(--bg);
  transition: all var(--transition);
}

.chat-theme-picker__anim-item:hover {
  border-color: var(--primary-light);
}

.chat-theme-picker__anim-item.active {
  border-color: var(--primary);
  background: var(--primary-light);
}

.chat-theme-picker__anim-icon {
  font-size: 1.25rem;
  display: block;
  margin-bottom: 2px;
}

@keyframes avatarPop {
  0%   { transform: scale(0); opacity: 0; }
  60%  { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes floatHeart {
  0%, 100% { transform: translateY(0) scale(1); }
  50%      { transform: translateY(-20px) scale(1.1); }
}

.tag--rel {
  background: linear-gradient(135deg, #ff9a9e, #fad0c4);
  color: #7a2e3a;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 2px 8px rgba(255, 105, 135, 0.2);
  animation: relPulse 2s ease-in-out infinite;
}

@keyframes relPulse {
  0%, 100% { box-shadow: 0 2px 8px rgba(255, 105, 135, 0.2); }
  50%      { box-shadow: 0 2px 16px rgba(255, 105, 135, 0.4); }
}

.tag--rel a:hover {
  text-decoration: underline !important;
  opacity: 0.85;
}

/* ==========================================================================
   24. INTEREST TAGS
   ========================================================================== */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 600;
  background: var(--primary-light);
  color: var(--primary);
  border: 1.5px solid transparent;
  cursor: default;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
  white-space: nowrap;
}

.tag--interactive {
  cursor: pointer;
}

.tag--interactive:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  transform: scale(1.04);
}

.tag--selected {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.tag--pink {
  background: var(--secondary-light);
  color: var(--secondary);
}

.tag--pink.tag--selected {
  background: var(--secondary);
  color: white;
  border-color: var(--secondary);
}

.tag--success {
  background: var(--success-light);
  color: var(--success);
}

.tag--warning {
  background: var(--warning-light);
  color: #9a6f00;
}

.tag--gray {
  background: var(--bg);
  color: var(--text-secondary);
}

.tag__remove {
  font-size: 0.75rem;
  opacity: 0.7;
  cursor: pointer;
  transition: opacity var(--transition);
  line-height: 1;
}

.tag__remove:hover {
  opacity: 1;
}

.tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

/* ==========================================================================
   24. PHOTO GRID
   ========================================================================== */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
}

@media (min-width: 480px) {
  .photo-grid {
    gap: var(--space-xs);
  }
}

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

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

@media (min-width: 640px) {
  .photo-grid--4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

.photo-grid__item {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: var(--radius-xs);
  cursor: pointer;
  background: var(--bg);
}

.photo-grid__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.photo-grid__item:hover img {
  transform: scale(1.06);
}

.photo-grid__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}

.photo-grid__item:hover .photo-grid__overlay {
  background: rgba(0, 0, 0, 0.35);
}

.photo-grid__overlay-actions {
  display: flex;
  gap: var(--space-sm);
  opacity: 0;
  transform: scale(0.85);
  transition: opacity var(--transition), transform var(--transition);
}

.photo-grid__item:hover .photo-grid__overlay-actions {
  opacity: 1;
  transform: scale(1);
}

.photo-grid__overlay-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.9);
  border: none;
  color: var(--text);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition);
}

.photo-grid__overlay-btn:hover {
  background: white;
}

/* "More" overlay on last item */
.photo-grid__more {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: var(--font-size-2xl);
  font-weight: 800;
  cursor: pointer;
  transition: background var(--transition);
}

.photo-grid__more:hover {
  background: rgba(0, 0, 0, 0.7);
}

/* ==========================================================================
   25. MOBILE BOTTOM NAVIGATION
   ========================================================================== */
.mobile-nav {
  display: flex;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--nav-bg);
  border-top: 1px solid var(--border-light);
  z-index: var(--z-fixed);
  box-shadow: 0 -2px 8px rgba(0,0,0,0.08);
}

@media (min-width: 768px) {
  .mobile-nav {
    display: none;
  }
}

.mobile-nav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition);
  position: relative;
  font-size: var(--font-size-xs);
}

.mobile-nav__item:hover {
  color: var(--primary);
}

.mobile-nav__item.active {
  color: var(--primary);
}

.mobile-nav__icon {
  font-size: 1.35rem;
  transition: transform var(--transition);
}

.mobile-nav__item.active .mobile-nav__icon {
  transform: scale(1.1);
}

.mobile-nav__label {
  font-weight: 600;
  letter-spacing: -0.01em;
}

.mobile-nav__badge {
  position: absolute;
  top: 6px;
  left: 50%;
  margin-left: 4px;
  min-width: 16px;
  height: 16px;
  background: var(--danger);
  color: white;
  font-size: 9px;
  font-weight: 700;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  border: 2px solid var(--nav-bg);
  line-height: 1;
}

/* Add padding to body on mobile to account for bottom nav */
@media (max-width: 767px) {
  body {
    padding-bottom: 56px;
  }
}

/* ==========================================================================
   26. DROPDOWN MENUS (general)
   ========================================================================== */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown__menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 200px;
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-xl);
  z-index: var(--z-dropdown);
  overflow: hidden;
  animation: scaleIn 0.15s ease both;
  transform-origin: top right;
}

.dropdown__menu--up {
  top: auto;
  bottom: calc(100% + 6px);
  transform-origin: bottom right;
}

.dropdown__menu.hidden {
  display: none;
}

.dropdown__item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px var(--space-md);
  font-size: var(--font-size-sm);
  color: var(--text);
  cursor: pointer;
  transition: background var(--transition);
  text-decoration: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.dropdown__item:hover {
  background: var(--bg);
}

.dropdown__item--danger {
  color: var(--danger);
}

.dropdown__item--danger:hover {
  background: var(--danger-light);
}

.dropdown__divider {
  height: 1px;
  background: var(--border-light);
  margin: var(--space-xs) 0;
}

.dropdown__icon {
  font-size: 1rem;
  color: var(--text-secondary);
  width: 20px;
  text-align: center;
}

.dropdown__item--danger .dropdown__icon {
  color: var(--danger);
}

/* ==========================================================================
   27. CARD COMPONENTS (generic)
   ========================================================================== */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card--bordered {
  box-shadow: none;
  border: 1.5px solid var(--border);
}

.card__header {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card__title {
  font-weight: 700;
  font-size: var(--font-size-lg);
}

.card__body {
  padding: var(--space-lg);
}

.card__footer {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--border-light);
  background: var(--bg);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  justify-content: flex-end;
}

/* ==========================================================================
   28. PROGRESS & MISC UI
   ========================================================================== */
.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--border-light);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar__fill {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
}

.progress-bar--success .progress-bar__fill {
  background: var(--success);
}

.progress-bar--danger .progress-bar__fill {
  background: var(--danger);
}

/* Avatar group */
.avatar-group {
  display: flex;
}

.avatar-group__item {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  border: 2px solid var(--card-bg);
  margin-left: -8px;
  object-fit: cover;
}

.avatar-group__item:first-child {
  margin-left: 0;
}

.avatar-group__more {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  border: 2px solid var(--card-bg);
  margin-left: -8px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-xs);
  font-weight: 700;
  color: var(--text-secondary);
}

/* Divider with text */
.divider {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  margin: var(--space-sm) 0;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: var(--space-2xl) var(--space-lg);
  color: var(--text-muted);
}

.empty-state__icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
  opacity: 0.5;
}

.empty-state__title {
  font-weight: 700;
  font-size: var(--font-size-lg);
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
}

.empty-state__text {
  font-size: var(--font-size-sm);
}

/* Tooltip */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  font-size: var(--font-size-xs);
  padding: 4px 10px;
  border-radius: var(--radius-xs);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition);
  z-index: var(--z-dropdown);
}

[data-tooltip]:hover::after {
  opacity: 1;
}

/* ==========================================================================
   29. ANIMATIONS
   ========================================================================== */

/* Shimmer (skeleton) */
@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* Slide up + fade in */
@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade in */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Scale in (dropdowns, modals) */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Modal in */
@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Like button bounce */
@keyframes likeBounce {
  0% { transform: scale(1); }
  30% { transform: scale(1.4); }
  60% { transform: scale(0.9); }
  80% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* Heartbeat */
@keyframes heartbeat {
  0% { transform: scale(1); }
  25% { transform: scale(1.3); }
  50% { transform: scale(1); }
  75% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* Notification pulse */
@keyframes pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(229, 57, 53, 0.4); }
  50% { transform: scale(1.05); box-shadow: 0 0 0 6px rgba(229, 57, 53, 0); }
}

/* Typing dots */
@keyframes typingDot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* Chat bubble in */

/* Toast in */
@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Toast out */
@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateX(0);
    max-height: 100px;
  }
  to {
    opacity: 0;
    transform: translateX(40px);
    max-height: 0;
    padding: 0;
    margin: 0;
  }
}

/* Toast progress */
@keyframes toastProgress {
  from { width: 100%; }
  to { width: 0%; }
}

/* Float blob (auth bg) */
@keyframes floatBlob {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(10px, -15px) rotate(10deg); }
  66% { transform: translate(-8px, 10px) rotate(-8deg); }
}

/* Match pop */
@keyframes matchPop {
  0% { transform: scale(1); }
  30% { transform: scale(1.25) rotate(-3deg); }
  60% { transform: scale(0.92) rotate(2deg); }
  80% { transform: scale(1.08) rotate(-1deg); }
  100% { transform: scale(1) rotate(0deg); }
}

/* Match in (banner) */
@keyframes matchIn {
  from {
    opacity: 0;
    transform: scale(0.7) rotate(-5deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

/* Confetti float */
@keyframes confettiFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.15; }
  50% { transform: translateY(-12px) rotate(20deg); opacity: 0.25; }
}

/* Spin (loading) */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.spin {
  animation: spin 0.8s linear infinite;
}

/* Shake (error) */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

.shake {
  animation: shake 0.4s ease;
}

/* Glow (match) */
@keyframes glow {
  0%, 100% { box-shadow: 0 0 8px rgba(228, 64, 95, 0.4); }
  50% { box-shadow: 0 0 20px rgba(228, 64, 95, 0.8); }
}

.glow {
  animation: glow 2s ease-in-out infinite;
}

/* ==========================================================================
   30. UTILITY CLASSES
   ========================================================================== */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.flex-1 { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }
.flex-wrap { flex-wrap: wrap; }

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.text-xs { font-size: var(--font-size-xs); }
.text-sm { font-size: var(--font-size-sm); }
.text-base { font-size: var(--font-size-base); }
.text-lg { font-size: var(--font-size-lg); }
.text-xl { font-size: var(--font-size-xl); }
.text-2xl { font-size: var(--font-size-2xl); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-primary { color: var(--primary); }
.text-secondary-color { color: var(--secondary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
@media (min-width: 1100px) {
  .hide-desktop-lg { display: none !important; }
}
.font-bold { font-weight: 700; }
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-black { font-weight: 900; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.p-0 { padding: 0; }
.p-xs { padding: var(--space-xs); }
.p-sm { padding: var(--space-sm); }
.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }
.p-xl { padding: var(--space-xl); }
.mt-xs { margin-top: var(--space-xs); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-xs { margin-bottom: var(--space-xs); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }

.w-full { width: 100%; }
.min-w-0 { min-width: 0; }
.rounded { border-radius: var(--radius); }
.rounded-sm { border-radius: var(--radius-sm); }
.rounded-full { border-radius: var(--radius-full); }
.overflow-hidden { overflow: hidden; }
.relative { position: relative; }
.hidden { display: none !important; }
.visible { visibility: visible; }
.invisible { visibility: hidden; }
.opacity-50 { opacity: 0.5; }
.cursor-pointer { cursor: pointer; }
.pointer-events-none { pointer-events: none; }
.select-none { user-select: none; }
.line-clamp-2 { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.line-clamp-3 { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }

/* Responsive utilities */
@media (max-width: 767px) {
  .hide-mobile { display: none !important; }
}

@media (min-width: 768px) {
  .hide-desktop { display: none !important; }
  .show-mobile-only { display: none !important; }
}

/* ==========================================================================
   31. RESPONSIVE OVERRIDES
   ========================================================================== */
@media (max-width: 767px) {
  :root {
    --nav-height: 52px;
  }

  .auth-card {
    padding: var(--space-xl) var(--space-md);
  }

  .admin-sidebar {
    transform: translateX(-100%);
    transition: transform var(--transition);
  }

  .admin-sidebar.open {
    transform: translateX(0);
  }

  .admin-main {
    margin-left: 0;
  }

  .chat-window {
    right: 0;
    width: 100%;
    height: calc(100vh - 56px);
    border-radius: 0;
  }

  .chat-list-panel {
    right: 0;
    left: 0;
    width: auto;
  }

  .notifications-dropdown {
    right: 0;
    left: 0;
    width: auto;
  }

  .toast-container {
    bottom: calc(56px + var(--space-sm));
    right: var(--space-sm);
    left: var(--space-sm);
  }

  .toast {
    min-width: auto;
    max-width: none;
  }

  .modal {
    border-radius: var(--radius) var(--radius) 0 0;
    max-height: 90vh;
    align-self: flex-end;
    margin: auto -1px -1px;
  }

  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .profile-tabs {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .profile-tabs::-webkit-scrollbar {
    display: none;
  }

  .profile-cover {
    height: 180px;
  }

  .profile-avatar {
    width: 88px;
    height: 88px;
  }

  .swipe-actions {
    gap: var(--space-lg);
  }

  .swipe-btn {
    width: 56px;
    height: 56px;
    font-size: 1.3rem;
  }
}

@media (min-width: 768px) and (max-width: 1099px) {
  .layout__inner {
    grid-template-columns: var(--sidebar-left-width) 1fr;
  }
}

/* ==========================================================================
   SCROLL NAVIGATION — Floating directional controls
   ========================================================================== */

.scroll-nav {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: var(--z-fixed, 300);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--transition, 0.2s ease),
    transform var(--transition, 0.2s ease);
  pointer-events: none;
}

.scroll-nav.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.scroll-nav__row {
  display: flex;
  gap: 4px;
}

.scroll-nav__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: var(--radius-sm, 8px);
  background: var(--card-bg, #ffffff);
  color: var(--text, #050505);
  box-shadow: var(--shadow-md, 0 4px 12px rgba(0, 0, 0, 0.12));
  cursor: pointer;
  transition: background var(--transition, 0.2s ease),
    transform var(--transition, 0.2s ease), box-shadow var(--transition, 0.2s ease);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.scroll-nav__btn:hover {
  background: var(--primary-light, #e7f0fd);
  color: var(--primary, #1877f2);
  transform: scale(1.08);
  box-shadow: var(--shadow-lg, 0 8px 24px rgba(0, 0, 0, 0.15));
}

.scroll-nav__btn:active {
  transform: scale(0.94);
}

.scroll-nav__btn svg {
  display: block;
}

/* Hide on very small screens — user can just finger-scroll */
@media (max-width: 479px) {
  .scroll-nav {
    bottom: 16px;
    right: 16px;
  }
  .scroll-nav__btn {
    width: 34px;
    height: 34px;
  }
}

/* ── Admin Popup (triple-space trigger) ─────────────────────────── */
.admin-popup {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
  padding: var(--space-xl);
  width: 340px;
  max-width: calc(100vw - 32px);
  animation: slideUpFade 0.25s ease both;
}

.admin-popup.hidden {
  display: none;
}

.admin-popup__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.admin-popup__title {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--text);
}

.admin-popup__close {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  line-height: 1;
  border-radius: var(--radius-sm);
}

.admin-popup__close:hover {
  background: var(--hover-bg);
  color: var(--text);
}

.admin-popup .auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: var(--space-md);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.admin-popup .auth-tab {
  flex: 1;
  padding: 8px 12px;
  background: var(--card-bg);
  border: none;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.admin-popup .auth-tab.active {
  background: var(--primary);
  color: #fff;
}

.admin-popup .auth-tab:not(.active):hover {
  background: var(--hover-bg);
  color: var(--text);
}

.admin-popup .form-group {
  margin-bottom: var(--space-sm);
}

.admin-popup .btn--full {
  margin-top: var(--space-sm);
}

/* Print */
@media print {
  .scroll-nav {
    display: none !important;
  }
  
  /* ═══════════════════════════════════════════════════════════════════════
     CALL UI OVERLAY — WebRTC Audio/Video Calling
     ═══════════════════════════════════════════════════════════════════════ */
  
  .call-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    animation: callOverlayIn 0.3s ease-out;
  }
  
  @keyframes callOverlayIn {
    from { opacity: 0; }
    to   { opacity: 1; }
  }
  
  /* ── Incoming call content ──────────────────────────────────────────── */
  
  .call-overlay__content {
    text-align: center;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }
  
  /* Ring pulse animation */
  .call-overlay__ring-pulse {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    position: relative;
    margin-bottom: 8px;
  }
  
  .call-overlay__ring-pulse::before,
  .call-overlay__ring-pulse::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid rgba(24, 119, 242, 0.4);
    animation: ringPulse 1.5s ease-out infinite;
  }
  
  .call-overlay__ring-pulse::after {
    animation-delay: 0.75s;
  }
  
  .call-overlay__ring-pulse--slow::before,
  .call-overlay__ring-pulse--slow::after {
    animation: ringPulse 3s ease-out infinite;
  }
  
  .call-overlay__ring-pulse--slow::after {
    animation-delay: 1.5s;
  }
  
  @keyframes ringPulse {
    0%   { transform: translate(-50%, -50%) scale(1);   opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(2.5); opacity: 0; }
  }
  
  .call-overlay__avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.3);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }
  
  .call-overlay__avatar--large {
    width: 120px;
    height: 120px;
    border-width: 4px;
  }
  
  .call-overlay__name {
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    margin-top: 4px;
  }
  
  .call-overlay__status {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 16px;
  }
  
  /* ── Action buttons (Accept / Reject) ──────────────────────────────── */
  
  .call-overlay__actions {
    display: flex;
    gap: 32px;
    margin-top: 8px;
  }
  
  .call-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
    color: #fff;
  }
  
  .call-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  }
  
  .call-btn:active {
    transform: scale(0.95);
  }
  
  .call-btn--accept {
    background: #31a24c;
  }
  
  .call-btn--reject {
    background: #e53935;
  }
  
  /* ── Active call overlay ────────────────────────────────────────────── */
  
  .call-overlay--active {
    flex-direction: column;
    justify-content: flex-end;
    padding: 24px;
    background: #000;
  }
  
  .call-overlay__remote-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
  }
  
  .call-overlay__local-video {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 120px;
    height: 160px;
    object-fit: cover;
    border-radius: 12px;
    z-index: 1;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: #1a1a2e;
  }
  
  /* Audio call background */
  .call-overlay__audio-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 0;
  }
  
  /* Info (name + timer) */
  .call-overlay__info {
    position: relative;
    z-index: 2;
    text-align: center;
    margin-bottom: 16px;
  }
  
  .call-overlay__timer {
    font-size: 2rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.9);
    font-variant-numeric: tabular-nums;
    letter-spacing: 2px;
  }
  
  /* ── Control buttons (mute, video, speaker, end) ───────────────────── */
  
  .call-overlay__controls {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 16px 0;
  }
  
  .call-control-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.12);
    border: none;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    cursor: pointer;
    color: #fff;
    transition: background 0.2s, transform 0.2s;
    padding: 0;
  }
  
  .call-control-btn svg {
    margin-top: 14px;
  }
  
  .call-control-btn span {
    display: none; /* Labels hidden by default, shown on hover */
  }
  
  .call-control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
  }
  
  .call-control-btn:active {
    transform: scale(0.95);
  }
  
  .call-control-btn--active {
    background: rgba(229, 57, 53, 0.7) !important;
  }
  
  .call-control-btn--active:hover {
    background: rgba(229, 57, 53, 0.85) !important;
  }
  
  .call-control-btn--end {
    background: #e53935 !important;
    width: 64px;
    height: 64px;
  }
  
  .call-control-btn--end:hover {
    background: #c62828 !important;
  }
  
  .call-control-btn--end svg {
    margin-top: 18px;
  }
  
  /* ── Responsive ─────────────────────────────────────────────────────── */
  
  @media (max-width: 480px) {
    .call-overlay__local-video {
      width: 90px;
      height: 120px;
      top: 12px;
      right: 12px;
    }
  
    .call-control-btn {
      width: 48px;
      height: 48px;
    }
  
    .call-control-btn--end {
      width: 56px;
      height: 56px;
    }
  
    .call-overlay__controls {
      gap: 14px;
    }
  }

  /* Chat window call buttons */

/* ─── Full Overlay Call (fallback when no chat window) ──────────────── */

.call-overlay--incoming-full {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  z-index: 10000;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  animation: callOverlayIn 0.3s ease-out;
  overflow: hidden;
}
.call-overlay--incoming-full .call-overlay__incoming-bg {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}
.call-overlay--incoming-full .call-overlay__incoming-content {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100%; text-align: center; color: #fff; gap: 16px; padding: 24px;
}
.call-overlay--incoming-full .call-overlay__ring-pulse {
  width: 120px; height: 120px; border-radius: 50%;
  background: rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: center;
  position: relative; margin-bottom: 12px;
}
.call-overlay--incoming-full .call-overlay__ring-pulse::before,
.call-overlay--incoming-full .call-overlay__ring-pulse::after {
  content: ''; position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%); width: 100%; height: 100%;
  border-radius: 50%; border: 2px solid rgba(24, 119, 242, 0.4);
  animation: ringPulse 1.5s ease-out infinite;
}
.call-overlay--incoming-full .call-overlay__ring-pulse::after { animation-delay: 0.75s; }
.call-overlay--incoming-full .call-overlay__avatar {
  width: 90px; height: 90px; border-radius: 50%; object-fit: cover;
  border: 3px solid rgba(255,255,255,0.3);
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
}
.call-overlay--incoming-full .call-overlay__avatar--lg {
  width: 110px; height: 110px; border-width: 4px;
}
.call-overlay--incoming-full .call-overlay__name {
  font-size: 1.5rem; font-weight: 700; color: #fff;
}
.call-overlay--incoming-full .call-overlay__status {
  font-size: 1rem; color: rgba(255,255,255,0.7);
}
.call-overlay--incoming-full .call-overlay__actions {
  display: flex; gap: 48px; margin-top: 12px;
}
.call-overlay--incoming-full .call-overlay__action-group {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.call-overlay--incoming-full .call-overlay__action-group span {
  font-size: 0.75rem; color: rgba(255,255,255,0.6);
}
.call-overlay--incoming-full .call-btn {
  width: 60px; height: 60px; border-radius: 50%; border: none;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s; color: #fff;
}
.call-overlay--incoming-full .call-btn:hover { transform: scale(1.1); box-shadow: 0 4px 20px rgba(0,0,0,0.3); }
.call-overlay--incoming-full .call-btn:active { transform: scale(0.95); }
.call-overlay--incoming-full .call-btn--accept { background: #31a24c; box-shadow: 0 4px 14px rgba(49,162,76,0.4); }
.call-overlay--incoming-full .call-btn--reject { background: #e53935; box-shadow: 0 4px 14px rgba(229,57,53,0.4); }

/* ─── In-Chat Call UI (inside chat-window__messages) ────────────────────── */

.chat-call__container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 320px;
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  text-align: center;
}

/* Outgoing call – Facebook Messenger style blue gradient */
.chat-call__container--outgoing {
  background: linear-gradient(180deg, #1a3a6b 0%, #0d2137 100%);
  color: #fff;
}
.chat-call__outgoing-bg {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 40%, rgba(24,119,242,0.3) 0%, transparent 70%);
}
.chat-call__outgoing-content {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.chat-call__outgoing-content .chat-call__name { color: #fff; }
.chat-call__outgoing-content .chat-call__status { color: rgba(255,255,255,0.7); }

/* Incoming call – Snapchat style dark gradient */
.chat-call__container--incoming {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  color: #fff;
}
.chat-call__incoming-bg {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 40%, rgba(24,119,242,0.2) 0%, transparent 70%);
}
.chat-call__incoming-content {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.chat-call__incoming-content .chat-call__name { color: #fff; }
.chat-call__incoming-content .chat-call__status { color: rgba(255,255,255,0.7); }

/* Connected audio call */
.chat-call__container--connected {
  background: linear-gradient(180deg, #f0f2f5 0%, #e4e6eb 100%);
}

/* Avatar ring wrapper */
.chat-call__avatar-ring {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
}
.chat-call__avatar-ring {
  animation: callPulse 1.5s ease-in-out infinite;
}
.chat-call__avatar-ring::before,
.chat-call__avatar-ring::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid var(--primary);
  animation: callRingExpand 2s ease-out infinite;
}
.chat-call__avatar-ring::after { animation-delay: 1s; }
.chat-call__avatar-ring--slow { animation-duration: 3s; }
.chat-call__avatar-ring--slow::before,
.chat-call__avatar-ring--slow::after { animation-duration: 4s; }
.chat-call__avatar-ring--connected { animation: none; }
.chat-call__avatar-ring--connected::before,
.chat-call__avatar-ring--connected::after { display: none; }

@keyframes callPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
@keyframes callRingExpand {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(2.2); opacity: 0; }
}

.chat-call__avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid white;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
  z-index: 1;
}
.chat-call__avatar--lg {
  width: 100px;
  height: 100px;
  border-width: 4px;
}

.chat-call__name {
  font-size: 1.1rem;
  font-weight: 600;
}

.chat-call__container--outgoing .chat-call__name,
.chat-call__container--incoming .chat-call__name { color: #fff; }

.chat-call__status {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.chat-call__container--outgoing .chat-call__status,
.chat-call__container--incoming .chat-call__status { color: rgba(255,255,255,0.7); }

/* Calling text with animated dots */
.chat-call__status-text { display: inline; }
.chat-call__status-dots { display: inline-flex; overflow: hidden; margin-left: 2px; }
.chat-call__status-dots span {
  animation: dotAnim 1.4s ease-in-out infinite;
  font-size: 1.4rem; line-height: 1; margin: 0 1px;
}
.chat-call__status-dots span:nth-child(1) { animation-delay: 0s; }
.chat-call__status-dots span:nth-child(2) { animation-delay: 0.2s; }
.chat-call__status-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dotAnim {
  0%, 20% { opacity: 0; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-3px); }
  80%, 100% { opacity: 0; transform: translateY(0); }
}

/* Incoming call accept/reject actions */
.chat-call__incoming-actions {
  display: flex;
  gap: 48px;
  margin-top: 12px;
  position: relative; z-index: 1;
}
.chat-call__action-btn-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.chat-call__action-btn-group span {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.6);
}

.chat-call__action-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  color: white;
}
.chat-call__action-btn:active { transform: scale(0.92); }
.chat-call__action-btn svg { width: 26px; height: 26px; }

.chat-call__action-btn--accept {
  background: #31a24c;
  box-shadow: 0 4px 14px rgba(49,162,76,0.4);
}
.chat-call__action-btn--accept:hover { transform: scale(1.08); }

.chat-call__action-btn--reject {
  background: #e53935;
  box-shadow: 0 4px 14px rgba(229,57,53,0.4);
  transform: rotate(135deg);
}
.chat-call__action-btn--reject:hover { transform: rotate(135deg) scale(1.08); }

/* Incoming input area (when call is incoming) */
.chat-call__incoming-input {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  font-size: 0.75rem;
  color: var(--text-muted);
  gap: 6px;
}

/* Active call header */
.chat-call__header-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  min-width: 0;
}

.chat-call__header-label {
  font-size: 0.6rem;
  color: var(--text-muted);
  font-weight: 500;
}

.chat-call__header-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-call__timer {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.chat-call__header-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

/* Video container */
.chat-call__video-container {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 250px;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
}

.chat-call__remote-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.chat-call__local-video {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 100px;
  height: 140px;
  border-radius: 10px;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.4);
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
  z-index: 1;
}

/* Audio container */
.chat-call__audio-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px 20px;
  height: 100%;
  text-align: center;
}

/* Call controls in input area */
.chat-call__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex: 1;
  padding: 4px 0;
}

.chat-call__ctrl-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 12px;
  border: none;
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 10px;
  transition: background 0.15s, color 0.15s;
  min-width: 52px;
}

.chat-call__ctrl-btn:hover {
  background: rgba(0,0,0,0.05);
  color: var(--text);
}

.chat-call__ctrl-btn svg {
  width: 20px;
  height: 20px;
}

.chat-call__ctrl-btn span {
  font-size: 0.55rem;
  font-weight: 500;
}

.chat-call__ctrl-btn--active {
  color: var(--danger) !important;
  background: rgba(229, 57, 53, 0.1) !important;
}

.chat-call__ctrl-btn--end {
  background: var(--danger) !important;
  color: white !important;
  padding: 6px 16px;
  border-radius: 24px;
  box-shadow: 0 2px 10px rgba(229, 57, 53, 0.4);
}

.chat-call__ctrl-btn--end:hover {
  transform: scale(1.06);
  box-shadow: 0 4px 16px rgba(229, 57, 53, 0.5);
}

.chat-call__ctrl-btn--end svg {
  width: 24px;
  height: 24px;
}

/* Incoming call header button color fix */
.chat-call__header-actions .chat-window__header-btn {
  color: var(--text-secondary);
}

.chat-window__call-btn {
    color: var(--text-secondary, #65676b) !important;
    transition: color 0.2s, background-color 0.2s !important;
  }
  .chat-window__call-btn:hover {
    color: var(--primary-color, #1877f2) !important;
    background-color: rgba(24, 119, 242, 0.1) !important;
  }
  .chat-window__call-btn[title="Video call"]:hover {
    color: #e4405f !important;
    background-color: rgba(228, 64, 95, 0.1) !important;
  }

  .navbar,
  .mobile-nav,
  .chat-launcher,
  .chat-window,
  .toast-container {
    display: none !important;
  }

  body {
    background: white;
    padding: 0;
  }

  .card,
  .post-card {
    box-shadow: none;
    border: 1px solid #ccc;
  }
}

/* ==========================================================================
   NOTIFICATION PRIORITY STYLES
   ========================================================================== */
.notif-priority-high {
  background: linear-gradient(to right, rgba(229, 57, 53, 0.05), transparent) !important;
}
.notif-priority-high.unread {
  background: linear-gradient(to right, rgba(229, 57, 53, 0.1), rgba(229, 57, 53, 0.02)) !important;
}
.notif-priority-medium {
  border-left-color: #f7b928 !important;
}
.notif-priority-low {
  border-left-color: transparent !important;
}

.notif-priority-badge {
  display: inline-block;
  background: #e53935;
  color: white;
  font-size: 9px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 3px;
  margin-left: 6px;
  letter-spacing: 0.5px;
  vertical-align: middle;
  animation: pulse 2s infinite;
}

.notification-item.unread .notification-item__avatar {
  border: 2px solid var(--primary);
}

.notification-item__avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.notification-item__avatar-wrap .notification-item__icon {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  border: 2px solid var(--card-bg);
}

/* New notification slide-in animation */
@keyframes notifSlideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
    max-height: 0;
  }
  to {
    opacity: 1;
    transform: translateX(0);
    max-height: 100px;
  }
}

.notification-item.new-notif {
  animation: notifSlideIn 0.3s ease both;
}

/* ============================================================
   GIF & STICKER PICKER — Enhanced
   ============================================================ */

/* GIF grid — 3 cols, 16:9-ish */
.chat-media-picker__grid--gif {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
}

.chat-media-picker__media--gif {
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg);
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color var(--transition), transform var(--transition);
  padding: 0;
  aspect-ratio: 4/3;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.chat-media-picker__media--gif:hover {
  border-color: var(--primary);
  transform: scale(1.04);
  z-index: 2;
}

.chat-media-picker__media--gif img {
  width: 100%;
  flex: 1;
  object-fit: cover;
  display: block;
  min-height: 0;
}

.chat-media-picker__media-label {
  font-size: 9px;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  padding: 2px 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: var(--card-bg);
  line-height: 1.4;
}

/* Sticker grid — 4 cols, square items with transparent bg */
.chat-media-picker__grid--sticker {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 4px;
}

.chat-media-picker__media--sticker {
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color var(--transition), transform var(--transition);
  padding: 4px;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-media-picker__media--sticker:hover {
  border-color: var(--secondary);
  background: var(--secondary-light);
  transform: scale(1.08);
  z-index: 2;
}

.chat-media-picker__media--sticker img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Hover preview popup — Facebook-quality */
.chat-media-picker__preview {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  animation: previewFloatIn 0.15s ease both;
  background: var(--card-bg);
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  padding: 6px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.18);
  max-width: 260px;
  max-height: 260px;
}

.chat-media-picker__preview.hidden {
  display: none;
}

.chat-media-picker__preview-img {
  width: 180px;
  height: 140px;
  object-fit: contain;
  display: block;
  border-radius: 8px;
}

.chat-media-picker__preview-img--sticker {
  width: 180px;
  height: 180px;
  object-fit: contain;
}

@keyframes previewFloatIn {
  from { opacity: 0; transform: scale(0.9) translateY(6px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Load more sentinel */
.sticker-load-more {
  grid-column: 1 / -1;
  text-align: center;
  padding: 10px 8px;
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
  font-weight: 600;
}

.sticker-load-more:hover {
  background: var(--bg);
  color: var(--primary);
}

/* Sticker chat bubble — transparent bg like Facebook */
.chat-bubble.chat-bubble--sent .chat-media-bubble--sticker,
.chat-bubble.chat-bubble--received .chat-media-bubble--sticker {
  background: transparent;
  padding: 0;
}

.chat-media-bubble--sticker .chat-media-bubble__sticker {
  width: 150px;
  max-width: 100%;
  object-fit: contain;
  border-radius: 12px;
  display: block;
  transition: transform 0.15s ease;
}

.chat-media-bubble--sticker .chat-media-bubble__sticker:hover {
  transform: scale(1.05);
}

/* GIF bubble — like Facebook/Dating apps */
.chat-media-bubble--gif,
.chat-bubble--sent .chat-media-bubble,
.chat-bubble--received .chat-media-bubble {
  border-radius: 12px;
  overflow: hidden;
}

.chat-media-bubble--gif .chat-media-bubble__img,
.chat-bubble--sent .chat-media-bubble__img,
.chat-bubble--received .chat-media-bubble__img {
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
  display: block;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.chat-media-bubble--gif .chat-media-bubble__img:hover {
  opacity: 0.92;
}

.chat-media-bubble__caption {
  font-size: 11px;
  font-weight: 500;
  padding: 4px 8px 6px;
  color: var(--text-secondary);
  background: var(--card-bg);
}

/* Friendly "no stickers/GIFs" state */
.chat-media-picker__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 16px;
  color: var(--text-muted);
  font-size: 12px;
  gap: 6px;
}

.chat-media-picker__empty-icon {
  font-size: 32px;
  opacity: 0.5;
}


/* ==========================================================================
   30. VOICE MESSAGES & RECORDING
   ========================================================================== */

/* Voice recording overlay */
.voice-recording-overlay {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 8px;
  right: 8px;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: 16px;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.12), 0 8px 32px rgba(0,0,0,0.08), 0 0 0 1px rgba(255,255,255,0.1) inset;
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  z-index: 10;
  animation: slideUpFade 0.25s cubic-bezier(0.16, 1, 0.3, 1) both;
  border: 1px solid rgba(255,255,255,0.15);
}

.voice-recording-overlay.hidden {
  display: none;
}

.voice-recording-overlay__waveform {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 40px;
}

.voice-recording-overlay__bar {
  width: 4px;
  background: var(--danger);
  border-radius: var(--radius-full);
  animation: voiceBarPulse 0.6s ease-in-out infinite alternate;
  transition: height 0.1s ease;
}

.voice-recording-overlay__bar:nth-child(1) { height: 12px; animation-delay: 0s; }
.voice-recording-overlay__bar:nth-child(2) { height: 20px; animation-delay: 0.1s; }
.voice-recording-overlay__bar:nth-child(3) { height: 28px; animation-delay: 0.2s; }
.voice-recording-overlay__bar:nth-child(4) { height: 16px; animation-delay: 0.15s; }
.voice-recording-overlay__bar:nth-child(5) { height: 32px; animation-delay: 0.05s; }
.voice-recording-overlay__bar:nth-child(6) { height: 24px; animation-delay: 0.25s; }
.voice-recording-overlay__bar:nth-child(7) { height: 36px; animation-delay: 0.1s; }
.voice-recording-overlay__bar:nth-child(8) { height: 18px; animation-delay: 0.2s; }
.voice-recording-overlay__bar:nth-child(9) { height: 30px; animation-delay: 0.3s; }
.voice-recording-overlay__bar:nth-child(10) { height: 14px; animation-delay: 0.15s; }
.voice-recording-overlay__bar:nth-child(11) { height: 26px; animation-delay: 0.05s; }
.voice-recording-overlay__bar:nth-child(12) { height: 20px; animation-delay: 0.25s; }
.voice-recording-overlay__bar:nth-child(13) { height: 34px; animation-delay: 0.1s; }
.voice-recording-overlay__bar:nth-child(14) { height: 16px; animation-delay: 0.2s; }
.voice-recording-overlay__bar:nth-child(15) { height: 28px; animation-delay: 0.3s; }

@keyframes voiceBarPulse {
  0% { transform: scaleY(0.4); opacity: 0.6; }
  100% { transform: scaleY(1); opacity: 1; }
}

.voice-recording-overlay__timer {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--danger);
  font-variant-numeric: tabular-nums;
  font-family: 'SF Mono', Monaco, monospace;
}

.voice-recording-overlay__hint {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.voice-recording-overlay__cancel {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  background: var(--bg);
  border: none;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.75rem;
  transition: background var(--transition), color var(--transition);
}

.voice-recording-overlay__cancel:hover {
  background: var(--danger-light);
  color: var(--danger);
}

/* Voice preview overlay (after recording) */
.voice-preview-overlay {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 8px;
  right: 8px;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: 16px;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.12), 0 8px 32px rgba(0,0,0,0.08), 0 0 0 1px rgba(255,255,255,0.1) inset;
  padding: var(--space-sm) var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  z-index: 10;
  animation: slideUpFade 0.25s cubic-bezier(0.16, 1, 0.3, 1) both;
  border: 1px solid rgba(255,255,255,0.15);
  min-height: 52px;
}

.voice-preview-overlay.hidden {
  display: none;
}

.voice-preview-overlay__waveform {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 32px;
  flex: 1;
  min-width: 60px;
}

.voice-preview-overlay__bar {
  width: 3px;
  background: var(--primary);
  border-radius: var(--radius-full);
  flex-shrink: 0;
  opacity: 0.6;
}

.voice-preview-overlay__play {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  background: var(--primary);
  border: none;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--transition), transform var(--transition);
}

.voice-preview-overlay__play:hover {
  background: var(--primary-dark);
  transform: scale(1.05);
}

.voice-preview-overlay__play:active {
  transform: scale(0.95);
}

.voice-preview-overlay__time {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  min-width: 40px;
  text-align: center;
  flex-shrink: 0;
}

.voice-preview-overlay__actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.voice-preview-overlay__btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: all var(--transition);
  flex-shrink: 0;
}

.voice-preview-overlay__btn--delete {
  background: var(--bg);
  color: var(--text-secondary);
}

.voice-preview-overlay__btn--delete:hover {
  background: var(--danger-light);
  color: var(--danger);
}

.voice-preview-overlay__btn--send {
  background: var(--primary);
  color: white;
}

.voice-preview-overlay__btn--send:hover {
  background: var(--primary-dark);
  transform: scale(1.05);
}

.voice-preview-overlay__btn--send:active {
  transform: scale(0.95);
}

/* File preview fills the chat window from input to header */
.chat-file-preview {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: 0;
  box-shadow: none;
  border: none;
  padding: 0;
  min-height: 80px;
  max-height: none;
  overflow-y: auto;
  z-index: 50;
  animation: slideUpFade 0.25s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.chat-file-preview.hidden {
  display: none;
}

.chat-window__input-mode {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  flex: 1;
  min-width: 0;
}

.chat-window__input-mode.hidden {
  display: none;
}

.chat-file-preview__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px 6px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.chat-file-preview__title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
}

.chat-file-preview__close {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  transition: background 0.15s, color 0.15s;
}

.chat-file-preview__close:hover {
  background: var(--danger-light);
  color: var(--danger);
}

.chat-file-preview__list {
  flex: 1;
  overflow-y: auto;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-file-preview__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(0,0,0,0.03);
  transition: background 0.15s;
}

.chat-file-preview__item:hover {
  background: rgba(0,0,0,0.06);
}

.chat-file-preview__item--sending {
  opacity: 0.7;
}

.chat-file-preview__item-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  width: 32px;
  text-align: center;
}

.chat-file-preview__item-thumb-wrap {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
  background: rgba(0,0,0,0.05);
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-file-preview__item-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.chat-file-preview__item-play-badge {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: white;
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
  background: rgba(0,0,0,0.15);
}

.chat-file-preview__progress {
  width: 100%;
  height: 4px;
  background: rgba(0,0,0,0.08);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 3px;
}

.chat-file-preview__progress-bar {
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
  transition: width 0.2s ease;
}

.chat-file-preview__item-done {
  font-size: 0.6rem;
  color: var(--success, #22c55e);
  font-weight: 500;
}

.chat-file-preview__item-actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.chat-file-preview__item-send {
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: var(--cht-accent, var(--primary));
  color: white;
  border: none;
  font-size: 0.65rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}

.chat-file-preview__item-send:hover {
  transform: scale(1.06);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.chat-file-preview__item-send:active {
  transform: scale(0.95);
}

.chat-file-preview__item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.chat-file-preview__item-name {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-file-preview__item-path {
  font-size: 0.6rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-file-preview__item-size {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.chat-file-preview__item-remove {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-full);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}

.chat-file-preview__item-remove:hover {
  background: var(--danger-light);
  color: var(--danger);
}

.chat-file-preview__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 14px 10px;
  border-top: 1px solid rgba(0,0,0,0.06);
  gap: 8px;
}

.chat-file-preview__info {
  font-size: 0.7rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.chat-file-preview__actions {
  display: flex;
  gap: 6px;
}

.chat-file-preview__btn {
  padding: 5px 14px;
  border-radius: var(--radius-full);
  border: none;
  font-size: 0.7rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}

.chat-file-preview__btn:active {
  transform: scale(0.95);
}

.chat-file-preview__btn--add {
  background: var(--bg);
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
}

.chat-file-preview__btn--add:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.chat-file-preview__btn--send {
  background: var(--cht-accent, var(--primary));
  color: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.chat-file-preview__btn--send:hover {
  transform: scale(1.04);
}

/* Attach button wrapper & popup menu */
.chat-window__attach-wrap {
  position: relative;
  display: flex;
}

.chat-window__attach-menu {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15), 0 0 0 1px rgba(0,0,0,0.04);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 20;
  min-width: 140px;
  animation: slideUpFade 0.2s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.chat-window__attach-menu.hidden {
  display: none;
}

.chat-window__attach-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border: none;
  background: none;
  color: var(--text);
  font-size: 0.75rem;
  cursor: pointer;
  border-radius: 10px;
  transition: background 0.12s;
  white-space: nowrap;
}

.chat-window__attach-menu button:hover {
  background: var(--primary-light);
}

.chat-window__attach-menu button span {
  font-size: 1.1rem;
}

/* Voice message bubble */
.chat-bubble--audio {
  max-width: 260px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.chat-bubble--audio.chat-bubble--sent {
  background: var(--cht-sent-bg, var(--primary));
}

.chat-bubble--audio.chat-bubble--received {
  background: var(--cht-rcv-bg, var(--bg));
  border: 1px solid var(--cht-in-border, var(--border-light));
}

/* Play/pause button */
.chat-bubble__audio-play {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.25);
  border: none;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.75rem;
  flex-shrink: 0;
  transition: background var(--transition), transform var(--transition);
}

.chat-bubble--received .chat-bubble__audio-play {
  background: var(--cht-rcv-play-bg, var(--primary-light));
  color: var(--cht-rcv-play-color, var(--primary));
}

.chat-bubble__audio-play:hover {
  background: rgba(255,255,255,0.4);
  transform: scale(1.08);
}

.chat-bubble--received .chat-bubble__audio-play:hover {
  background: var(--cht-accent, var(--primary));
  color: white;
}

.chat-bubble__audio-play:active {
  transform: scale(0.95);
}

/* Waveform in message bubble */
.chat-bubble__audio-waveform {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 24px;
  flex: 1;
  min-width: 60px;
}

.chat-bubble__audio-waveform-bar {
  width: 3px;
  background: rgba(255,255,255,0.5);
  border-radius: var(--radius-full);
  transition: background var(--transition), height 0.2s ease;
  flex-shrink: 0;
}

.chat-bubble--received .chat-bubble__audio-waveform-bar {
  background: var(--cht-rcv-wave-bg, var(--border));
}

.chat-bubble__audio-waveform-bar.active {
  background: rgba(255,255,255,0.9);
}

.chat-bubble--received .chat-bubble__audio-waveform-bar.active {
  background: var(--cht-accent, var(--primary));
}

/* Audio duration */
.chat-bubble__audio-duration {
  font-size: 11px;
  opacity: 0.85;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Audio status indicator (played/unplayed) */
.chat-bubble__audio-status {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  flex-shrink: 0;
}

.chat-bubble--sent .chat-bubble__audio-status {
  background: rgba(255,255,255,0.4);
}

.chat-bubble__audio-status.played {
  background: transparent;
}

/* Microphone button in input area */
.chat-window__mic-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  background: none;
  border: none;
  color: var(--cht-mic-color, var(--text-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.2s, color var(--transition), transform 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
  position: relative;
}

.chat-window__mic-btn:hover {
  background: var(--cht-mic-hover-bg, var(--primary-light));
  color: var(--cht-mic-hover-color, var(--primary));
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.chat-window__mic-btn:active {
  transform: scale(0.92);
}

.chat-window__mic-btn.recording {
  background: var(--danger-light);
  color: var(--danger);
  animation: micPulse3D 1.2s ease-in-out infinite;
  box-shadow: 0 0 0 0 rgba(229, 57, 53, 0.3);
}

@keyframes micPulse3D {
  0% {
    box-shadow: 0 0 0 0 rgba(229, 57, 53, 0.4), 0 0 20px rgba(229, 57, 53, 0.1);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(229, 57, 53, 0), 0 0 30px rgba(229, 57, 53, 0.05);
    transform: scale(1.06);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(229, 57, 53, 0), 0 0 20px rgba(229, 57, 53, 0);
    transform: scale(1);
  }
}


/* Audio message in chat list preview */
.chat-list-item__preview--audio {
  display: flex;
  align-items: center;
  gap: 4px;
  font-style: italic;
}

.chat-list-item__preview--audio::before {
  content: "🎤";
  font-size: 10px;
}

/* ═══════════════════════════════════════════════════════════════════
   CHAT THEMES
   ═══════════════════════════════════════════════════════════════════ */

/* WhatsApp Theme */
.chat-window[data-chat-theme="whatsapp"] {
  --cht-window-bg: #e5ddd5;
  --cht-hdr-bg: #075e54;
  --cht-hdr-text: #ffffff;
  --cht-sent-bg: #dcf8c6;
  --cht-sent-text: #303030;
  --cht-sent-bbr: 8px;
  --cht-rcv-bg: #ffffff;
  --cht-rcv-text: #303030;
  --cht-rcv-bbl: 8px;
  --cht-bg: #e5ddd5;
  --cht-bg-img: repeating-linear-gradient(45deg, rgba(0,0,0,0.02) 0px, rgba(0,0,0,0.02) 2px, transparent 2px, transparent 4px);
  --cht-in-bg: #f0f2f5;
  --cht-in-area-bg: #f0f2f5;
  --cht-in-border: #e0e0e0;
  --cht-accent: #075e54;
  --cht-accent-hover: #064a42;
  --cht-rcv-play-bg: #e7f0e7;
  --cht-rcv-play-color: #075e54;
  --cht-rcv-wave-bg: #c0c0c0;
  --cht-picker-color: #66777a;
  --cht-picker-hover-bg: #e8e8e0;
  --cht-picker-hover-color: #075e54;
  --cht-mic-color: #66777a;
  --cht-mic-hover-bg: #e8e8e0;
  --cht-mic-hover-color: #075e54;
  --cht-icon-color: #66777a;
  --cht-icon-hover-bg: #e8e8e0;
}

/* Midnight Dark Theme */
.chat-window[data-chat-theme="midnight"] {
  --cht-window-bg: #1a1a2e;
  --cht-hdr-bg: #16213e;
  --cht-hdr-text: #e0e0e0;
  --cht-hdr-border: rgba(255,255,255,0.1);
  --cht-sent-bg: #0f3460;
  --cht-sent-text: #e0e0e0;
  --cht-rcv-bg: #1a1a2e;
  --cht-rcv-text: #c0c0c0;
  --cht-rcv-bbl: 4px;
  --cht-bg: #0f0f23;
  --cht-in-bg: #16213e;
  --cht-in-area-bg: #16213e;
  --cht-in-border: #2a2a4a;
  --cht-accent: #e94560;
  --cht-accent-hover: #c9304a;
  --cht-picker-color: #8899cc;
  --cht-picker-hover-bg: #1a2a4e;
  --cht-picker-hover-color: #e0e0ff;
  --cht-mic-color: #8899cc;
  --cht-mic-hover-bg: #1a2a4e;
  --cht-mic-hover-color: #e94560;
  --cht-icon-color: #8899cc;
  --cht-icon-hover-bg: #1a2a4e;
}

/* Sunset Theme */
.chat-window[data-chat-theme="sunset"] {
  --cht-window-bg: #fff5f0;
  --cht-hdr-bg: linear-gradient(135deg, #ff6b35, #e94560);
  --cht-hdr-text: #ffffff;
  --cht-sent-bg: linear-gradient(135deg, #ff6b35, #e94560);
  --cht-sent-text: #ffffff;
  --cht-sent-bbr: 12px;
  --cht-rcv-bg: #ffffff;
  --cht-rcv-text: #333333;
  --cht-rcv-bbl: 12px;
  --cht-bg: #fff5f0;
  --cht-in-bg: #ffffff;
  --cht-in-area-bg: #ffffff;
  --cht-in-border: #ffe0d0;
  --cht-accent: #e94560;
  --cht-accent-hover: #c9304a;
  --cht-rcv-play-bg: #fff0e8;
  --cht-rcv-play-color: #ff6b35;
  --cht-rcv-wave-bg: #d0c0b8;
  --cht-picker-color: #cc7766;
  --cht-picker-hover-bg: #fff5f0;
  --cht-picker-hover-color: #e94560;
  --cht-mic-color: #cc7766;
  --cht-mic-hover-bg: #fff5f0;
  --cht-mic-hover-color: #e94560;
  --cht-icon-color: #cc7766;
  --cht-icon-hover-bg: #fff5f0;
}

/* Ocean Theme */
.chat-window[data-chat-theme="ocean"] {
  --cht-window-bg: #e8f4fd;
  --cht-hdr-bg: #006994;
  --cht-hdr-text: #ffffff;
  --cht-sent-bg: #006994;
  --cht-sent-text: #ffffff;
  --cht-sent-bbr: 18px;
  --cht-rcv-bg: #ffffff;
  --cht-rcv-text: #1a2a3a;
  --cht-rcv-bbl: 18px;
  --cht-bg: #e8f4fd;
  --cht-in-bg: #ffffff;
  --cht-in-area-bg: #ffffff;
  --cht-in-border: #c8dce8;
  --cht-accent: #006994;
  --cht-accent-hover: #005577;
  --cht-rcv-play-bg: #dceef8;
  --cht-rcv-play-color: #006994;
  --cht-rcv-wave-bg: #a0b8c8;
  --cht-picker-hover-bg: #e8f4fd;
  --cht-picker-hover-color: #006994;
  --cht-mic-hover-bg: #e8f4fd;
  --cht-mic-hover-color: #006994;
  --cht-icon-hover-bg: #e8f4fd;
}

/* Lavender Theme */
.chat-window[data-chat-theme="lavender"] {
  --cht-window-bg: #f5f0ff;
  --cht-hdr-bg: #7c4dff;
  --cht-hdr-text: #ffffff;
  --cht-sent-bg: #7c4dff;
  --cht-sent-text: #ffffff;
  --cht-sent-bbr: 18px;
  --cht-rcv-bg: #ffffff;
  --cht-rcv-text: #2a1a3a;
  --cht-rcv-bbl: 18px;
  --cht-bg: #f5f0ff;
  --cht-in-bg: #ffffff;
  --cht-in-area-bg: #ffffff;
  --cht-in-border: #e0d8f0;
  --cht-accent: #7c4dff;
  --cht-accent-hover: #6a3de6;
  --cht-rcv-play-bg: #ede8fc;
  --cht-rcv-play-color: #7c4dff;
  --cht-rcv-wave-bg: #b0a8c8;
  --cht-picker-hover-bg: #f5f0ff;
  --cht-picker-hover-color: #7c4dff;
  --cht-mic-hover-bg: #f5f0ff;
  --cht-mic-hover-color: #7c4dff;
  --cht-icon-hover-bg: #f5f0ff;
}

/* Forest Theme */
.chat-window[data-chat-theme="forest"] {
  --cht-window-bg: #f0f7f0;
  --cht-hdr-bg: #2d7d46;
  --cht-hdr-text: #ffffff;
  --cht-sent-bg: #2d7d46;
  --cht-sent-text: #ffffff;
  --cht-sent-bbr: 18px;
  --cht-rcv-bg: #ffffff;
  --cht-rcv-text: #1a2a1a;
  --cht-rcv-bbl: 18px;
  --cht-bg: #f0f7f0;
  --cht-in-bg: #ffffff;
  --cht-in-area-bg: #ffffff;
  --cht-in-border: #d0e0d0;
  --cht-accent: #2d7d46;
  --cht-accent-hover: #236a39;
  --cht-rcv-play-bg: #e8f4e8;
  --cht-rcv-play-color: #2d7d46;
  --cht-rcv-wave-bg: #a0b8a0;
  --cht-picker-hover-bg: #f0f7f0;
  --cht-picker-hover-color: #2d7d46;
  --cht-mic-hover-bg: #f0f7f0;
  --cht-mic-hover-color: #2d7d46;
  --cht-icon-hover-bg: #f0f7f0;
}

/* Rose Gold Theme */
.chat-window[data-chat-theme="rosegold"] {
  --cht-window-bg: #fff5f8;
  --cht-hdr-bg: linear-gradient(135deg, #e8a0b4, #d4738a);
  --cht-hdr-text: #ffffff;
  --cht-hdr-border: rgba(255,255,255,0.2);
  --cht-sent-bg: linear-gradient(135deg, #e8a0b4, #d4738a);
  --cht-sent-text: #ffffff;
  --cht-sent-bbr: 18px;
  --cht-rcv-bg: #ffffff;
  --cht-rcv-text: #3a2a2a;
  --cht-rcv-bbl: 18px;
  --cht-bg: #fff5f8;
  --cht-in-bg: #ffffff;
  --cht-in-area-bg: #ffffff;
  --cht-in-border: #f0d8e0;
  --cht-accent: #d4738a;
  --cht-accent-hover: #bd5f76;
  --cht-rcv-play-bg: #fceef2;
  --cht-rcv-play-color: #d4738a;
  --cht-rcv-wave-bg: #c8a8b4;
  --cht-picker-hover-bg: #fff5f8;
  --cht-picker-hover-color: #d4738a;
  --cht-mic-hover-bg: #fff5f8;
  --cht-mic-hover-color: #d4738a;
  --cht-icon-hover-bg: #fff5f8;
}

/* Galaxy Theme */
.chat-window[data-chat-theme="galaxy"] {
  --cht-window-bg: #0d0d2b;
  --cht-hdr-bg: linear-gradient(135deg, #1a1a4e, #2d1b69);
  --cht-hdr-text: #e0d0ff;
  --cht-hdr-border: rgba(255,255,255,0.1);
  --cht-sent-bg: linear-gradient(135deg, #4a2d8a, #6a3de8);
  --cht-sent-text: #ffffff;
  --cht-sent-bbr: 18px;
  --cht-rcv-bg: #1a1a3e;
  --cht-rcv-text: #c0b0d8;
  --cht-rcv-bbl: 18px;
  --cht-bg: #0d0d2b;
  --cht-in-bg: #1a1a4e;
  --cht-in-area-bg: #1a1a4e;
  --cht-in-border: #2a2a5e;
  --cht-accent: #8b5cf6;
  --cht-accent-hover: #7a4def;
  --cht-rcv-play-bg: #2a2a5e;
  --cht-rcv-play-color: #8b5cf6;
  --cht-rcv-wave-bg: #3a3a6e;
  --cht-picker-color: #9988cc;
  --cht-picker-hover-bg: #2a1a5e;
  --cht-picker-hover-color: #d0b0ff;
  --cht-mic-color: #9988cc;
  --cht-mic-hover-bg: #2a1a5e;
  --cht-mic-hover-color: #8b5cf6;
  --cht-icon-color: #9988cc;
  --cht-icon-hover-bg: #2a1a5e;
}

/* ═══════════════════════════════════════════════════════════════════
   CHAT THEME PICKER
   ═══════════════════════════════════════════════════════════════════ */

.chat-theme-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.875rem;
  transition: background var(--transition);
}

.chat-theme-btn:hover {
  background: rgba(255,255,255,0.35);
}

/* Theme Picker Modal */
.chat-theme-picker-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.chat-theme-picker {
  background: var(--card-bg);
  border-radius: var(--radius);
  width: 420px;
  max-width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: scaleIn 0.2s ease;
}

.chat-theme-picker__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-light);
}

.chat-theme-picker__header h3 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
}

.chat-theme-picker__close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}

.chat-theme-picker__close:hover {
  background: var(--bg);
}

.chat-theme-picker__body {
  padding: var(--space-lg);
}

.chat-theme-picker__section-title {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-secondary);
  margin: 0 0 var(--space-sm) 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.chat-theme-picker__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.chat-theme-picker__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: var(--space-sm);
  border-radius: var(--radius);
  background: var(--bg);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
}

.chat-theme-picker__item:hover {
  border-color: var(--primary-light);
  transform: translateY(-2px);
}

.chat-theme-picker__item.active {
  border-color: var(--primary);
  background: var(--primary-light);
}

.chat-theme-picker__item-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  overflow: hidden;
}

.chat-theme-picker__item-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chat-theme-picker__item-name {
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--text);
  text-align: center;
}

/* Custom theme section */
.chat-theme-picker__custom {
  border-top: 1px solid var(--border-light);
  padding-top: var(--space-lg);
  margin-top: var(--space-sm);
}

.chat-theme-picker__custom-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.chat-theme-picker__custom-row label {
  font-size: var(--font-size-sm);
  color: var(--text);
  min-width: 90px;
  flex-shrink: 0;
}

.chat-theme-picker__custom-row input[type="color"] {
  width: 40px;
  height: 40px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px;
  cursor: pointer;
  background: none;
}

.chat-theme-picker__custom-row input[type="file"] {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

.chat-theme-picker__bg-preview {
  width: 60px;
  height: 48px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}

.chat-theme-picker__save-btn {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius);
  background: var(--primary);
  color: white;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background var(--transition);
  margin-top: var(--space-sm);
}

.chat-theme-picker__save-btn:hover {
  background: var(--primary-dark);
}

@keyframes scaleIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ═══════════════════════════════════════════════════════════════════
   GROUP CALL — Spotlight layout, tiles, controls, participant picker
   ═══════════════════════════════════════════════════════════════════ */

.group-call__container {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 320px;
  background: #1a1a2e;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.group-call__main {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* Speaker spotlight */
.group-call__spotlight {
  flex: 1;
  position: relative;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
}

.group-call__spotlight-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.group-call__spotlight-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  z-index: 1;
}

.group-call__avatar-lg {
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
}

.group-call__avatar-sm {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
}

.group-call__participant-name {
  position: absolute;
  bottom: 8px;
  left: 12px;
  color: rgba(255,255,255,0.9);
  font-size: 0.8rem;
  font-weight: 600;
  z-index: 2;
  background: rgba(0,0,0,0.5);
  padding: 2px 10px;
  border-radius: 12px;
}

.group-call__participant-status {
  position: absolute;
  bottom: 8px;
  right: 12px;
  color: rgba(255,255,255,0.7);
  font-size: 0.7rem;
  z-index: 2;
}

/* Participant tile strip (when spotlight is active) */
.group-call__tile-strip {
  display: flex;
  gap: 4px;
  padding: 4px;
  overflow-x: auto;
  background: rgba(0,0,0,0.3);
  flex-shrink: 0;
}

.group-call__tile {
  position: relative;
  width: 90px;
  min-width: 90px;
  height: 100px;
  border-radius: 8px;
  overflow: hidden;
  background: #2a2a4e;
  flex-shrink: 0;
}

.group-call__tile--hidden {
  display: none;
}

.group-call__tile-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.group-call__tile-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #4a4a8a 0%, #2a2a5e 100%);
}

.group-call__tile-name {
  position: absolute;
  bottom: 2px;
  left: 4px;
  right: 4px;
  color: rgba(255,255,255,0.85);
  font-size: 0.6rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  z-index: 2;
  background: rgba(0,0,0,0.4);
  padding: 1px 6px;
  border-radius: 6px;
}

.group-call__tile-indicators {
  position: absolute;
  top: 2px;
  right: 2px;
  display: flex;
  gap: 2px;
  z-index: 2;
  font-size: 0.6rem;
}

/* Tile grid (3+ participants, no spotlight) */
.group-call__tile-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  padding: 4px;
  flex: 1;
}

.group-call__tile-grid .group-call__tile {
  width: auto;
  min-width: unset;
  height: auto;
  aspect-ratio: 4/3;
}

/* Group call controls */
.group-call__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex: 1;
  padding: 4px 0;
}

/* Group call timer */
.group-call__timer {
  font-variant-numeric: tabular-nums;
}

/* Add Participant Modal */
.group-call__add-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.group-call__add-modal {
  background: var(--card-bg);
  border-radius: var(--radius);
  width: 380px;
  max-width: 90vw;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
  animation: scaleIn 0.2s ease;
}

.group-call__add-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-light);
  font-weight: 700;
  font-size: var(--font-size-base);
}

.group-call__add-modal-header button {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  border: none;
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.group-call__add-modal-header button:hover {
  background: var(--bg);
}

.group-call__add-modal-search {
  padding: var(--space-sm) var(--space-lg);
  border-bottom: 1px solid var(--border-light);
}

.group-call__add-modal-search input {
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: var(--font-size-sm);
  outline: none;
  box-sizing: border-box;
}

.group-call__add-modal-search input:focus {
  border-color: var(--primary);
}

.group-call__add-modal-list {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-xs) 0;
}

.group-call__candidate-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  cursor: pointer;
  transition: background 0.15s;
}

.group-call__candidate-item:hover {
  background: var(--hover-bg);
}

.group-call__candidate-item.selected {
  background: var(--primary-light);
}

.group-call__candidate-check {
  flex-shrink: 0;
}

.group-call__checkbox {
  width: 20px;
  height: 20px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
  transition: all 0.15s;
}

.group-call__checkbox.checked {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.group-call__candidate-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

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

.group-call__candidate-name {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.group-call__candidate-status {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
}

.call-overlay__participant-count {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.6);
  margin-top: -8px;
}

.group-call__candidate-item--focused {
  background: var(--primary-light, rgba(24,119,242,0.1)) !important;
}
.group-call__candidate-name em {
  background: #ffe066;
  color: var(--text, #1a1a2e);
  font-style: normal;
  padding: 0 2px;
  border-radius: 2px;
}
.group-call__no-results {
  padding: var(--space-xl, 24px);
  text-align: center;
  color: var(--text-muted, #666);
  font-size: var(--font-size-sm, 0.85rem);
}
.group-call__no-results-icon {
  font-size: 2rem;
  margin-bottom: var(--space-sm, 8px);
}

.ringtone-settings__modal {
  background: var(--card-bg);
  border-radius: var(--radius);
  width: 380px;
  max-width: 90vw;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
  animation: scaleIn 0.2s ease;
}
.ringtone-settings__body {
  padding: var(--space-md, 16px) var(--space-lg, 24px);
  flex: 1;
  overflow-y: auto;
}
.ringtone-settings__desc {
  font-size: var(--font-size-sm, 0.85rem);
  color: var(--text-secondary);
  margin-bottom: var(--space-md, 16px);
}
.ringtone-settings__option {
  display: flex;
  align-items: center;
  gap: var(--space-sm, 8px);
  padding: var(--space-sm, 8px) var(--space-md, 16px);
  border-radius: var(--radius-sm, 6px);
  cursor: pointer;
  transition: background 0.2s;
  margin-bottom: var(--space-xs, 4px);
}
.ringtone-settings__option:hover,
.ringtone-settings__option.selected {
  background: var(--primary-light, rgba(24,119,242,0.1));
}
.ringtone-settings__option input[type="radio"] {
  accent-color: var(--primary, #1877f2);
}
.ringtone-settings__option-info {
  flex: 1;
}
.ringtone-settings__option-label {
  font-weight: 600;
  font-size: var(--font-size-sm, 0.85rem);
  color: var(--text, #1a1a2e);
}
.ringtone-settings__footer {
  padding: var(--space-md, 16px) var(--space-lg, 24px);
  border-top: 1px solid var(--border-light, #eee);
  display: flex;
  justify-content: flex-end;
}

.post-options-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.15s ease;
}
.post-options__modal {
  background: var(--card-bg, #fff);
  border-radius: 12px;
  width: 360px;
  max-width: 92vw;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 12px 48px rgba(0,0,0,0.3);
  animation: scaleIn 0.15s ease;
}
.post-options__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border, #e4e6eb);
  font-weight: 600;
  font-size: 1rem;
}
.post-options__close {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--text-secondary, #65676b);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.post-options__close:hover {
  background: var(--bg, #f0f2f5);
}
.post-options__item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  cursor: pointer;
  transition: background 0.15s;
  font-size: 0.95rem;
  color: var(--text, #1c1e21);
  border-bottom: 1px solid var(--border-light, #e4e6eb);
}
.post-options__item:last-child {
  border-bottom: none;
}
.post-options__item:hover {
  background: var(--bg, #f0f2f5);
}
.post-options__icon {
  font-size: 1.3rem;
  width: 36px;
  text-align: center;
  flex-shrink: 0;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
