.social-layout {
  display: grid;
  grid-template-columns: minmax(0, 680px) 300px;
  gap: 32px;
  align-items: start;
  max-width: 1020px;
  margin: 0 auto;
}
@media (max-width: 900px) {
  .social-layout { grid-template-columns: 1fr; }
  .social-sidebar { display: none; }
}

/* Hero */
.social-hero {
  background: linear-gradient(135deg, #0a6b8a 0%, #1a8aaa 50%, #2a9aba 100%);
  padding: 48px 0 40px;
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
}
.social-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
}
.social-hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
}
.social-hero-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  position: relative;
  z-index: 1;
}
.social-hero-text h2 {
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 6px;
}
.social-hero-text p {
  color: rgba(255,255,255,0.85);
  font-size: 16px;
  margin: 0;
}
.social-hero-actions {
  display: flex;
  gap: 12px;
}
.social-hero-actions .btn--primary {
  background: #fff;
  color: #0a6b8a;
  border: none;
}
.social-hero-actions .btn--primary:hover {
  background: #f0f7fa;
}
.social-hero-actions .btn--outline {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255,255,255,0.4);
}
.social-hero-actions .btn--outline:hover {
  border-color: #fff;
  background: rgba(255,255,255,0.1);
}

/* Login CTA */
.social-login-cta {
  background: #fff;
  border-radius: 12px;
  padding: 28px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  margin-bottom: 16px;
  border: 1px solid #e5e7eb;
}
.social-login-cta p {
  margin: 0;
  font-size: 15px;
  color: #6b7280;
}

/* Post Box */
.social-post-box {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  margin-bottom: 16px;
  border: 1px solid #e5e7eb;
  overflow: hidden;
}
.social-post-box-header {
  display: flex;
  gap: 10px;
  padding: 16px 16px 0;
  align-items: center;
}
.social-post-box-input {
  flex: 1;
  background: #f5f7fa;
  border-radius: 24px;
  padding: 10px 16px;
  font-size: 14px;
  color: #6b7280;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.2s, border-color 0.2s;
}
.social-post-box-input:hover {
  background: #edf0f5;
  border-color: #d0d5dd;
}
.social-post-form {
  padding: 0 16px 16px;
}
.social-post-form textarea {
  width: 100%;
  border: none;
  outline: none;
  resize: none;
  font-size: 15px;
  font-family: 'Inter', sans-serif;
  color: #1a1a2e;
  min-height: 0;
  padding: 8px 0;
  transition: min-height 0.3s;
}
.social-post-form textarea:focus {
  min-height: 80px;
}
.social-post-form textarea::placeholder {
  color: #9ca3af;
}
.social-post-tools {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid #e5e7eb;
}
.social-tool {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #6b7280;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.social-tool:hover {
  background: #f0f7fa;
  color: #0a6b8a;
}
.social-video-input {
  flex: 1;
  min-width: 120px;
  padding: 8px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 13px;
  outline: none;
  font-family: 'Inter', sans-serif;
}
.social-video-input:focus {
  border-color: #0a6b8a;
}

/* Cards */
.social-feed {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.social-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  margin-bottom: 16px;
  border: 1px solid #e5e7eb;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.3s;
  opacity: 0;
  transform: translateY(20px);
  animation: cardFadeIn 0.5s ease forwards;
}
.social-card:nth-child(1) { animation-delay: 0.05s; }
.social-card:nth-child(2) { animation-delay: 0.1s; }
.social-card:nth-child(3) { animation-delay: 0.15s; }
.social-card:nth-child(4) { animation-delay: 0.2s; }
.social-card:nth-child(5) { animation-delay: 0.25s; }
@keyframes cardFadeIn {
  to { opacity: 1; transform: translateY(0); }
}
.social-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}
.social-card-header {
  display: flex;
  gap: 10px;
  padding: 14px 16px 0;
  align-items: center;
}
.social-card-header .social-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: #f0f7fa;
  flex-shrink: 0;
}
.social-card-author {
  flex: 1;
  min-width: 0;
}
.social-card-author strong {
  font-size: 14px;
  color: #1a1a2e;
  display: block;
  line-height: 1.3;
}
.social-time {
  font-size: 12px;
  color: #9ca3af;
}
.social-card-menu {
  position: relative;
  flex-shrink: 0;
}
.social-menu-btn {
  width: 34px;
  height: 34px;
  border: none;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  transition: background 0.2s;
}
.social-menu-btn:hover {
  background: #f0f2f5;
}
.social-menu-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  min-width: 200px;
  z-index: 100;
  padding: 6px;
  border: 1px solid #e5e7eb;
  animation: dropdownIn 0.15s ease;
}
.social-menu-dropdown.open {
  display: block;
}
@keyframes dropdownIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.social-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: none;
  font-size: 14px;
  color: #1a1a2e;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.15s;
  font-family: 'Inter', sans-serif;
  text-align: left;
}
.social-menu-item:hover {
  background: #f0f2f5;
}
.social-menu-item svg {
  flex-shrink: 0;
  color: #6b7280;
}

.social-card-body {
  font-size: 15px;
  line-height: 1.6;
  color: #1a1a2e;
  padding: 10px 16px 0;
  word-wrap: break-word;
  white-space: pre-wrap;
}
.social-card-image {
  margin-top: 12px;
  background: #f0f0f0;
  cursor: pointer;
}
.social-card-image img {
  width: 100%;
  display: block;
  max-height: 500px;
  object-fit: cover;
  transition: transform 0.3s;
}
.social-card-image img:hover {
  transform: scale(1.01);
}
.social-card-video {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  margin-top: 12px;
  background: #000;
}
.social-card-video iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Stats row */
.social-card-stats {
  display: flex;
  gap: 16px;
  padding: 10px 16px 0;
  font-size: 13px;
  color: #6b7280;
}
.social-card-stats span {
  cursor: default;
}
.social-card-stats span:hover {
  text-decoration: underline;
}
.social-card-stats .social-stat-comment {
  cursor: pointer;
}
.social-card-stats .social-stat-comment:hover {
  color: #0a6b8a;
}

/* Actions */
.social-card-actions {
  display: flex;
  gap: 4px;
  padding: 4px 12px 4px;
  margin: 4px 0 0;
  border-top: 1px solid #e5e7eb;
}
.social-action {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
}
.social-action:hover {
  background: #f0f2f5;
  color: #1a1a2e;
}
.social-action-like.liked {
  color: #e74c3c;
}
.social-action-like.liked:hover {
  background: #fde8e8;
}
.social-action-like.liked svg {
  animation: heartPulse 0.3s ease;
}
@keyframes heartPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* Comments */
.social-comments {
  border-top: 1px solid #e5e7eb;
  display: none;
  padding: 12px 16px;
  background: #fafbfc;
}
.social-comments.open {
  display: block;
  animation: slideDown 0.25s ease;
}
@keyframes slideDown {
  from { opacity: 0; max-height: 0; }
  to { opacity: 1; max-height: 600px; }
}
.social-comment-form {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  align-items: center;
}
.social-comment-form .social-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: #f0f7fa;
}
.social-comment-form input[type="text"] {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #d0d5dd;
  border-radius: 24px;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color 0.2s;
  background: #fff;
}
.social-comment-form input[type="text"]:focus {
  border-color: #0a6b8a;
}
.social-comment-form button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #0a6b8a;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s;
}
.social-comment-form button:hover {
  background: #0d4f6b;
}
.social-comment {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 14px;
  line-height: 1.5;
}
.social-comment .social-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: #f0f7fa;
}
.social-comment strong {
  font-size: 13px;
  margin-right: 4px;
}
.social-comment-body {
  background: #f0f2f5;
  padding: 8px 12px;
  border-radius: 12px;
  flex: 1;
  font-size: 13px;
  color: #1a1a2e;
  min-width: 0;
}
.social-comment-body p {
  margin: 0;
  word-wrap: break-word;
}
.social-comment-body .social-time {
  display: block;
  margin-top: 4px;
}

/* Sidebar */
.social-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 24px;
}
.sidebar-widget {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  border: 1px solid #e5e7eb;
}
.sidebar-widget h3 {
  font-size: 15px;
  color: #1a1a2e;
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}
.sidebar-user-card {
  display: flex;
  gap: 12px;
  align-items: center;
}
.sidebar-user-card .social-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  background: #f0f7fa;
  flex-shrink: 0;
}
.sidebar-user-card strong {
  display: block;
  font-size: 15px;
  color: #1a1a2e;
}
.sidebar-link {
  display: inline-block;
  font-size: 13px;
  color: #0a6b8a;
  margin-top: 2px;
  font-weight: 500;
}
.sidebar-link:hover {
  text-decoration: underline;
}
.sidebar-event {
  display: flex;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
}
.sidebar-event:last-child {
  border-bottom: none;
}
.sidebar-event-date {
  width: 42px;
  text-align: center;
  background: #f0f7fa;
  border-radius: 8px;
  padding: 4px 0;
  flex-shrink: 0;
}
.sev-day {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: #0a6b8a;
  line-height: 1.2;
}
.sev-month {
  display: block;
  font-size: 9px;
  font-weight: 600;
  color: #0a6b8a;
  text-transform: uppercase;
}
.sev-location {
  display: block;
  font-size: 11px;
  color: #9ca3af;
  margin-top: 2px;
}
.sidebar-event strong {
  font-size: 13px;
  color: #1a1a2e;
  display: block;
  line-height: 1.3;
}

/* Modal */
.social-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.9);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  animation: modalFade 0.2s ease;
}
@keyframes modalFade {
  from { opacity: 0; }
  to { opacity: 1; }
}
.social-modal img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.social-modal-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: #fff;
  font-size: 40px;
  cursor: pointer;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  transition: background 0.2s;
}
.social-modal-close:hover {
  background: rgba(255,255,255,0.2);
}

/* Profile */
.social-profile-header {
  background: linear-gradient(135deg, #0a6b8a, #1a8aaa);
  border-radius: 16px;
  padding: 40px;
  text-align: center;
  color: #fff;
  margin-bottom: 32px;
}
.social-profile-header img {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 4px solid rgba(255,255,255,0.3);
  object-fit: cover;
  margin-bottom: 16px;
  background: rgba(255,255,255,0.2);
}
.social-profile-header h1 {
  font-size: 28px;
  margin: 0 0 4px;
}
.social-profile-header p {
  opacity: 0.8;
  font-size: 15px;
  margin: 0;
}

/* Alerts */
.social-alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
  animation: alertSlide 0.3s ease;
}
@keyframes alertSlide {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.social-alert--error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}
.social-alert--success {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

/* Image preview */
.social-image-preview img {
  max-height: 80px;
  border-radius: 8px;
  margin-top: 8px;
}

/* Loading */
.social-loading {
  text-align: center;
  padding: 40px;
  color: #9ca3af;
}
.social-loading::after {
  content: '';
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid #e5e7eb;
  border-top-color: #0a6b8a;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Empty state */
.social-empty {
  text-align: center;
  padding: 60px 20px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
}
.social-empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
}
.social-empty h3 {
  font-size: 20px;
  color: #1a1a2e;
  margin: 0 0 8px;
}
.social-empty p {
  font-size: 14px;
  color: #6b7280;
  margin: 0;
}

/* Hidden post animation */
.social-card.hiding {
  animation: cardHide 0.4s ease forwards;
}
@keyframes cardHide {
  to { opacity: 0; transform: translateX(40px) scale(0.95); max-height: 0; margin-bottom: 0; padding: 0; overflow: hidden; }
}

/* Post card video link */
.social-card-video-link {
  display: block;
  padding: 16px;
  color: #0a6b8a;
  font-size: 14px;
  word-break: break-all;
}

/* Toast notifications */
#socialToastContainer {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.social-toast {
  padding: 14px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  animation: toastIn 0.3s ease;
  pointer-events: auto;
  max-width: 360px;
  backdrop-filter: blur(8px);
}
.social-toast--success {
  background: rgba(22, 163, 74, 0.95);
}
.social-toast--error {
  background: rgba(220, 38, 38, 0.95);
}
.social-toast--info {
  background: rgba(10, 107, 138, 0.95);
}
.social-toast--hide {
  animation: toastOut 0.3s ease forwards;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-10px) scale(0.95); }
}

/* Character counter */
.social-char-counter {
  text-align: right;
  font-size: 12px;
  color: #9ca3af;
  padding: 4px 0 0;
  font-weight: 500;
}

/* Post tools animation */
.social-post-tools {
  transition: opacity 0.2s ease;
}

/* Optimistic comment */
.social-comment--optimistic {
  animation: commentOptimistic 0.3s ease;
}
.social-comment--optimistic .social-comment-body {
  background: #dbeafe;
}
@keyframes commentOptimistic {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Like count bounce */
@keyframes countBounce {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* Avatar hover preview */
.social-avatar-preview {
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  border-radius: 10px;
  padding: 10px 14px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  border: 1px solid #e5e7eb;
  z-index: 50;
  opacity: 0;
  transform: translateY(-4px);
  transition: all 0.2s;
  white-space: nowrap;
  font-size: 13px;
  pointer-events: none;
}
.social-avatar-preview.show {
  opacity: 1;
  transform: translateY(0);
}
.social-card-header {
  position: relative;
}

/* Share button active */
.social-action-share:active {
  transform: scale(0.95);
}

/* Scrollbar for comments list */
.social-comments-list {
  max-height: 400px;
  overflow-y: auto;
}
.social-comments-list::-webkit-scrollbar {
  width: 4px;
}
.social-comments-list::-webkit-scrollbar-thumb {
  background: #d0d5dd;
  border-radius: 4px;
}

/* Mobile improvements */
@media (max-width: 600px) {
  .social-hero {
    padding: 32px 0 28px;
    margin-bottom: 16px;
  }
  .social-hero-text h2 {
    font-size: 22px;
  }
  .social-hero-inner {
    flex-direction: column;
    text-align: center;
  }
  .social-hero-actions {
    width: 100%;
    justify-content: center;
  }
  .social-card {
    border-radius: 0;
    margin-bottom: 8px;
    border-left: none;
    border-right: none;
  }
  .social-card-header {
    padding: 12px 12px 0;
  }
  .social-card-body {
    padding: 8px 12px 0;
    font-size: 14px;
  }
  .social-card-stats {
    padding: 8px 12px 0;
    font-size: 12px;
  }
  .social-card-actions {
    padding: 2px 8px 2px;
  }
  .social-action {
    font-size: 13px;
    padding: 6px 0;
  }
  .social-comments {
    padding: 8px 12px;
  }
  .social-post-box {
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
  .social-post-box-header {
    padding: 12px 12px 0;
  }
  .social-post-form {
    padding: 0 12px 12px;
  }
  .social-login-cta {
    border-radius: 0;
  }
  .social-empty {
    border-radius: 0;
  }
  .social-alert {
    border-radius: 0;
  }
  #socialToastContainer {
    bottom: 16px;
    right: 16px;
    left: 16px;
  }
  .social-toast {
    max-width: 100%;
  }
  .social-hero-actions .btn {
    font-size: 14px;
    padding: 10px 20px;
  }
}

/* ===== WOW EFFECTS ===== */

/* 1. Animated gradient hero */
.social-hero {
  background: linear-gradient(135deg, #0a6b8a 0%, #1a8aaa 25%, #2a9aba 50%, #1a8aaa 75%, #0a6b8a 100%);
  background-size: 400% 400%;
  animation: heroGradient 8s ease infinite;
}
@keyframes heroGradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Floating animated orbs */
.social-hero::before {
  animation: floatOrb1 6s ease-in-out infinite;
}
.social-hero::after {
  animation: floatOrb2 8s ease-in-out infinite;
}
@keyframes floatOrb1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -20px) scale(1.1); }
  66% { transform: translate(-20px, 10px) scale(0.9); }
}
@keyframes floatOrb2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-25px, 15px) scale(1.15); }
  66% { transform: translate(20px, -25px) scale(0.85); }
}

/* 2. 3D card tilt */
.social-card {
  transform-style: preserve-3d;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.social-card-tilt {
  transition: transform 0.15s ease-out;
}

/* 3. Glassmorphism sidebar */
.sidebar-widget {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* 4. Ripple effect */
.social-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transform: scale(0);
  animation: rippleAnim 0.6s ease-out;
  pointer-events: none;
}
@keyframes rippleAnim {
  to { transform: scale(4); opacity: 0; }
}
.social-action, .social-menu-btn, .social-tool, .social-comment-form button {
  position: relative;
  overflow: hidden;
}

/* 5. Particle burst on like */
.social-particle {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 10;
}
.social-particle--heart {
  width: 12px;
  height: 12px;
  clip-path: path('M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z');
}
@keyframes particleBurst {
  0% { opacity: 1; transform: translate(0, 0) scale(1); }
  100% { opacity: 0; transform: translate(var(--tx), var(--ty)) scale(0); }
}

/* 6. Dark mode */
html[data-theme="dark"] {
  --social-bg: #0f172a;
  --social-card-bg: #1e293b;
  --social-text: #f1f5f9;
  --social-text-secondary: #94a3b8;
  --social-border: #334155;
  --social-hover: #334155;
  --social-comment-bg: #1e293b;
  --social-sidebar-bg: rgba(30, 41, 59, 0.85);
}
html[data-theme="dark"] body {
  background: var(--social-bg);
  color: var(--social-text);
}
html[data-theme="dark"] .social-card,
html[data-theme="dark"] .social-post-box,
html[data-theme="dark"] .social-login-cta,
html[data-theme="dark"] .social-empty,
html[data-theme="dark"] .sidebar-widget,
html[data-theme="dark"] .social-alert {
  background: var(--social-card-bg);
  border-color: var(--social-border);
}
html[data-theme="dark"] .social-card-body,
html[data-theme="dark"] .social-card-author strong,
html[data-theme="dark"] .sidebar-widget h3,
html[data-theme="dark"] .sidebar-event strong,
html[data-theme="dark"] .social-card-header strong,
html[data-theme="dark"] .sidebar-user-card strong,
html[data-theme="dark"] .social-empty h3 {
  color: var(--social-text);
}
html[data-theme="dark"] .social-time,
html[data-theme="dark"] .social-card-stats,
html[data-theme="dark"] .social-empty p,
html[data-theme="dark"] .sev-location,
html[data-theme="dark"] .sidebar-widget p {
  color: var(--social-text-secondary);
}
html[data-theme="dark"] .social-card-actions,
html[data-theme="dark"] .social-card-stats,
html[data-theme="dark"] .social-comments,
html[data-theme="dark"] .social-post-tools {
  border-color: var(--social-border);
}
html[data-theme="dark"] .social-comment-body {
  background: #0f172a;
  color: var(--social-text);
}
html[data-theme="dark"] .social-comment-form input[type="text"] {
  background: #0f172a;
  border-color: var(--social-border);
  color: var(--social-text);
}
html[data-theme="dark"] .social-comments {
  background: #0f172a;
}
html[data-theme="dark"] .social-menu-dropdown {
  background: var(--social-card-bg);
  border-color: var(--social-border);
}
html[data-theme="dark"] .social-menu-item {
  color: var(--social-text);
}
html[data-theme="dark"] .social-menu-item:hover {
  background: var(--social-hover);
}
html[data-theme="dark"] .sidebar-widget {
  background: var(--social-sidebar-bg);
  backdrop-filter: blur(16px);
}
html[data-theme="dark"] .social-action:hover {
  background: var(--social-hover);
}
html[data-theme="dark"] .social-post-box-input {
  background: #0f172a;
  color: var(--social-text-secondary);
  border-color: var(--social-border);
}
html[data-theme="dark"] .social-post-box-input:hover {
  background: #1e293b;
}
html[data-theme="dark"] .social-video-input {
  background: #0f172a;
  color: var(--social-text);
  border-color: var(--social-border);
}
html[data-theme="dark"] .social-char-counter {
  color: var(--social-text-secondary);
}

/* Dark mode toggle button */
.social-dark-toggle {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 9998;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: #fff;
  color: #1a1a2e;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  font-size: 20px;
}
.social-dark-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
html[data-theme="dark"] .social-dark-toggle {
  background: #1e293b;
  color: #fbbf24;
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
}

/* 7. Skeleton loading */
.social-skeleton {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  margin-bottom: 16px;
  border: 1px solid #e5e7eb;
  overflow: hidden;
  padding: 16px;
}
.social-skeleton-header {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}
.social-skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e5e7eb;
  flex-shrink: 0;
}
.social-skeleton-line {
  height: 12px;
  background: #e5e7eb;
  border-radius: 6px;
  flex: 1;
}
.social-skeleton-line--short {
  max-width: 60%;
}
.social-skeleton-body {
  height: 60px;
  background: #e5e7eb;
  border-radius: 8px;
  margin-top: 12px;
}
.social-skeleton-image {
  height: 200px;
  background: #e5e7eb;
  border-radius: 8px;
  margin-top: 12px;
}
.social-skeleton,
.social-skeleton-avatar,
.social-skeleton-line,
.social-skeleton-body,
.social-skeleton-image {
  animation: shimmer 1.5s ease-in-out infinite;
}
@keyframes shimmer {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.6; }
}
html[data-theme="dark"] .social-skeleton {
  background: #1e293b;
  border-color: #334155;
}
html[data-theme="dark"] .social-skeleton-avatar,
html[data-theme="dark"] .social-skeleton-line,
html[data-theme="dark"] .social-skeleton-body,
html[data-theme="dark"] .social-skeleton-image {
  background: #334155;
}

/* 8. Floating action button (mobile) */
.social-fab {
  display: none;
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9997;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #0a6b8a, #1a8aaa);
  color: #fff;
  box-shadow: 0 4px 16px rgba(10, 107, 138, 0.4);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  font-size: 28px;
}
.social-fab:hover {
  transform: scale(1.1) rotate(90deg);
  box-shadow: 0 6px 24px rgba(10, 107, 138, 0.5);
}
.social-fab:active {
  transform: scale(0.95);
}
@media (max-width: 600px) {
  .social-fab {
    display: flex;
  }
  .social-dark-toggle {
    bottom: 88px;
    left: 24px;
  }
}
html[data-theme="dark"] .social-fab {
  box-shadow: 0 4px 16px rgba(10, 107, 138, 0.6);
}

/* 9. Image shimmer loading */
.social-card-image {
  position: relative;
  overflow: hidden;
}
.social-card-image::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  animation: imgShimmer 2s infinite;
  z-index: 1;
}
@keyframes imgShimmer {
  100% { left: 100%; }
}
.social-card-image img {
  position: relative;
  z-index: 2;
}
html[data-theme="dark"] .social-card-image::before {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
}

/* 10. Smooth scroll behavior */
html {
  scroll-behavior: smooth;
}

/* 11. Confetti keyframes (used by JS) */
@keyframes confettiFall {
  0% { opacity: 1; transform: translateY(0) rotate(0deg) scale(1); }
  100% { opacity: 0; transform: translateY(200px) rotate(720deg) scale(0); }
}

/* 12. Enhanced card entrance */
.social-card {
  animation: cardEntrance 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
  transform: translateY(30px) scale(0.98);
}
@keyframes cardEntrance {
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* 13. Like button glow when liked */
.social-action-like.liked svg {
  filter: drop-shadow(0 0 6px rgba(231, 76, 60, 0.5));
}

/* 14. Typewriter cursor */
@keyframes cursorBlink {
  50% { border-color: transparent; }
}

/* 15. Share modal */
.social-share-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  align-items: center;
  justify-content: center;
}
.social-share-modal.open {
  display: flex;
  animation: modalFade 0.2s ease;
}
.social-share-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
}
.social-share-box {
  position: relative;
  background: #fff;
  border-radius: 16px;
  padding: 28px;
  width: 90%;
  max-width: 420px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.2);
  animation: shareBoxIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes shareBoxIn {
  from { opacity: 0; transform: scale(0.9) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.social-share-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 28px;
  color: #6b7280;
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}
.social-share-close:hover {
  background: #f0f2f5;
}
.social-share-box h3 {
  font-size: 18px;
  color: #1a1a2e;
  margin: 0 0 16px;
}
.social-share-preview {
  font-size: 13px;
  color: #6b7280;
  background: #f5f7fa;
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 16px;
  line-height: 1.5;
  max-height: 60px;
  overflow: hidden;
}
.social-share-field {
  display: flex;
  gap: 8px;
}
.social-share-field input {
  flex: 1;
  padding: 12px 14px;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  font-size: 13px;
  color: #1a1a2e;
  background: #f9fafb;
  outline: none;
}
.social-share-copy {
  padding: 12px 20px;
  background: #0a6b8a;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}
.social-share-copy:hover {
  background: #0d4f6b;
}
html[data-theme="dark"] .social-share-box {
  background: #1e293b;
}
html[data-theme="dark"] .social-share-box h3 {
  color: #f1f5f9;
}
html[data-theme="dark"] .social-share-preview {
  background: #0f172a;
  color: #94a3b8;
}
html[data-theme="dark"] .social-share-field input {
  background: #0f172a;
  border-color: #334155;
  color: #f1f5f9;
}

/* 16. Delete button danger style */
.social-menu-item--danger {
  color: #e74c3c;
}
.social-menu-item--danger svg {
  color: #e74c3c;
}
.social-menu-item--danger:hover {
  background: #fef2f2;
}
html[data-theme="dark"] .social-menu-item--danger:hover {
  background: rgba(231, 76, 60, 0.15);
}

/* 17. Avatar link */
.social-avatar-link {
  display: flex;
  flex-shrink: 0;
  border-radius: 50%;
  transition: transform 0.2s, box-shadow 0.2s;
}
.social-avatar-link:hover {
  transform: scale(1.05);
  box-shadow: 0 0 0 3px rgba(10, 107, 138, 0.3);
}

/* 18. Scroll progress bar */
#socialScrollProgress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  background: linear-gradient(90deg, #f48120, #e74c3c, #0d4f6b);
  z-index: 999999;
  width: 0%;
  transition: width 0.1s linear;
  box-shadow: 0 0 8px rgba(244,129,32,0.4);
}

/* 19. Custom scrollbar for social section */
.social-section::-webkit-scrollbar {
  width: 6px;
}
.social-section::-webkit-scrollbar-track {
  background: transparent;
}
.social-section::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #f48120, #0d4f6b);
  border-radius: 3px;
}

/* 20. Confetti pieces */
.social-confetti-piece {
  position: fixed;
  top: -10px;
  z-index: 999998;
  pointer-events: none;
  animation: confettiFall 1.5s ease-out forwards;
  opacity: 1;
}
@keyframes confettiFall {
  0% { transform: translateY(0) rotate(0deg) scale(1); opacity: 1; }
  100% { transform: translateY(110vh) rotate(720deg) scale(0.3); opacity: 0; }
}

/* 21. Gradient text for hero */
.social-hero h1 {
  background: linear-gradient(135deg, #0d4f6b, #f48120, #e74c3c);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: heroGradient 4s ease infinite;
}
@keyframes heroGradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* 22. Card stagger entrance */
.social-card {
  animation: cardSlideUp 0.5s ease both;
}
.social-card:nth-child(1) { animation-delay: 0.05s; }
.social-card:nth-child(2) { animation-delay: 0.1s; }
.social-card:nth-child(3) { animation-delay: 0.15s; }
.social-card:nth-child(4) { animation-delay: 0.2s; }
.social-card:nth-child(5) { animation-delay: 0.25s; }
.social-card:nth-child(6) { animation-delay: 0.3s; }
.social-card:nth-child(7) { animation-delay: 0.35s; }
.social-card:nth-child(8) { animation-delay: 0.4s; }
.social-card:nth-child(9) { animation-delay: 0.45s; }
.social-card:nth-child(10) { animation-delay: 0.5s; }
@keyframes cardSlideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 23. Shimmer badge for new content */
.social-badge-new {
  display: inline-block;
  background: linear-gradient(90deg, #f48120, #e74c3c, #f48120);
  background-size: 200% 100%;
  animation: shimmerMove 1.5s ease infinite;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
@keyframes shimmerMove {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ===== MOBILE FIXES ===== */
@media (max-width: 600px) {
  .social-hero-inner {
    justify-content: center;
    text-align: center;
  }
  .social-hero-text h2 {
    font-size: clamp(1.2rem, 5vw, 1.5rem);
  }
  .social-hero-text p {
    font-size: 13px;
  }
  .social-post-box {
    padding: 16px;
  }
  .social-post-box-header {
    gap: 10px;
  }
  .social-post-box-input {
    font-size: 13px;
    padding: 10px 14px;
  }
  .social-card {
    border-radius: 12px;
  }
  .social-card-body {
    padding: 12px 14px;
  }
  .social-card-header {
    padding: 12px 14px 0;
  }
  .social-post-tools {
    flex-wrap: wrap;
    gap: 8px;
  }
  .social-post-tools .btn {
    width: 100%;
  }
  .social-video-input {
    width: 100%;
  }
}

/* ===== MOBILE v2 — EXTRA SMALL SCREENS ===== */
@media (max-width: 480px) {
  .social-hero {
    padding: 24px 0 20px;
  }
  .social-hero-text h2 {
    font-size: 20px;
  }
  .social-hero-text p {
    font-size: 12px;
  }
  .social-hero-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .social-hero-actions .btn {
    width: 100%;
    justify-content: center;
  }
  .social-post-box-header {
    flex-wrap: wrap;
  }
  .social-post-box-header .social-avatar {
    width: 36px;
    height: 36px;
  }
  .social-post-box-input {
    font-size: 12px;
    padding: 8px 12px;
  }
  .social-card {
    border-radius: 0;
    margin-bottom: 6px;
    border-left: none;
    border-right: none;
  }
  .social-card-header {
    padding: 10px 10px 0;
  }
  .social-card-header .social-avatar {
    width: 34px;
    height: 34px;
  }
  .social-card-author strong {
    font-size: 13px;
  }
  .social-card-body {
    padding: 8px 10px 0;
    font-size: 13px;
  }
  .social-card-stats {
    padding: 6px 10px 0;
    font-size: 11px;
    gap: 10px;
  }
  .social-card-actions {
    padding: 0 6px 0;
    gap: 2px;
  }
  .social-action {
    font-size: 12px;
    padding: 6px 0;
    gap: 4px;
  }
  .social-action svg {
    width: 16px;
    height: 16px;
  }
  .social-comments {
    padding: 6px 10px;
  }
  .social-comment {
    font-size: 13px;
  }
  .social-comment-form input[type="text"] {
    font-size: 13px;
    padding: 8px 12px;
  }
  .social-post-form textarea {
    font-size: 14px;
  }
  .social-post-tools {
    gap: 4px;
  }
  .social-post-tools .btn {
    font-size: 12px;
    padding: 8px 14px;
  }
  .social-tool {
    width: 32px;
    height: 32px;
  }
  .social-video-input {
    font-size: 12px;
    padding: 6px 10px;
    min-width: 80px;
  }
  .social-post-box {
    padding: 12px;
  }
  .social-post-box-header {
    padding: 8px 8px 0;
    gap: 8px;
  }
  .social-post-form {
    padding: 0 8px 8px;
  }
  .social-fab {
    width: 48px;
    height: 48px;
    bottom: 16px;
    right: 16px;
    font-size: 24px;
  }
  .social-dark-toggle {
    width: 40px;
    height: 40px;
    bottom: 74px;
    left: 16px;
    font-size: 16px;
  }
  .social-empty {
    padding: 40px 16px;
  }
  .social-empty-icon {
    font-size: 36px;
  }
  .social-empty h3 {
    font-size: 17px;
  }
  .social-empty p {
    font-size: 13px;
  }
}

@media (max-width: 360px) {
  .social-card-actions {
    flex-wrap: wrap;
  }
  .social-action {
    flex: 1 1 40%;
    font-size: 11px;
  }
  .social-action span {
    font-size: 11px;
  }
  .social-card-stats {
    gap: 6px;
  }
  .social-card-body {
    font-size: 12px;
    line-height: 1.5;
  }
  .social-post-box {
    padding: 8px;
  }
  .social-post-box-header {
    padding: 6px 6px 0;
  }
  .social-post-form {
    padding: 0 6px 6px;
  }
  .social-hero {
    padding: 16px 0 16px;
  }
  .social-hero-text h2 {
    font-size: 18px;
  }
}

/* Social profile header responsive */
@media (max-width: 600px) {
  .social-profile-header {
    padding: 24px 16px;
    border-radius: 0;
    margin-bottom: 16px;
  }
  .social-profile-header img {
    width: 72px;
    height: 72px;
  }
  .social-profile-header h1 {
    font-size: 22px;
  }
  .social-profile-header p {
    font-size: 13px;
  }
}

/* Share button inside social actions */
.social-action.social-action-share .share-btn {
  background: transparent;
  color: inherit;
  padding: 0;
  font-size: inherit;
  font-weight: inherit;
}
.social-action.social-action-share .share-btn:hover {
  background: transparent;
  color: inherit;
  transform: none;
  box-shadow: none;
}

/* Toast on small screens */
@media (max-width: 360px) {
  #socialToastContainer {
    bottom: 8px;
    right: 8px;
    left: 8px;
  }
  .social-toast {
    padding: 10px 14px;
    font-size: 13px;
    max-width: 100%;
  }
}

/* Hide scroll-top button on social pages (avoids overlap with FAB) */
.social-page .scroll-top {
  display: none !important;
}

/* ===== FRIENDS SIDEBAR ===== */
.social-friend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border, #f0f0f0);
}
.social-friend-item:last-child {
  border-bottom: none;
}
.social-friend-item .social-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.social-friend-name {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: var(--text, #1a1a2e);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.social-chat-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  padding: 2px 4px;
  border-radius: 4px;
  line-height: 1;
  transition: background 0.2s;
}
.social-chat-btn:hover {
  background: var(--hover-bg, #e5f0f5);
}
.social-friend-count {
  background: var(--primary, #0a6b8a);
  color: #fff;
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 10px;
  margin-left: 4px;
  vertical-align: middle;
}
.social-btn-icon {
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s;
}
.social-btn-accept {
  background: #d4edda;
  color: #155724;
}
.social-btn-accept:hover {
  background: #c3e6cb;
}
.social-btn-reject {
  background: #f8d7da;
  color: #721c24;
}
.social-btn-reject:hover {
  background: #f5c6cb;
}
.social-btn-add {
  background: #e2f0f7;
  color: #0a6b8a;
  font-size: 14px;
  font-weight: bold;
}
.social-btn-add:hover {
  background: #cce5f0;
}
.social-btn-remove {
  background: transparent;
  color: #9ca3af;
  font-size: 10px;
}
.social-btn-remove:hover {
  background: #f8d7da;
  color: #721c24;
}
.social-request-item .social-friend-name {
  font-size: 12px;
}
.social-online-dot {
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 4px rgba(34,197,94,0.4);
}
.social-badge {
  background: var(--primary, #0a6b8a);
  color: #fff;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
  display: inline-block;
}

/* ===== CHAT BUBBLE ===== */
.social-chat-bubble {
  appearance: none;
  -webkit-appearance: none;
  position: fixed;
  bottom: max(24px, env(safe-area-inset-bottom));
  right: max(24px, env(safe-area-inset-right));
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #0d4f6b, #1a7a9e);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 0;
  padding: 0;
  color: inherit;
  font: inherit;
  box-shadow: 0 4px 20px rgba(13,79,107,0.3);
  z-index: 10001;
  transition: transform 0.2s, box-shadow 0.2s;
}
.social-chat-bubble:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(13,79,107,0.4);
}
.social-chat-bubble .social-chat-bubble-icon {
  font-size: 24px;
  line-height: 1;
}
.social-chat-bubble-unread {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  box-shadow: 0 2px 6px rgba(239,68,68,0.4);
}
.social-chat-bubble.hidden {
  transform: scale(0);
  opacity: 0;
  pointer-events: none;
}

/* ===== CHAT MODAL ===== */
.social-chat-modal {
  position: fixed;
  box-sizing: border-box;
  bottom: 90px;
  right: max(24px, env(safe-area-inset-right));
  width: min(360px, calc(100vw - 48px));
  height: min(520px, calc(100vh - 140px));
  height: min(520px, calc(100dvh - 140px));
  max-height: calc(100vh - 140px);
  max-height: calc(100dvh - 140px);
  background: rgba(255,255,255,0.96);
  border: 1px solid rgba(255,255,255,0.78);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  backdrop-filter: blur(22px) saturate(160%);
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.15);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  transform: scale(0.9);
  transform-origin: bottom right;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s ease, opacity 0.25s ease;
  overflow: hidden;
  isolation: isolate;
  contain: layout paint;
}
.social-chat-modal.open {
  transform: scale(1);
  opacity: 1;
  pointer-events: auto;
}
.social-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: linear-gradient(135deg, #0d4f6b, #1a7a9e);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  flex-shrink: 0;
}
.social-chat-header > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.social-chat-header-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.social-chat-header-actions button {
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.social-chat-header-actions button:hover {
  background: rgba(255,255,255,0.25);
}
.social-chat-body {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.social-chat-conversations,
#socialChatConversations {
  flex: 1;
  width: 100%;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px 0;
}
.social-chat-conversation,
#socialChatConversation {
  flex: 1;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
}
.social-chat-conv-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid var(--border, #f0f0f0);
}
.social-chat-conv-item:hover {
  background: var(--hover-bg, #f5f9fc);
}
.social-chat-conv-item .social-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.social-chat-conv-info {
  flex: 1;
  min-width: 0;
}
.social-chat-conv-info strong {
  display: block;
  font-size: 14px;
  color: var(--text, #1a1a2e);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.social-chat-conv-last {
  display: block;
  font-size: 12px;
  color: #9ca3af;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.social-chat-empty {
  text-align: center;
  padding: 40px 16px;
  color: #9ca3af;
  font-size: 14px;
}

/* ===== CHAT CONVERSATION VIEW ===== */
.social-chat-conversation-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border, #f0f0f0);
  flex-shrink: 0;
}
.social-chat-conversation-header > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.social-chat-back {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  color: var(--text, #1a1a2e);
}
.social-chat-back:hover {
  background: var(--hover-bg, #f0f0f0);
}
.social-chat-messages {
  flex: 1;
  width: 100%;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--chat-bg, #f8fafc);
}
.social-chat-msg {
  box-sizing: border-box;
  max-width: 80%;
  min-width: 0;
  padding: 8px 12px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.4;
  position: relative;
  word-wrap: break-word;
}
.social-chat-msg-text {
  overflow-wrap: anywhere;
}
.social-chat-msg--mine {
  align-self: flex-end;
  background: linear-gradient(135deg, #0d4f6b, #1a7a9e);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.social-chat-msg--theirs {
  align-self: flex-start;
  background: var(--card-bg, #fff);
  color: var(--text, #1a1a2e);
  border: 1px solid var(--border, #e5e7eb);
  border-bottom-left-radius: 4px;
}
.social-chat-msg-time {
  display: block;
  font-size: 10px;
  opacity: 0.6;
  margin-top: 3px;
  text-align: right;
}
.social-chat-msg-del {
  position: absolute;
  top: 2px;
  right: 2px;
  background: none;
  border: none;
  color: inherit;
  opacity: 0;
  cursor: pointer;
  font-size: 12px;
  padding: 2px 4px;
  border-radius: 4px;
  transition: opacity 0.2s;
}
.social-chat-msg:hover .social-chat-msg-del {
  opacity: 0.5;
}
.social-chat-msg .social-chat-msg-del:hover {
  opacity: 1;
  background: rgba(0,0,0,0.1);
}
.social-chat-input-area {
  box-sizing: border-box;
  width: 100%;
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--border, #f0f0f0);
  flex-shrink: 0;
}
.social-chat-input-area input {
  flex: 1;
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 14px;
  outline: none;
  background: var(--input-bg, #f9fafb);
  color: var(--text, #1a1a2e);
}
.social-chat-input-area input:focus {
  border-color: var(--primary, #0a6b8a);
}
.social-chat-send-btn {
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #0d4f6b, #1a7a9e);
  color: #fff;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.15s;
}
.social-chat-send-btn:hover {
  transform: scale(1.05);
}

/* ===== DARK MODE OVERRIDES FOR CHAT ===== */
html[data-theme="dark"] .social-chat-modal {
  background: #1e293b;
  border-color: #334155;
}
html[data-theme="dark"] .social-chat-messages {
  background: #0f172a;
}
html[data-theme="dark"] .social-chat-msg--theirs {
  background: #1e293b;
  border-color: #334155;
  color: #f1f5f9;
}
html[data-theme="dark"] .social-chat-input-area input {
  background: #1e293b;
  border-color: #334155;
  color: #f1f5f9;
}
html[data-theme="dark"] .social-chat-conv-item {
  border-color: #1e293b;
}
html[data-theme="dark"] .social-chat-conv-item:hover {
  background: #1e293b;
}
html[data-theme="dark"] .social-friend-item {
  border-color: #1e293b;
}
html[data-theme="dark"] .social-friend-name {
  color: #f1f5f9;
}

/* ===== RESPONSIVE CHAT ===== */
@media (max-width: 600px) {
  .social-chat-modal {
    top: max(8px, env(safe-area-inset-top));
    right: max(8px, env(safe-area-inset-right));
    bottom: max(8px, env(safe-area-inset-bottom));
    left: max(8px, env(safe-area-inset-left));
    width: auto;
    height: auto;
    max-height: none;
    border-radius: 18px;
    transform-origin: bottom center;
  }
  body.social-chat-open {
    overflow: hidden;
    overscroll-behavior: none;
  }
  .social-chat-bubble {
    bottom: max(16px, env(safe-area-inset-bottom));
    right: max(16px, env(safe-area-inset-right));
    width: 48px;
    height: 48px;
  }
  .social-chat-header {
    padding-top: max(14px, env(safe-area-inset-top));
  }
  .social-chat-input-area {
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }
  .social-chat-input-area input {
    font-size: 16px;
  }
  .social-chat-bubble .social-chat-bubble-icon {
    font-size: 20px;
  }
}

.social-navbar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 16px;
  background: linear-gradient(135deg, var(--primary, #0d4f6b), var(--primary-light, #1a7a9e));
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}
.social-navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  max-width: 1120px;
}
.social-navbar-brand {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
}
.social-navbar-links {
  display: flex;
  list-style: none;
  gap: 2px;
  margin: 0;
  padding: 0;
}
.social-navbar-links li a {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  transition: all 0.2s;
}
.social-navbar-links li a:hover,
.social-navbar-links li a.active {
  background: rgba(255,255,255,0.15);
  color: #fff;
}
.social-navbar-links .nav-label {
  display: inline;
}
.social-navbar-user {
  display: flex;
  align-items: center;
  gap: 6px;
}
.social-navbar-user img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}
.social-navbar-exit {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  transition: all 0.2s;
}
.social-navbar-exit:hover {
  background: rgba(255,255,255,0.15);
  color: #fff;
}
@media (max-width: 640px) {
  .social-navbar-links .nav-label {
    display: none;
  }
  .social-navbar {
    padding: 5px 10px;
  }
  .social-navbar-inner {
    gap: 6px;
  }
  .social-navbar-brand {
    font-size: 13px;
  }
  .social-navbar-user a span {
    display: none;
  }
  .social-navbar-links li a {
    padding: 3px 6px;
    font-size: 11px;
  }
  .social-navbar-exit {
    padding: 3px 6px;
    font-size: 11px;
  }
}
