:root {
  --main-ui-color: #444444;
  --room-box-bg: var(--main-ui-color);
  --classic-header-bg: var(--main-ui-color);
  --sidebar-header-bg: var(--main-ui-color);
  --voice-top-bar-bg: var(--main-ui-color);
  --bottom-tabs-bg: var(--main-ui-color);
  --unified-btn-bg: #333333;
  --unified-btn-hover-bg: #222222;
  --mic-icon-color: #ffffff;
  --line-icon-color: #ffffff;
  --font-family: Arial, sans-serif;
  --font-size: 15.2px;
  --font-weight: 700;
  --bottom-tabs-height: 35px;
  --user-status-font-size: 11px;
  --user-name-font-size: 17px;
}

.room-box,
.classic-header,
.sidebar-header,
.voice-top-bar,
.bottom-tabs-bar {
  background-color: var(--main-ui-color) !important;
}


/* Theme classes for login buttons and icons */
.custom-theme-btn {
    background-color: var(--main-ui-color) !important;
    color: white !important;
    border-color: var(--main-ui-color) !important;
}

.custom-theme-outline-btn {
    color: var(--main-ui-color) !important;
    background-color: transparent !important;
    border-color: var(--main-ui-color) !important;
}
.custom-theme-outline-btn:hover {
    color: white !important;
    background-color: var(--main-ui-color) !important;
}

.custom-theme-icon {
    color: var(--main-ui-color) !important;
}

/* Reconnection Status Bar - Classic Clean Style */
.reconnect-status-bar {
  position: absolute;
  top: 65px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  width: auto;
  max-width: calc(100% - 24px);
  pointer-events: none;
}

.reconnect-content {
  min-width: 190px;
  max-width: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 3px;
  font: inherit;
  font-weight: 700;
  line-height: 1.5;
  color: #fff;
  text-align: center;
  white-space: nowrap;
  border: 1px solid rgba(0, 0, 0, 0.18);
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  transition: background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
  pointer-events: auto;
}

/* Reconnecting */
.reconnect-status-bar.reconnecting .reconnect-content {
  background: linear-gradient(to bottom, #f7b955, #e69a22);
  border-color: #d98b16;
}

/* Logging in / Restoring */
.reconnect-status-bar.logging-in .reconnect-content {
  background: linear-gradient(to bottom, #3f8fca, #2f6fa3);
  border-color: #285f8f;
}

/* Connected */
.reconnect-status-bar.connected .reconnect-content {
  background: linear-gradient(to bottom, #63bd63, #449d44);
  border-color: #3d8b3d;
}

/* Close Button */
.reconnect-close-btn {
  width: 18px;
  height: 18px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  margin-right: 4px;
  padding: 0;

  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 2px;

  color: #333;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;

  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.reconnect-close-btn:hover {
  background: #fff;
  color: #000;
}

.reconnect-close-btn:active {
  background: #e9e9e9;
}

/* Mobile */
@media (max-width: 576px) {
  .reconnect-status-bar {
    top: 48px;
    max-width: calc(100% - 16px);
  }

  .reconnect-content {
    min-width: 170px;
    max-width: 95vw;
    padding: 6px 10px;
  }

  .reconnect-close-btn {
    width: 17px;
    height: 17px;
    font-size: inherit;
  }
}

html, body {
  height: 100%;
  height: 100dvh;
  margin: 0;
  padding: 0;
  overflow: hidden; /* Prevent global scrollbars */
  width: 100%;
  max-width: 100vw;
  overscroll-behavior: none; /* Prevent pull-to-refresh */
  font-family: var(--font-family) !important;
  font-size: var(--font-size) !important;
  font-weight: var(--font-weight) !important;
  line-height: 1.4 !important;
  text-shadow: none !important;
}

/* Ensure SweetAlert is always on top of camera windows */
.swal2-container {
  z-index: 9999999 !important;
}

.text-danger {
    color: #d33 !important;
}

#app {
  height: 100%;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}


/* Custom Scrollbar for Private Chat */
#private-chat-messages {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    scrollbar-gutter: stable;
    scrollbar-width: thin !important;
    scrollbar-color: rgba(0, 0, 0, 0.25) transparent !important;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
}

#private-chat-messages::-webkit-scrollbar {
    width: 6px !important;
    display: block !important;
}

#private-chat-messages::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05) !important;
}

#private-chat-messages::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2) !important;
    border-radius: 4px !important;
}

#private-chat-messages::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.4) !important;
}

#private-chat-call-slot {
  width: 100%;
  display: flex;
  justify-content: center;
  z-index: 1050;
  pointer-events: none;
  padding: 20px 10px 0;
}

.call-panel {
  display: flex;
  align-items: center;
  gap: 12px;
  direction: rtl;
  width: 80%;
  max-width: 400px;
  min-height: 70px;
  padding: 10px 15px;
  border-radius: 12px;
  background: linear-gradient(135deg, #2c3e50, #000);
  border: 1px solid #444;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  pointer-events: auto;
  color: #fff;
  position: fixed;
  top: 100px;
  left: 10%;
  z-index: 9999;
  cursor: move;
  touch-action: none;
}

.call-avatar-wrapper {
  flex-shrink: 0;
  width: 50px;
  height: 50px;
}

.call-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #28a745;
}

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

.call-name {
  font-weight: bold;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.call-status {
  font-size: 11px;
  color: #ccc;
  margin-top: 2px;
}

.call-controls {
  display: flex;
  gap: 8px;
}

.btn-call-sm {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  transition: background-color 0.2s, opacity 0.2s;
}

.btn-call-sm:hover {
  filter: brightness(1.2);
}

.btn-accept { background-color: #28a745; }
.btn-reject { background-color: #dc3545; }
.btn-mute { background-color: #4a4a4a; }

#chat-shell {
  width: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  transform-origin: top center;
}

#chat-ui {
  height: 100%;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

#chat-ui.drag-over {
  position: relative;
}

#chat-ui.drag-over::after {
  content: "أفلت الملف هنا للرفع";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(40, 167, 69, 0.15);
  border: 4px dashed #28a745;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: bold;
  color: #28a745;
  z-index: 9999;
  pointer-events: none;
  backdrop-filter: blur(2px);
}

/* News Ticker Bar */
.news-ticker-container {
  width: 100%;
  height: 32px;
  overflow: hidden;
  position: relative;
  z-index: 5;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
}

.news-ticker-content {
  position: absolute;
  white-space: nowrap;
  padding-right: 50px;
  font-family: 'Tajawal', sans-serif !important;
  font-weight: 700 !important;
  font-size: var(--font-size) !important;
  display: inline-block;
  animation: ticker-ltr-animation 25s linear infinite;
}

.news-ticker-content:hover {
  animation-play-state: paused;
}

@keyframes ticker-ltr-animation {
  0% {
    transform: translateX(-100%);
    left: 0;
  }
  100% {
    transform: translateX(0);
    left: 100%;
  }
}
/* ================================
   Login Overlay Responsive Layout
   Desktop = 400px Center
   Mobile/Tablet = Full Screen
================================ */

#login-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  margin: 0;
  padding: 0;
  overflow: hidden;
   background-color: var(--landing-bg-color, #f8f9fa) !important;
    background-image:
      linear-gradient(
        rgb(255 255 255 / 86%),
        rgb(255 255 255 / 87%)
      ),
      url("https://ais-dev-zrqhbi57klyv6ncpp6rq6p-202887857096.europe-west2.run.app/uploads/wallfiles/file-1778464280120-487420907.webp") !important;
    background-repeat: no-repeat !important;
    background-position: center center !important;
    background-size: cover !important;
  display: flex;
  justify-content: center;
  align-items: stretch;
  box-sizing: border-box;
}

#login-overlay > .col-12 {
  width: 100vw !important;
  max-width: none !important;
  min-width: 0 !important;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #fff;
  overflow: hidden;
  box-sizing: border-box;
  border-right: 0;
  border-left: 0;
  box-shadow: none;
}

/* الكمبيوترات فقط */
@media (min-width: 992px) and (hover: hover) and (pointer: fine) {
  #login-overlay {
    align-items: center;
  }

  #login-overlay > .col-12 {
    width: 400px !important;
    max-width: 400px !important;
    min-width: 400px !important;
    flex: 0 0 400px !important;
    height: 100vh;
    height: 100dvh;
    margin: 0 auto;
    border-right: 5px solid var(--main-ui-color, #444444) !important;
    border-left: 5px solid var(--main-ui-color, #444444) !important;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
  }
}

/* الجوال والتابلت */
@media (max-width: 991.98px), (hover: none), (pointer: coarse) {
  #login-overlay {
    align-items: stretch;
  }

  #login-overlay > .col-12 {
    width: 100vw !important;
    max-width: none !important;
    min-width: 0 !important;
    flex: 1 1 auto !important;
    height: 100dvh !important;
    box-shadow: none !important;
    border-right: 5px solid var(--main-ui-color, #444444) !important;
    border-left: 5px solid var(--main-ui-color, #444444) !important;
  }
}

/* حتى قائمة المتواجدين تتمدد صح داخل الشاشة */
#login-overlay .landing-middle-area {
  min-height: 0;
}

#landing-users-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}
.landing-header {
  background-color: var(--main-ui-color, #212529) !important;
}

#connection-status-bar {
  background-color: var(--main-ui-color, #586572) !important;
}

.landing-middle-area {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  overflow: hidden;
}

.landing-top-content {
  flex: 0 1 auto;
}

.small, small {
  font-size: var(--font-size) !important;
  font-family: var(--font-family) !important;
  font-weight: var(--font-weight) !important;
  line-height: 1.4 !important;
  text-shadow: none !important;
}

.message-header {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  width: fit-content;
  align-self: flex-start;
}

.user-addon-container {
  display: inline-flex;
  align-items: center;
}

.story-circle {
  position: relative;
  display: inline-block;
}

.story-count-badge {
  position: absolute;
  top: 0;
  right: 0;
  background-color: red;
  color: white;
  border-radius: 50%;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: bold;
}

/* Hide scrollbars but allow scrolling for specific containers */
* {
  scrollbar-width: none; /* Hide for Firefox globally */
}

::-webkit-scrollbar {
  width: 0px;
  height: 0px;
  background: transparent;
}

/* Sidebar containers adjustments for fluid scaling */
.flex-grow-1.px-2.py-1.d-flex.flex-column {
  min-height: auto !important;
  height: auto !important;
}

#messages-container {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.25) transparent;
  flex-grow: 1;
  overflow-y: auto !important; /* Allow scroll instead of clip */
  overflow-x: hidden;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  background-color: #ffffff;
  height: 100%; /* Ensure it fills space but allows internal scrolling */
  min-height: 0;
}

#messages-container::-webkit-scrollbar {
  width: 6px !important;
  display: block; /* Chrome/Safari */
}

#messages-container::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
}

#messages-container::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

#messages-container::-webkit-scrollbar-thumb:hover {
  background-color: rgba(0, 0, 0, 0.4);
}

.bg-purple { background-color: #6f42c1; }

.btn-dark {
  background-color: #444444;
  border: 1px solid #555555;
  color: white;
}

.btn-dark:hover {
  background-color: #333333;
}

.voice-top-bar .overflow-auto {
  scrollbar-width: none;
}
.voice-top-bar .overflow-auto::-webkit-scrollbar {
  display: none;
}

.chat-input-container {
  background-color: var(--chat-input-bg, #f8f9fa);
  padding: 4px;
  border-top: 1px solid #ddd;
  width: 100%;
  overflow: visible;
}

input, textarea, select, button, .simple-setting-label, .classic-header, .classic-btn, .toggle-label {
  font-family: var(--font-family) !important;
  font-size: var(--font-size) !important;
  font-weight: var(--font-weight) !important;
  line-height: 1.4 !important;
  text-shadow: none !important;
}


.no-room-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  background-color: #f8f9fa;
  padding: 2rem;
  text-align: center;
  margin: 0;
  box-sizing: border-box;
  overflow: hidden;
}

.no-room-icon {
  font-size: 4rem;
  color: #6c757d;
  margin-bottom: 1.5rem;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0px); }
}

.no-room-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #343a40;
  margin-bottom: 1rem;
}

.no-room-text {
  color: #6c757d;
  margin-bottom: 2rem;
  max-width: 400px;
}

.no-room-btn {
  background-color: #28a745;
  color: white;
  border: none;
  padding: 0.75rem 2rem;
  border-radius: 50px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.no-room-btn:hover {
  background-color: #218838;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

/* Chat Cleared Design */
.chat-cleared-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 1rem;
  text-align: center;
  margin: 0;
  animation: chatClearedFadeIn 0.5s ease-out;
  overflow: hidden;
}

.chat-cleared-avatar-wrapper {
  position: relative;
  margin-bottom: 1.5rem;
}

.chat-cleared-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 4px solid #fff;
  box-shadow: 0 8px 20px rgba(245, 101, 101, 0.15);
  object-fit: cover;
}

.chat-cleared-badge {
  position: absolute;
  bottom: 0;
  right: 0;
  background-color: #f56565;
  color: white;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  font-size: 0.9rem;
}

.chat-cleared-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #718096;
  margin-top: 0.2rem;
}

.chat-cleared-user {
  font-size: 1.2rem;
  font-weight: 800;
  color: #2d3748;
  margin-bottom: 0;
}

.chat-cleared-banner {
  max-width: 200px;
  max-height: 100px;
  object-fit: contain;
  margin-bottom: 0.5rem;
  border-radius: 8px;
}

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

.chat-input-disabled {
  background-color: #e9ecef !important;
  cursor: not-allowed;
  opacity: 0.7;
  text-align: center;
  font-style: italic;
}

.chat-input-disabled::placeholder {
  color: #6c757d;
}

.chat-input-field {
  border: 1px solid #000 !important;
  border-radius: 4px !important;
  height: 32px;
  min-height: 32px;
  min-width: 0; /* Important for flex items */
  font-family: var(--font-family) !important;
  font-size: var(--font-size) !important;
  font-weight: var(--font-weight) !important;
  line-height: 1.4 !important;
  text-shadow: none !important;
  resize: none !important;
  overflow-y: hidden;
  max-height: 100px;
  padding-top: 4px;
  padding-bottom: 4px;
}

.chat-input-field:focus {
  overflow-y: auto;
}

.btn-input-action {
  background-color: var(--unified-btn-bg, #343a40);
  border: 1px solid #555;
  color: var(--line-icon-color, white);
  width: 32px;
  height: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.extra-actions-wrapper {
  position: relative;
  display: inline-flex;
}

.extra-actions-menu {
  position: absolute;
  bottom: calc(100% + 15px);
  left: 0;
  background-color: #2b2b2b;
  border: 1px solid #444;
  border-radius: 10px;
  padding: 8px;
  display: flex;
  flex-direction: row;
  gap: 8px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.5);
  z-index: 1050;
  animation: slideUpActions 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  white-space: nowrap;
}

.extra-actions-menu::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 15px;
  border-width: 8px;
  border-style: solid;
  border-color: #2b2b2b transparent transparent transparent;
}

@keyframes slideUpActions {
  from {
    opacity: 0;
    transform: translateY(15px) scale(0.8);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.extra-actions-menu .btn-input-action {
  width: 36px !important;
  height: 36px !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
}

#extra-actions-toggle.active {
  background-color: var(--unified-btn-hover-bg, #23272b) !important;
  color: #ffc107 !important;
  border-color: #ffc107 !important;
}

/* Special Entry Toast Styles */
.special-entry-toast {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 999999;
    padding: 10px 20px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    animation: slideInLeft 0.5s ease-out, fadeOut 0.5s ease-in 4s forwards;
    backdrop-filter: blur(10px);
    max-width: 90vw;
    width: auto;
    min-width: 300px;
}

.user-pro-item.ghost-user {
  /*! opacity: 0.55; */
  /*! filter: grayscale(1); */
}

.user-pro-item.ghost-user .user-name {
  color: #777 !important;
}

.user-pro-item.ghost-user::after {
  content: " (غير متصل)";
  font-size: 11px;
  color: #888;
  margin-inline-start: 6px;
}

@keyframes slideInLeft {
    from { transform: translateX(-100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

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

.entry-royal { background: linear-gradient(135deg, #1a1a1a, #000); color: #ffd700; border: 2px solid #ffd700; }
.entry-youth { background: linear-gradient(135deg, #000428, #004e92); color: #00f2fe; border: 2px solid #00f2fe; }
.entry-girls { background: linear-gradient(135deg, #fff0f5, #ffe6f0); color: #e83e8c; border: 2px solid #e83e8c; }

.special-entry-toast .avatar { width: 50px; height: 50px; border-radius: 50%; object-fit: cover; border: 2px solid currentColor; }
.special-entry-toast .content { display: flex; flex-direction: column; }
.special-entry-toast .title { font-weight: 800; font-size: 1.2rem; white-space: nowrap; }
.special-entry-toast .message { font-size: 0.9rem; opacity: 0.9; white-space: nowrap; }


.btn-input-action:hover:not(:disabled) {
  background-color: var(--unified-btn-hover-bg, #23272b);
}

.btn-input-action:disabled {
  background-color: #f8f9fa !important;
  border-color: #dee2e6 !important;
  cursor: not-allowed;
  opacity: 1;
}

.btn-input-action i {
  color: var(--line-icon-color, white);
}

.btn-input-action:disabled i {
  color: #adb5bd !important;
  opacity: 1;
}

.btn-send {
  background-color: var(--unified-btn-bg, #333333);
  border: 1px solid #555;
  color: white;
  height: 32px;
  padding: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: bold;
}

.btn-send:hover:not(:disabled) {
  background-color: #23272b;
  color: #fff !important;
}

.btn-send:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

/* Heart Bubble Animation */
.heart-bubble {
  position: fixed;
  pointer-events: none;
  font-size: 20px;
  color: #ff4d4d;
  transform: translateX(-50%);
  animation: heart-float 1s ease-out forwards;
  z-index: 9999;
}

.star-bubble {
  position: fixed;
  pointer-events: none;
  font-size: 20px;
  color: #ffc107;
  transform: translateX(-50%);
  animation: star-float 1s ease-out forwards;
  z-index: 9999;
}

@keyframes heart-float {
  0% {
    transform: translateY(0) translateX(-50%) scale(1);
    opacity: 1;
  }
  100% {
    transform: translateY(-100px) translateX(-50%) scale(1.5);
    opacity: 0;
  }
}

@keyframes star-float {
  0% {
    transform: translateY(0) translateX(-50%) scale(1);
    opacity: 1;
  }
  100% {
    transform: translateY(-100px) translateX(-50%) scale(1.5);
    opacity: 0;
  }
}

.btn-profile-likes-container {
  position: relative;
  display: inline-block;
}

.bottom-tabs-bar {
    background-color: var(--bottom-tabs-bg, #444444);
    padding: 2px;
    display: flex;
    /* gap: 4px; */
    width: 100%;
    height: var(--bottom-tabs-height);
    overflow: hidden;
    justify-content: flex-start;
}

.bottom-tabs-bar::-webkit-scrollbar {
  display: none;
}

.tab-btn {
    background-color: var(--unified-btn-bg, #333333);
    border: 1px solid #555;
    color: white;
    padding: 4px 10px;
    flex: none;
    font-size: 14px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    /* border-radius: 3px; */
    /* transition: all 0.2s; */
    white-space: nowrap;
    overflow: hidden;
}

@media (max-width: 768px) {
  .tab-btn {
    padding: 3px 1px;
    flex: 1; /* Distribute width equally (percentage-based) on mobile */
    font-size: clamp(9px, 2vw + 3px, 13px);
    gap: 2px;
  }
  .tab-btn i, .tab-btn .fa, .tab-btn .fas, .tab-btn .far, .tab-btn .bi, .tab-btn svg {
    font-size: 0.7em;
  }
}

.tab-btn:hover, .tab-btn.active {
  background-color: var(--unified-btn-hover-bg, #222222);
  border-color: #777;
}

.tab-btn i {
  font-size: 0.9em;
}

/* Voice/Mic Bar Styles */
.voice-top-bar {
  background-color: var(--voice-top-bar-bg, #444444);
  color: white;
  min-height: 45px;
  padding-top: max(4px, env(safe-area-inset-top)) !important;
  width: 100%;
  overflow: visible;
  position: relative;
  z-index: 100 !important;
}

.btn-voice-action {
  background: #28a745;
  color: white;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0px 6px 0px 6px;
  border: 1px solid #555;
  transition: all 0.2s;
}

.btn-voice-action.btn-danger {
  background: #dc3545 !important;
}

.btn-voice-action.btn-success {
  background: #28a745 !important;
}

.btn-voice-action i {
  font-size: 1.5rem;
}

.btn-mic {
    background-color: var(--main-ui-color) !important;
  border: 1px solid #5d5c5c;
  color: #555;
  width: 50px; /* Increased size */
  height: 48px; /* Increased size */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  position: relative;
  padding: 2px;
  overflow: visible; /* Changed to visible to let label go outside */
  box-sizing: border-box;
  --mic-level: 0;
}

.mic-user-label {
  position: absolute;
  left: -2px;
  right: -2px;
  bottom: -10px;
  height: 14px;
  line-height: normal; /* Changed from 14px to normal for flex */
  font-size: 10px;
  text-align: center;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  z-index: 50;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 2px;
  pointer-events: none;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#btn-room-music {
  z-index: 10 !important;
  cursor: pointer !important;
  position: relative;
  overflow: hidden; /* To contain the square avatar and visualizer */
  padding: 0 !important; /* Remove padding to let image fill */
  color: var(--mic-icon-color, #555);
}

#btn-room-music.active {
  border-color: var(--unified-btn-bg);
  background-color: #fff;
}

.music-user-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0; /* Square as requested */
  pointer-events: none;
  position: absolute;
  top: 0;
  left: 0;
}

#music-queue-list {
  background: #fdfdfd;
  border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar {
  width: 4px !important;
  height: 4px !important;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: #f1f1f1 !important;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: #ccc !important;
  border-radius: 10px !important;
}

.custom-scrollbar {
  scrollbar-width: thin !important;
  scrollbar-color: #ccc #f1f1f1 !important;
}

.hover-bg-light:hover {
  background-color: #f8f9fa;
}

.cursor-pointer {
  cursor: pointer;
}

/* Visualizer Bars */
.music-visualizer-container {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  padding-bottom: 4px;
  background: rgba(0,0,0,0.1); /* Lighter overlay */
  pointer-events: none;
}

.music-bar {
  width: 3px;
  background: rgba(0, 255, 0, 0.8); /* Semi-transparent vibrant green */
  border-radius: 2px 2px 0 0;
  animation: music-bar-dance 0.5s ease-in-out infinite alternate;
}

.music-bar:nth-child(1) { height: 20%; animation-delay: 0.1s; }
.music-bar:nth-child(2) { height: 35%; animation-delay: 0.3s; }
.music-bar:nth-child(3) { height: 25%; animation-delay: 0.2s; }
.music-bar:nth-child(4) { height: 40%; animation-delay: 0.4s; }

@keyframes music-bar-dance {
  from { height: 10%; }
  to { height: 45%; }
}

#btn-room-music.playing {
  animation: music-pulse 2s infinite;
  border-color: #00ff00 !important;
}

@keyframes music-pulse {
  0% { box-shadow: 0 0 0 0 rgba(0, 255, 0, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(0, 255, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 255, 0, 0); }
}

#roomMusicModal {
  z-index: 1200 !important;
  pointer-events: auto !important;
}

.swal2-container {
  z-index: 300000 !important;
  pointer-events: auto !important;
}

#roomMusicModal .modal-content {
  background-color: #ffffff !important;
  border-radius: 12px !important;
  overflow: hidden;
}

/* Room Grid Overlay */
#room-grid-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #f8f9fa;
  z-index: 2000;
  display: flex;
  flex-direction: column;
}

/* Room Grid Overlay CSS */
.no-room-rooms-list {
  width: 100%;
  max-width: 900px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.no-room-container.no-room-with-list {
  justify-content: flex-start;
  overflow: auto;
  padding-top: 24px;
}

.room-grid-header {
  background-color: var(--main-ui-color, #444444);
}

.room-grid-content {
  flex: 1;
}

.room-card {
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  background: white;
  cursor: pointer;
}

.room-card-img {
  width: 100%;
  height: 120px;
  object-fit: cover;
}

.call-avatar-wrapper {
  position: relative;
  width: 45px;
  height: 45px;
  border-radius: 50%;
}

.call-avatar-wrapper.active-call-waves::before,
.call-avatar-wrapper.active-call-waves::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: 50%;
  border: 2px solid #28a745;
  animation: sound-waves 2s linear infinite;
  pointer-events: none;
}

.call-avatar-wrapper.active-call-waves::after {
  animation-delay: 1s;
}

@keyframes sound-waves {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.8); opacity: 0; }
}

.call-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #28a745;
}

.call-avatar.ringing {
  animation: pulse-green 1.5s infinite;
}

@keyframes pulse-green {
  0% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(40, 167, 69, 0); }
  100% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0); }
}

.call-info { flex-grow: 1; margin: 0 15px; text-align: right; }
.call-name { font-weight: 600; font-size: 0.95rem; }
.call-status { font-size: 0.8rem; color: #aaa; }
.call-timer { font-size: 0.9rem; color: #ff4d4d; font-weight: bold; }

.call-controls { display: flex; gap: 10px; }

.btn-call-sm {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: white;
}
.btn-accept { background-color: #28a745; }
.btn-reject { background-color: #dc3545; }
.btn-mute { background-color: #4a4a4a; }

  #roomMusicModal .modal-content {
    max-height: 85vh !important;
    display: flex;
    flex-direction: column;
    border-radius: 12px !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2) !important;
  }

  #roomMusicModal .modal-body {
    overflow-y: auto !important;
    flex: 1;
    padding: 0 !important;
  }

  #music-queue-list {
    max-height: 250px !important;
  }

  #music-search-results {
    max-height: 150px !important;
  }


.music-info-card {
  background: #f8f9fa;
  border: 1px solid #eee;
  border-radius: 10px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.super-icon-small {
  height: 18px;
  object-fit: contain;
}

.user-topic-badge {
  font-size: 10px;
  background: #e9ecef;
  color: #495057;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid #dee2e6;
}

.room-user-count.active-mics {
  color: #dc3545;
  font-weight: bold;
  font-size: 90% !important;
}

#music-time-display {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: #555;
}

#music-progress-bar {
  transition: width 0.3s linear;
}

.modal-backdrop {
  z-index: 1150 !important;
}

/* Professional Bar Visualizer */
.mic-visualizer {
  position: absolute;
  bottom: 4px;
  left: 0;
  right: 0;
  height: 20px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  padding: 0 4px;
  pointer-events: none;
  z-index: 5;
  opacity: 0;
  transition: opacity 0.2s;
}

.btn-mic.speaking .mic-visualizer {
  opacity: 1;
}

.visualizer-bar {
  flex: 1;
  width: 2px;
  min-height: 2px;
  background: linear-gradient(to top, #28a745, #5cd67d);
  border-radius: 1px;
  transition: height 0.1s ease-out;
}

.btn-mic.speaking {
  border-color: #5d5c5c !important;
  background: #f0fff4;
}

.mic-container {
  padding-bottom: 12px;
  margin-bottom: -12px;
}

@media (max-width: 767px) {
  .btn-mic {
    width: 50px;
    height: 50px;
  }
  .mic-container {
    gap: 2px !important;
  }
  .mic-content i {
    font-size: 1.5rem;
  }
}

.mic-number {
  position: absolute;
  top: 1px;
  left: 3px;
  font-size: 9px;
  font-weight: bold;
  color: #999;
  z-index: 2;
}

.mic-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.mic-content i {
  font-size: 1.5rem;
  color: var(--mic-icon-color, #555);
}

.mic-user-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
}

.mic-user-name {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(0,0,0,0.6);
  color: white;
  font-size: 8px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 1px 0;
}

.btn-mic:hover {
  background: #f0f0f0;
  color: #000;
}

.btn-mic.active {
  background: #e8f5e9;
  border-color: #5d5c5c;
  color: #28a745;
}

.btn-mic.active .mic-number {
  color: #28a745;
}

.btn-mic.locked {
  background: #f8d7da !important;
  border-color: #f5c2c7 !important;
  color: #842029 !important;
  cursor: not-allowed !important;
  opacity: 0.7;
}

.btn-mic.locked .mic-content i {
  color: #842029 !important;
}

/* Fix Mic Focus White Borders & Shadows */
.btn-mic,
.btn-mic:hover,
.btn-mic:focus,
.btn-mic:active,
.btn-mic:focus-visible,
.btn-mic.active,
.btn-mic.active:focus,
.btn-mic.speaking,
.btn-mic.speaking:focus,
.btn-mic.btn:focus,
.btn-mic.btn:active,
.btn-mic.btn:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

.btn-mic:focus,
.btn-mic:active,
.btn-mic:focus-visible {
  border-color: #5d5c5c !important;
}

.btn-mic.active,
.btn-mic.active:focus,
.btn-mic.speaking,
.btn-mic.speaking:focus {
  border-color: #5d5c5c !important;
}

.btn-mic.speaking::after {
  content: "";
  position: absolute;
  inset: 1px;
  border: 2px solid rgba(40, 167, 69, 0.9);
  border-radius: 5px;
  pointer-events: none;
  z-index: 6;
  transform: scale(calc(1 + (var(--mic-level, 0) * 0.08)));
  opacity: calc(0.35 + (var(--mic-level, 0) * 0.65));
  transition: transform 0.08s linear, opacity 0.08s linear;
}

.btn-mic.speaking .mic-content {
  position: relative;
  z-index: 7;
}

.btn-mic.speaking .mic-visualizer {
  z-index: 8;
}

.mic-manage-btn {
  transition: transform 0.1s;
}

.mic-manage-btn:active {
  transform: scale(0.95);
}

@keyframes pulse-mic {
  0% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(40, 167, 69, 0); }
  100% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0); }
}

/* Profile Modals */
#userProfileModal {
  z-index: 1200 !important;
}
#passwordModal {
  z-index: 1300 !important;
}
#createRoomModal {
  z-index: 1300 !important;
}
#modPermissionsModal {
  z-index: 1400 !important;
}
/* Removed duplicate modal-backdrop */

.password-modal-dialog {
  max-width: 250px !important;
  margin: 1.75rem auto;
}

.create-room-modal-dialog {
  max-width: 400px !important;
  margin: 1.75rem auto;
}

/* Chat Message Styles */
@keyframes smooth-fade-in {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

.message-row {
  display: flex;
  gap: 0;
  padding: 0;
  padding-right: 12px;
  /* background-color: var(--chat-message-bg-color, #ffffff); */
  align-items: stretch;
  position: relative;
  user-select: none;
  border-bottom: 1px solid rgba(0,0,0,0.03);
  transition: none !important;
  animation: none !important;
}

.message-row:hover {
  filter: brightness(0.98);
}

.message-row:nth-child(odd) {
  background-color: transparent;
}

.message-row:nth-child(even) {
  background-color: transparent;
}

.message-avatar {
  width: 50px;
  height: 50px;
  align-self: stretch;
  border: none;
  border-radius: 0 !important;
  object-fit: cover;
  flex-shrink: 0;
  background-color: #f8f9fa;
  margin-right: 3px;
  cursor: pointer;
}

.message-body {
  flex-grow: 1;
  flex-direction: column;
  overflow: hidden;
}


.message-username {
  font-family: var(--font-family) !important;
  font-size: var(--font-size) !important;
  font-weight: var(--font-weight) !important;
  line-height: 1.4 !important;
  color: #000033;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fff;
  border: 1px solid #eee;
  padding: 0 4px;
  border-radius: 2px;
  width: fit-content;
  text-shadow: none !important;
}

.message-text {
  font-family: var(--font-family) !important;
  font-size: var(--font-size) !important;
  font-weight: var(--font-weight) !important;
  line-height: 1.4 !important;
  color: #000;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: pre-wrap;
  text-shadow: none !important;
}

/* System-like highlights in messages */
.room-highlight {
  background-color: #1a2a3a; /* Dark background as in image */
  color: #ffffff !important;
  padding: 1px 6px;
  border-radius: 2px;
  font-size: 12px;
  display: inline-block;
  margin: 0 4px;
  font-weight: bold;
}
.room-box {
  background-color: var(--room-box-bg, #333);
  color: #fff !important;
  padding: 1px 5px;
  /* border-radius: 3px; */
  display: inline-flex;
  align-items: center;
  gap: 1px;
  font-family: var(--font-family) !important;
  font-size: var(--font-size) !important;
  font-weight: var(--font-weight) !important;
  line-height: 1.4 !important;
  /* border: 1px solid #000; */
  /* margin: 0 4px; */
  text-shadow: none !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.room-box i {
  color: #fff !important;
  font-size: 14px;
}

.system-user-message {
  background-color: #fff9f0 !important; /* Cream background as in image */
}

@keyframes fadeInSlide {
  0% {
    opacity: 0;
    transform: translateY(-10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.system-user-message .message-text {
  color: #000;
  font-family: var(--font-family) !important;
  font-size: var(--font-size) !important;
  font-weight: var(--font-weight) !important;
  line-height: 1.4 !important;
  text-shadow: none !important;
}

.message-actions {
  position: absolute;
  right: 4px;
  top: 2px;
  display: flex;
  flex-direction: row;
  gap: 1px;
  z-index: 10;
}

.btn-msg-action {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  color: white;
  font-size: 10px;
  cursor: pointer;
  border-radius: 4px;
  transition: transform 0.1s;
}

.btn-msg-action i {
  font-size: 10px;
}

.reply-btn {
 background-color: var(--main-ui-color) !important;
}

.delete-btn {
  background-color: #bf4141; /* Red as in image */
}

.btn-msg-action:active {
  transform: scale(0.9);
}

.profile-actions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  padding: 5px;
  background: #ddd;
  border-top: 1px solid #ccc;
  direction: rtl;
}

.btn-profile-action {
  background: #f0f0f0;
  border: 1px solid #ccc;
  padding: 6px 8px;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #000;
  text-decoration: none;
  border-radius: 0;
  font-weight: bold;
  width: 100%;
  transition: background 0.2s;
}

.btn-profile-action:hover {
  background: #e0e0e0;
  color: #000;
}

.btn-profile-action i {
  font-size: 16px;
  color: #333;
}

.btn-likes {
  background: #ff4444 !important;
  color: #fff !important;
  border-color: #cc0000 !important;
}

.btn-likes i {
  color: #fff !important;
}

.btn-ignore {
  color: #ff4444 !important;
  justify-content: center;
  gap: 8px;
}

.btn-ignore i {
  color: #ff4444 !important;
}

.profile-stats {
  padding: 15px 0;
  border-bottom: 1px solid #eee;
  text-align: center;
}

.profile-stat-item {
  display: inline-block;
}

.profile-stat-value {
  font-weight: bold;
  font-size: 24px;
  color: #4b3082;
  display: block;
}

.profile-stat-label {
  font-size: 14px;
  color: #666;
}

/* Quoted Message Styles */
.quoted-message {
  background-color: #f1f1f1;
  border-right: 3px solid #4b3082;
  padding: 6px 10px;
  margin-bottom: 6px;
  border-radius: 4px;
  font-size: 14px;
  color: #555;
  width: fit-content;
  max-width: 100%;
  position: relative;
  display: flex;
  flex-direction: row; /* Changed to row to show avatar next to text */
  gap: 8px;
  align-items: flex-start;
}

.quoted-avatar {
  width: 50px;
  height: 50px;
  border-radius: 3px;
  object-fit: cover;
}

.quoted-content {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.quoted-message::before {
  content: '\f10d'; /* quote-left */
  font-family: 'Font Awesome 5 Free';
  font-weight: 900;
  position: absolute;
  left: 8px;
  top: 5px;
  font-size: 10px;
  color: #ccc;
  opacity: 0.5;
}

.quoted-username {
  font-weight: bold;
  color: #4b3082;
  display: block;
  font-size: 14px;
  margin-bottom: 2px;
}

.reply-preview-container {
  background-color: #f8f9fa;
  padding: 8px 12px;
  border-top: 1px solid #ddd;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  border-right: 5px solid #4b3082;
  gap: 10px;
}

.reply-preview-avatar {
  width: 50px;
  height: 50px;
  border-radius: 4px;
  object-fit: cover;
}

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

.reply-preview-content {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-grow: 1;
  padding-right: 8px;
}

/* Swipe indicator icon */
.swipe-indicator {
  position: absolute;
  left: -45px;
  top: 50%;
  transform: translateY(-50%) scale(0.6);
  color: #4b3082;
  font-size: 22px;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  background: rgba(75, 48, 130, 0.15);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  pointer-events: none;
}

.swipe-indicator.active {
  transform: translateY(-50%) scale(1.1);
  opacity: 1;
  background: rgba(75, 48, 130, 0.25);
  color: #4b3082;
}

.site-banner {
  max-height: 150px;
  width: 100%;
  object-fit: cover;
}

/* Name Banner Effect (Simulated) */
.name-banner {
  background-image: url('https://picsum.photos/seed/banner/200/30');
  background-size: contain;
  background-repeat: no-repeat;
  padding: 0 5px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  color: #333;
}

.list-group-item {
  transition: background 0.2s;
}

.list-group-item:hover {
  background-color: #f8f9fa;
}

/* Classic Admin Edit Section Styles */
.classic-admin-section {
  direction: rtl !important;
  background: #fff;
  padding: 5px !important;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.classic-admin-row {
  display: flex;
  align-items: stretch;
  border: 1px solid #ced4da;
  border-radius: 4px;
  min-height: 30px;
  background-color: #fff;
  overflow: hidden;
}

.classic-admin-label-btn, .classic-admin-label-text {
  background: #f8f9fa;
  color: #333;
  border: none;
  border-left: 1px solid #ced4da;
  padding: 0 12px;
  font-family: var(--font-family) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 90px;
  cursor: default;
  white-space: nowrap;
}

.classic-admin-input-container {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 0;
  position: relative;
  background: #fff;
}

.classic-admin-input {
  width: 100%;
  height: 100%;
  border: none;
  padding: 0 10px;
  font-size: 14px;
  font-weight: bold;
  outline: none;
  font-family: var(--font-family) !important;
  background: transparent;
  color: #333;
}

.classic-admin-input:focus {
  background: #fff;
}

.classic-admin-action-btn {
  background: var(--unified-btn-bg, #333333);
  color: white;
  border: none;
  border-right: 1px solid #ced4da;
  padding: 0 15px;
  font-size: 14px;
  font-weight: bold;
  font-family: var(--font-family) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  min-width: 80px;
  transition: background 0.2s ease;
  white-space: nowrap;
}

.classic-admin-action-btn:hover {
  background: var(--unified-btn-hover-bg, #222222);
}

.classic-admin-action-btn:active {
  background: var(--unified-btn-hover-bg, #222222);
  opacity: 0.9;
}

.classic-admin-action-btn.dark {
  background: var(--unified-btn-bg, #333333);
  color: white;
}

.classic-admin-action-btn.dark:hover {
  background: var(--unified-btn-hover-bg, #222222);
}

.classic-admin-action-btn i {
  font-size: 14px;
}

.classic-admin-action-btn.success-anim {
  background: #28a745 !important;
  color: #fff !important;
  animation: success-pulse 0.5s ease-out;
}

@keyframes success-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.classic-admin-action-btn .fa-check {
  color: #fff;
}


/* Sidebar Styles */
.sidebar-container {
  --sidebar-width: min(340px, 80vw);
  position: fixed;
  top: 0;
  bottom: var(--bottom-tabs-height);
  right: calc(var(--sidebar-width) * -1);
  width: var(--sidebar-width);
  background-color: #FAFAFA;
  box-shadow: -2px 0 10px rgba(0,0,0,0.1);
  z-index: 1100 !important;
  display: flex;
  flex-direction: column;
  border-left: 1px solid #444444;
  overflow: hidden;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .sidebar-container {
    --sidebar-width: 77vw;
  }
}

.sidebar-container.open {
  right: 0 !important;
}

.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  z-index: 1090 !important;
  display: none;
}

.sidebar-overlay.show {
  display: block !important;
}

.sidebar-header {
  padding: 0.3rem 0.6rem;
  background-color: var(--sidebar-header-bg, #555555);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
  font-size: 15px !important;
}

.sidebar-header h6 {
  font-size: 15px !important;
  margin: 0;
  font-weight: 700;
}

.sidebar-header.wall-header {
  background-color: var(--sidebar-header-bg, #555555);
}

.other-rooms-header, .current-room-header {
  background-color: var(--sidebar-header-bg, #555555) !important;
  color: #fff;
  text-align: center;
  padding: 4px 0;
  font-weight: bold;
  font-size: 15px;
}

.sidebar-close-btn {
  background: #e74c3c !important;
  color: white !important;
  border: none !important;
  width: 24px !important;
  height: 24px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 4px !important;
  cursor: pointer !important;
  font-size: 14px !important;
  opacity: 1 !important;
  transition: none !important;
}

.sidebar-close-btn:hover {
  background: #a93226 !important;
}

/* Sidebar Content Animations */

.sidebar-content-animate {
}

#sidebar-search-container {
  overflow: hidden;
  max-height: 100px;
  opacity: 1;
  flex-shrink: 0;
}

#sidebar-search-container.d-none {
  display: none !important; /* Keep d-none for logic, but we'll use a better way in JS if possible */
}

/* Better way: use a class for visibility instead of d-none if we want smooth height */
.sidebar-search-visible {
  max-height: 100px !important;
  opacity: 1 !important;
  padding: 0.3rem !important;
  border-bottom: none !important;
}

.sidebar-search-hidden {
  max-height: 0 !important;
  opacity: 0 !important;
  padding: 0 !important;
  border-bottom: 0 !important;
  pointer-events: none;
}

.sidebar-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  padding: 0;
  font-size: 15px !important;
  opacity: 1;
  position: relative;
}

.sidebar-tab-content {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  scrollbar-width: thin !important;
  scrollbar-color: rgba(0, 0, 0, 0.3) transparent !important;
}

.sidebar-tab-content::-webkit-scrollbar {
  width: 6px !important;
  height: 6px !important;
  display: block !important;
}

.sidebar-tab-content::-webkit-scrollbar-track {
  background: transparent !important;
}

.sidebar-tab-content::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.3) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 10px !important;
}

.sidebar-tab-content::-webkit-scrollbar-thumb:hover {
  background-color: rgba(0, 0, 0, 0.5) !important;
}

#sidebar-wall-container {
  overflow: hidden !important;
  padding-bottom: 0 !important;
}

.sidebar-tab-content.d-none {
  display: none !important;
}

.sidebar-content.fade-out {
  opacity: 0;
}

.sidebar-content.fade-in {
}


#sidebar-search-input {
  font-size: 15px !important;
}

/* YouTube Search Modal - Classic & Professional */
.yt-search-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 450px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  z-index: 2000;
  display: none;
  overflow: hidden;
  direction: rtl;
  border: 1px solid #34495e;
}

.yt-modal-header {
  background: #34495e;
  color: #fff;
  padding: 10px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
  font-size: 16px;
}

.yt-modal-close {
  background: #e74c3c;
  color: #fff;
  border: none;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  transition: background 0.2s;
}

.yt-modal-close:hover {
  background: #c0392b;
}

.yt-modal-body {
  padding: 15px;
  background: #f9f9f9;
}

.yt-search-box {
  display: flex;
  gap: 5px;
  margin-bottom: 15px;
}

.yt-search-box input {
  flex-grow: 1;
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  outline: none;
  font-size: 14px;
}

.yt-search-box input:focus {
  border-color: #34495e;
}

.yt-search-box button {
  background: #34495e;
  color: #fff;
  border: none;
  padding: 0 15px;
  border-radius: 4px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.yt-search-box button:hover {
  opacity: 0.9;
}

.yt-results-list {
  position: absolute; /* Make it float */
  top: calc(100% - 2px); /* Position below search input */
  left: 10px;
  right: 10px;
  z-index: 1000;
  max-height: 350px;
  overflow-y: auto;
  border: 1px solid #ddd;
  background: #fff;
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
  display: block;
}

/* Hide when empty but keep in DOM */
.yt-results-list:empty {
  display: none;
}

.yt-result-item {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid #f5f5f5;
  cursor: pointer;
  transition: all 0.2s;
}

.yt-result-item:hover {
  background: #f8faff;
}

.yt-result-thumb-wrap {
  position: relative;
  width: 100px;
  height: 56px;
  margin-right: 12px;
  flex-shrink: 0;
  border-radius: 4px;
  overflow: hidden;
  background: #000;
}

.yt-result-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.9;
}

.yt-play-icon-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 18px;
  text-shadow: 0 0 10px rgba(0,0,0,0.5);
  opacity: 0.8;
}

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

.video-title {
  font-size: 0.85rem;
  font-weight: 500;
  color: #333;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
}

.yt-result-info {
  flex-grow: 1;
  overflow: hidden;
}

.yt-result-title {
  font-size: 14px;
  font-weight: bold;
  color: #333;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.yt-result-channel {
  font-size: 12px;
  color: #777;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 1999;
  display: none;
}

/* Removed duplicate sidebar-overlay */

.message-text img,
.quoted-text img,
.message-username img {
  vertical-align: middle;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.message-text img.smiley-img,
.quoted-text img.smiley-img,
.message-username img.smiley-img {
  max-width: 240px !important;
}

.message-text img.sticker-img,
.quoted-text img.sticker-img {
  width: 50px !important;
  height: 50px !important;
  max-width: 50px !important;
  max-height: 50px !important;
  object-fit: contain;
}

.message-text img:hover,
.quoted-text img:hover,
.message-username img:hover {
  opacity: 0.9;
}

/* Classic Notifications */
.classic-notification-item {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 10px;
  margin-bottom: 8px;
  font-size: 13px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  transition: all 0.2s;
  direction: rtl;
}

.classic-notification-item.unread {
  border-right: 4px solid var(--primary-color);
  background: #f0f7ff;
}

.classic-notification-item:hover {
  background: #f8f9fa;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.notification-text {
  color: #333;
  font-weight: 500;
  line-height: 1.4;
}

.notification-time {
  font-size: 11px;
  color: #888;
  white-space: nowrap;
  margin-right: 10px;
}
.lightbox {
  display: none;
  position: fixed;
  z-index: 100000;
  padding-top: 60px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lightbox.show {
  display: block;
  opacity: 1;
}

.lightbox-content {
  margin: auto;
  display: block;
  max-width: 90%;
  max-height: 80dvh;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.lightbox.show .lightbox-content {
  transform: scale(1);
}

.lightbox-close {
  position: absolute;
  top: 15px;
  right: 35px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  transition: 0.3s;
  cursor: pointer;
  z-index: 100001;
}

.lightbox-close:hover,
.lightbox-close:focus {
  color: #bbb;
  text-decoration: none;
  cursor: pointer;
}

@media only screen and (max-width: 700px){
  .lightbox-content {
    width: 100%;
  }
}

/* Classic Settings Styles */
.classic-settings-container {
  background-color: #eee;
  padding: 2px;
  font-family: var(--font-family);
  direction: rtl;
}

.classic-header {
  background-color: var(--classic-header-bg, #444);
  color: #fff;
  text-align: center;
  padding: 4px;
  font-weight: bold;
  border: 1px solid #000;
  margin-bottom: 2px;
  font-size: 14px;
  z-index: 100 !important;
  position: relative;
}

#sidebar-settings-container .classic-header {
  background-color: var(--unified-btn-bg, #333333) !important;
  width: 130px;
  float: left;
}

.classic-input {
  width: 100%;
  border: 1px solid #000;
  padding: 4px;
  text-align: center;
  background-color: #fff;
  color: #000;
  font-size: 14px;
  outline: none;
}

.classic-color-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  margin-bottom: 4px;
}

.classic-color-item {
  background-color: #2c3e50;
  color: #ecf0f1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border: 1px solid #1a252f;
  font-size: 13px;
  border-radius: 2px;
  transition: all 0.2s ease;
}

.classic-color-item:hover {
  background-color: #34495e;
  border-color: #2c3e50;
}

.classic-color-box {
  width: 32px;
  height: 20px;
  border: 1px solid #000;
  cursor: pointer;
  padding: 0;
  background: none;
  border-radius: 2px;
  transition: transform 0.1s ease;
}

.classic-color-box:hover {
  transform: scale(1.1);
}

.classic-color-box::-webkit-color-swatch-wrapper {
  padding: 0;
}

.classic-color-box::-webkit-color-swatch {
  border: none;
  border-radius: 1px;
}

.simple-settings-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin-top: 2px;
  margin-bottom: 2px;
  width: min(250px, 100%);
  margin-left: 0;
  margin-right: auto;
  float: none !important;
  clear: both;
  box-sizing: border-box;
}

.simple-setting-row {
  display: flex;
  align-items: center;
  gap: 0;
  width: 100%;
  direction: ltr;
  box-sizing: border-box;
  margin-bottom: 1px;
}

.simple-setting-label {
  background-color: var(--unified-btn-bg, #444);
  color: #fff;
  font-weight: bold;
  padding: 4px 6px;
  border: 1px solid #000;
  font-size: 14px;
  flex: 1;
  text-align: center;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  direction: rtl;
  box-sizing: border-box;
  margin-right: 1px;
}

.simple-color-preview {
  width: 80px;
  min-width: 30px;
  height: 30px;
  border: 1px solid #000;
  border-left: none;
  cursor: pointer;
  position: relative;
  box-sizing: border-box;
}

/* شكل احترافي لمربع اللون عندما لا يوجد لون */
.simple-color-preview.transparent {
  position: relative;
  background-color: #fff !important;
  background-image:
    linear-gradient(45deg, #ddd 25%, transparent 25%),
    linear-gradient(-45deg, #ddd 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #ddd 75%),
    linear-gradient(-45deg, transparent 75%, #ddd 75%);
  background-size: 10px 10px;
  background-position: 0 0, 0 5px, 5px -5px, -5px 0px;
  border: 1px dashed #777 !important;
  box-sizing: border-box;
}
.simple-color-preview.transparent::after {
  content: "x";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #333;
  font-size: 18px;
  font-weight: bold;
  line-height: 1;
  background: rgba(255, 255, 255, 0.35);
}


.color-palette-popover {
  position: fixed;
  z-index: 100000;
  background: #fff;
  border: 1px solid #000;
  padding: 6px;
  display: grid;
  grid-template-columns: repeat(8, 24px);
  gap: 3px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.4);
  border-radius: 4px;
  max-height: 250px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: #999 #eee;
}

.color-palette-popover::-webkit-scrollbar {
  width: 5px;
}

.color-palette-popover::-webkit-scrollbar-track {
  background: #eee;
  border-radius: 10px;
}

.color-palette-popover::-webkit-scrollbar-thumb {
  background: #999;
  border-radius: 10px;
}

.color-palette-popover::-webkit-scrollbar-thumb:hover {
  background: #666;
}

.palette-color {
  width: 24px;
  height: 24px;
  border: 1px solid #ccc;
  cursor: pointer;
  transition: transform 0.1s ease;
}

.palette-color:hover {
  border-color: #000;
  transform: scale(1.1);
  z-index: 1;
}

.palette-color.transparent {
  position: relative;
  background-color: #fff !important;
  background-image:
    linear-gradient(45deg, #ddd 25%, transparent 25%),
    linear-gradient(-45deg, #ddd 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #ddd 75%),
    linear-gradient(-45deg, transparent 75%, #ddd 75%);
  background-size: 8px 8px;
  background-position: 0 0, 0 4px, 4px -4px, -4px 0px;
  border: 1px dashed #777 !important;
  box-sizing: border-box;
}

.palette-color.transparent::after {
  content: "×";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #333;
  font-size: 14px;
  font-weight: bold;
  line-height: 1;
  background: rgba(255, 255, 255, 0.35);
}

.classic-btn {
  width: 100%;
  padding: 4px 8px;
  border: 1px solid #000;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  cursor: pointer;
  font-size: 14px;
  text-decoration: none;
  position: relative;
}

.classic-btn-green {
  background-color: #5cb85c;
  color: #fff;
}

.classic-btn-red {
  background-color: #d9534f;
  color: #fff;
}

.classic-btn-red-black {
  background-color: #d9534f;
  color: #000;
}

.classic-btn-white {
  background-color: #fff;
  color: #000;
}

.classic-btn-dark {
  background-color: #444;
  color: #fff;
}

.classic-btn-pink {
  background: linear-gradient(to left, #f5f5f5, #d9534f);
  color: #000;
}

.classic-avatar-small {
  width: 22px;
  height: 22px;
  border: 1px solid #000;
  object-fit: cover;
}

.classic-btn i {
  font-size: 14px;
}

.classic-btn .btn-icon-left {
  position: absolute;
  left: 8px;
}

/* Styling for profile room/country info */
.profile-info-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 5px 5px;
  background: #dedede;
  color: #ffffff;
  font-size: 1.0rem;
}
.profile-info-bar-left {
  display: flex;
  align-items: center;
  gap: 6px;
}
.profile-info-item {
  background: #3e3d3d;
  padding: 5px 12px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s;
}

#profile-room-name-container:hover {
  background: #4e4e4e;
}

.classic-btn .btn-icon-right {
  position: absolute;
  right: 8px;
}


/* Room Card Styles */
.room-card {
  border: 1px solid #ddd;
  border-radius: 0;
  overflow: hidden;
  border-bottom: 1px solid #ddd;
  background: #fff;
  transition: transform 0.2s;
  cursor: pointer;
  margin-top: -1px; /* Remove double borders and white space between cards */
}

.room-card.active {
  border-left: 3px solid #007bff;
  border-right: 3px solid #007bff;
}


.room-card .text-muted.small {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.room-card-thumbnail {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 0;
  margin: 0 !important;
  padding: 0 !important;
  border-bottom: 1px solid #ddd;
  display: block;
}

.room-card-bg {
  height: 150px;
  background-size: cover;
  background-position: center;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 10px;
  color: white;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.room-card-bg::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.3);
}

.room-card-bg > * {
  position: relative;
  z-index: 1;
}

.room-user-count {
  background-color: var(--unified-btn-bg, #343a40);
  color: white;
  padding: 2px 8px;
  border-radius: 0;
  font-size: 12px;
  font-weight: bold;
}

.room-user-count.active-mics {
  background-color: #dc3545 !important;
  color: white;
}

/* Emoji Picker */
.emoji-picker-container {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 250px;
  background: #fff;
  border-top: 2px solid #ddd;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
  direction: rtl;
}

.emoji-picker-header {
  display: flex;
  background: #f8f9fa;
  border-bottom: 1px solid #eee;
  padding: 0 5px;
  align-items: center;
}

.picker-tab {
  border: none;
  background: none;
  padding: 10px 15px;
  font-weight: bold;
  font-size: 14px;
  color: #666;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.picker-tab.active {
  color: #0d6efd;
  border-bottom-color: #0d6efd;
}

.btn-close-picker {
  margin-right: auto;
  border: none;
  background: none;
  color: #999;
  font-size: 18px;
  padding: 5px 10px;
  cursor: pointer;
}

.emoji-picker-content {
  flex-grow: 1;
  overflow-y: auto;
  padding: 2px;
  display: flex;
  flex-wrap: wrap;
  gap: 1px;
  align-content: start;
}

.emoji-picker-content.smiley-tab {
  display: flex;
  flex-wrap: wrap;
  gap: 1px;
}

.picker-item {
  cursor: pointer;
  transition: transform 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1px;
  border-radius: 2px;
}

.picker-item:hover {
  background: #f0f0f0;
  transform: scale(1.1);
}

.picker-item img {
  max-width: 240px !important;
  max-height: 20px !important;
  object-fit: contain;
  vertical-align: middle;
}

.picker-item.smiley img {
  max-width: 240px !important;
  max-height: 20px !important;
}

.picker-item.sticker img {
  width: 50px !important;
  height: 50px !important;
  max-width: 50px !important;
  max-height: 50px !important;
}

/* Clean up old rule */

/* Clean up old wall list */

.announcement-badge {
  float: left;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background-color: #dfdddd;
  color: #1900f7;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: bold;
  border: 1px solid #acaaab;
  margin-right: 5px;
  margin-left: 5px;
  vertical-align: middle;
}

.new-posts-alert {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #28a745;
  color: white;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  display: none;
  animation: fadeInDown 0.3s ease;
  border: none;
}

.new-posts-alert:hover {
  background-color: #218838;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translate(-50%, -10px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.wall-post-card {
    display: flex;
    padding: 0;
    border-bottom: 1px solid #eee;
    background: #fff;
    min-height: 45px;
    gap: 2px;
    direction: ltr;
    contain: paint;
}

.wall-pending {
}

.wall-post-avatar {
  min-width: 52px;
  width: 52px;
  height: 46px;
  border-radius: 0;
  object-fit: cover;
  flex-shrink: 0;
  margin: 0;
}

.wall-post-main {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  position: relative;
}

.wall-post-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 4px;
}

.wall-post-username {
  color: #e67e22; /* Orange color from image */
  font-weight: bold;
  font-size: var(--font-size) !important;
  margin-bottom: 0;
  text-decoration: none;
  display: inline-block;
  background: #fff;
  padding: 0 5px;
  border-radius: 2px;
  cursor: default;
}

.wall-post-time {
  font-size: calc(var(--font-size) * 0.75) !important;
  color: #777;
  font-weight: bold;
  display: inline-flex !important;
  flex-direction: row !important;
  direction: rtl !important;
  align-items: center;
  gap: 1px;
}

.wall-post-content {
  display: block;
  margin-top: -5px;
  font-size: 15px;
  line-height: 1.3;
  color: #000000;
  word-break: break-word;
  position: relative;
  width: 100%;
}

.wall-post-content::after {
  content: "";
  display: table;
  clear: both;
}

.wall-post-body {
  display: inline;
  width: auto;
}

.wall-post-text {
  display: inline;
  text-align: left;
  font-size: var(--font-size) !important;
  word-break: break-word;
}

.wall-post-media-clear {
  width: auto;
  max-width: 100%;
  display: block;
  margin-top: 3px;
}

.wall-post-media,
.message-media {
  display: inline-flex;
  max-width: 100%;
}

.wall-post-actions-row {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  height: 22px;
  float: right;
  margin-top: 5px;
  margin-left: 10px;
  margin-bottom: 2px;
  width: auto;
  position: relative;
  z-index: 2;
}

.wall-post-content.has-media .wall-post-actions-row {
  margin-top: 4px;
}

.wall-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  color: #fff;
  font-size: 11px;
  border: none;
  cursor: pointer;
  min-width: 24px;
  height: 20px;
  gap: 3px;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.wall-action-btn:active {
  transform: scale(0.9);
}

.wall-btn-like {
  background-color: #d9534f; /* Red */
}

.wall-btn-like i.fas.animate-like {
  animation: like-pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes like-pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.4); }
  100% { transform: scale(1); }
}

.wall-btn-comment {
  background-color: #2c3e50; /* Dark */
}

.wall-btn-delete {
  background-color: #d9534f; /* Red */
}

.wall-action-btn i {
  font-size: 10px;
  transition: all 0.2s ease;
}

.wall-action-btn span {
  font-weight: bold;
  font-size: 0.8em;
}

/* Classic Comment Modal */
.comment-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1200 !important; /* Raised above sidebar (1100) */
}

.comment-modal {
  width: 340px;
  max-width: 95%;
  background: #fff;
  border-radius: 0; /* Sharp corners */
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  border: 1px solid #34495e;
}

.comment-modal-header {
  background: #34495e;
  color: #fff;
  padding: 6px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
  border-radius: 0;
}

.comment-modal-header .title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}

.comment-modal-header .close-btn {
  cursor: pointer;
  font-size: 18px;
  opacity: 0.9;
}

.comment-modal-header .close-btn:hover {
  opacity: 1;
}

.comment-modal-body {
  height: 380px;
  overflow-y: auto;
  background: #fff; /* Solid white background */
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.25) transparent;
}

.comment-modal-body::-webkit-scrollbar {
  width: 6px !important;
  display: block;
}

.comment-modal-body::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
}

.comment-modal-body::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

.comment-modal-body::-webkit-scrollbar-thumb:hover {
  background-color: rgba(0, 0, 0, 0.4);
}


.comment-original-post {
  background-color: #f8f9fa;
  border-bottom: 1px solid #e2e8f0;
  padding: 15px;
  margin-bottom: 15px;
  border-right: 4px solid #34495e;
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.comment-item {
  display: flex;
  padding: 6px;
  border-bottom: 1px solid #f0f0f0;
  background: #fff;
  gap: 8px;
  position: relative;
}

.comment-avatar {
  width: 52px;
  height: 46px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid #eee;
}

.comment-main {
  flex-grow: 1;
  text-align: right;
  direction: rtl;
}

.comment-user-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 1px;
}

.comment-username {
  font-weight: bold;
  font-size: 13px;
  color: #333;
}

.comment-text {
  font-size: 13px;
  color: #444;
  line-height: 1.2;
}

.comment-time {
  position: absolute;
  top: 6px;
  left: 6px;
  font-size: 10px;
  color: #aaa;
  display: inline-flex !important;
  flex-direction: row !important;
  direction: rtl !important;
  align-items: center;
  gap: 1px;
}

.comment-modal-footer {
  background: #e0e0e0; /* Classic gray footer */
  padding: 4px;
  display: flex;
  gap: 2px;
  align-items: center;
  border-top: 1px solid #ccc;
}

.comment-modal-input-group {
  display: flex;
  flex-grow: 1;
  background: #fff;
  border: 1px solid #999;
  align-items: center;
  padding: 0 2px;
  border-radius: 0;
}

.comment-smiley-btn {
  font-size: 16px;
  color: #666;
  cursor: pointer;
  padding: 2px 4px;
}

.comment-modal-input {
  flex-grow: 1;
  border: none;
  padding: 5px;
  font-size: 13px;
  outline: none;
  text-align: right;
  direction: rtl;
  background: transparent;
  box-shadow: none !important; /* Remove any glow */
}

.comment-send-btn {
  background: #34495e;
  color: #fff;
  border: none;
  width: 36px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 0;
}

.wall-post-form-container {
  background: #f0f2f5;
  padding: 4px;
  border-top: 1px solid #ccc;
  flex-shrink: 0;
  position: relative;
}

.wall-post-input-group {
  display: flex;
  gap: 4px;
  align-items: center;
  background: #fff;
  border: 1px solid #999;
  padding: 2px;
}

.wall-post-input {
  flex-grow: 1;
  border: none;
  padding: 6px 10px;
  font-size: var(--font-size) !important;
  outline: none;
  background: transparent;
  resize: none;
  height: 32px;
  line-height: 20px;
}

.wall-post-btn-send {
  background-color: var(--unified-btn-bg, #333333);
  border: 1px solid #555;
  color: white;
  height: 32px;
  padding: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: bold;
}
.wall-post-btn-send:hover {
  background-color: var(--unified-btn-hover-bg, #444444);
  color: #fff !important;
}

.wall-post-btn-icon {
  background: #f8f9fa;
  border: solid 1px #ccc;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #333;
  cursor: pointer;
}

.wall-post-btn-icon:hover {
  background: #e9ecef;
  color: #000;
}

/* Upload Progress Bar */
.wall-upload-progress-container {
  display: none;
  width: 100%;
  height: 24px;
  background: #f0f0f0;
  border-radius: 0;
  overflow: hidden;
  position: absolute;
  bottom: 100%;
  left: 0;
  border: 1px solid #ddd;
  z-index: 100;
}

.wall-upload-cancel-btn {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  height: 18px;
  padding: 0 5px;
  font-size: 10px;
  line-height: 16px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 3px;
  border-radius: 0;
}

.wall-upload-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #3498db, #2980b9);
  transition: width 0.3s ease;
}

.wall-upload-progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 10px;
  font-weight: bold;
  color: #333;
  text-shadow: 0 0 2px #fff;
}

/* Media Buttons Group - Classic Style */
.wall-media-buttons {
  display: flex;
  gap: 2px;
  margin-bottom: 5px;
  background: #f0f0f0;
  padding: 2px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.wall-media-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 3px 5px;
  background-color: var(--unified-btn-bg, #2e2e2e);
  border: 1px solid transparent;
  border-radius: 2px;
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.1s;
}

.wall-media-btn:hover {
  background-color: var(--unified-btn-hover-bg, #e0e0e0);
  border-color: #bbb;
  color: #fff;
}

.wall-media-btn i {
  font-size: 12px;
  opacity: 0.8;
}

/* Empty State Styling */
.empty-state-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 300px;
  text-align: center;
  padding: 2rem;
}

.empty-state-icon {
  font-size: 4.5rem;
  color: #e9ecef;
  margin-bottom: 1rem;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.05);
}

.empty-state-text {
  font-size: 1.2rem;
  font-weight: bold;
  color: #6c757d;
  margin-bottom: 0.5rem;
}

.empty-state-subtext {
  font-size: 0.9rem;
  color: #adb5bd;
}
.wall-media-preview-container {
  display: none;
  margin-bottom: 8px;
  padding: 8px;
  background: #f9f9f9;
  border: 1px dashed #ccc;
  border-radius: 6px;
  position: relative;
}

.wall-media-preview-content {
  max-height: 150px;
  overflow: hidden;
  border-radius: 4px;
  margin-bottom: 8px;
  display: flex;
  justify-content: center;
  background: #000;
}

.wall-media-preview-content img,
.wall-media-preview-content video {
  max-width: 100%;
  max-height: 150px;
  object-fit: contain;
}

.wall-media-preview-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.wall-preview-btn {
  padding: 6px 16px;
  font-size: 13px;
  font-weight: bold;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s;
}

.wall-preview-btn-confirm {
  background: #27ae60;
  color: white;
  border-color: #219150;
}

.wall-preview-btn-confirm:hover {
  background: #219150;
}

.wall-preview-btn-cancel {
  background: #f8f9fa;
  color: #333;
  border-color: #ccc;
}

.wall-preview-btn-cancel:hover {
  background: #e9ecef;
}

/* YouTube Search Modal */
.yt-search-modal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 400px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 5px 25px rgba(0,0,0,0.3);
  z-index: 10000;
  padding: 15px;
  direction: rtl;
}

.yt-search-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
}

.yt-search-header h3 { margin: 0; font-size: 16px; }
.yt-close { cursor: pointer; font-size: 20px; color: #999; }

.yt-input-group {
  display: flex;
  gap: 5px;
  margin-bottom: 15px;
}

.yt-input {
  flex: 1;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  outline: none;
}

.yt-btn-search {
  padding: 8px 15px;
  background: #c0392b;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.yt-results {
  max-height: 250px;
  overflow-y: auto;
}

.yt-result-item {
  display: flex;
  gap: 10px;
  padding: 8px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  transition: background 0.2s;
}

.yt-result-item:hover { background: #f9f9f9; }
.yt-result-item.selected { background: #e8f4fd; border-color: #3498db; }

.yt-thumb {
  width: 80px;
  height: 45px;
  object-fit: cover;
  border-radius: 4px;
}

.yt-info {
  flex: 1;
  font-size: 13px;
  overflow: hidden;
}

.yt-title {
  font-weight: bold;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.yt-channel { font-size: 11px; color: #777; }

.yt-footer {
  margin-top: 15px;
  display: flex;
  justify-content: flex-end;
}

.yt-btn-send {
  padding: 8px 20px;
  background: #27ae60;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
}

.yt-btn-send:disabled { background: #ccc; cursor: not-allowed; }

.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 9999;
}

/* Media Placeholders */
.media-placeholder {
  position: relative;
  width: fit-content;
  max-width: 160px;
  white-space: nowrap;
  padding: 6px 12px;
  background: #f8f9fa;
  border-radius: 8px;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  overflow: hidden;
  border: 1px solid #e9ecef;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.media-placeholder:hover {
  border-color: #e67e22;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  transform: translateY(-2px);
}

.media-placeholder .placeholder-thumb {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.6) blur(1px);
  transition: all 0.3s ease;
}

.media-placeholder:hover .placeholder-thumb {
  filter: brightness(0.8) blur(0px);
  transform: scale(1.05);
}

.play-overlay {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: white;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}

.play-overlay i {
  font-size: 56px;
  color: #ff0000;
  margin-bottom: 12px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
  transition: transform 0.3s ease;
}

.media-placeholder:hover .play-overlay i {
  transform: scale(1.15);
}

.image-placeholder {
  background: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
}

.placeholder-icon {
  position: relative;
  z-index: 2;
  color: #e67e22;
  display: flex;
  align-items: center;
}

.placeholder-icon i {
  font-size: 20px;
}

.media-placeholder span {
  position: relative;
  z-index: 2;
  font-weight: 600;
  font-size: 15px;
  color: #2c3e50;
}

.media-revealed {
  background: transparent !important;
  border: none !important;
  height: auto !important;
  min-height: 0 !important;
  width: 100% !important;
  padding: 0 !important;
  display: block !important;
  cursor: default !important;
  transform: none !important;
  box-shadow: none !important;
  transition: none !important;
  overflow: visible !important;
  animation: fadeIn 0.4s ease-out;
}

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

.media-revealed .placeholder-thumb,
.media-revealed .play-overlay,
.media-revealed .placeholder-icon,
.media-revealed .yt-left-side,
.media-revealed .yt-right-side,
.media-revealed span {
  display: none !important;
}

/* Horizontal YouTube Placeholder - Classic Design */
.youtube-horizontal-placeholder {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 8px !important;
  padding: 4px 6px !important;
  margin: 4px 0 !important;
  background: #f1f1f1 !important;
  border: 1px solid #e0e0e0 !important;
  width: auto !important;
  max-width: 160px !important;
  cursor: pointer !important;
  direction: ltr !important;
}

.youtube-horizontal-placeholder:hover {
  background: #e9e9e9 !important;
  transform: none !important;
  box-shadow: none !important;
}

.yt-left-side {
  width: 52px !important;
  height: 52px !important;
  min-width: 52px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: #fff !important;
  border: 1px solid #ddd !important;
  border-radius: 8px !important;
  position: static !important;
  inset: auto !important;
  margin: 0 !important;
  flex: none !important;
  pointer-events: none !important;
}

.yt-left-side i {
  font-size: 30px !important;
  color: #ff0000 !important;
  background: transparent !important;
  padding: 0 !important;
  border-radius: 0 !important;
  line-height: 1 !important;
}

.yt-right-side {
  width: 80px !important;
  height: 60px !important;
  min-width: 80px !important;
  background: #000 !important;
  border: 1px solid #ccc !important;
  border-radius: 5px !important;
  overflow: hidden !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: relative !important;
  flex: none !important;
}

.yt-right-side .placeholder-thumb,
.placeholder-thumb {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
}

.yt-play-label {
  position: absolute !important;
  bottom: 6px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  background: rgba(0,0,0,0.65) !important;
  color: #fff !important;
  font-size: 11px !important;
  padding: 2px 8px !important;
  border-radius: 10px !important;
  display: inline-block !important;
  line-height: 1.4 !important;
}

.youtube-horizontal-placeholder::after {
  display: none !important;
}

.yt-search-container {
  background: #fff;
  position: relative; /* Added to allow absolute positioning of results */
}

.yt-search-input-wrap {
  position: relative;
  width: 100%;
}

.yt-search-input-wrap #yt-search-input {
  width: 100%;
  height: 36px;
  padding-right: 38px !important;
  padding-left: 38px !important;
  border-radius: 8px;
  font-size: 13px;
}

.yt-search-youtube-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #ff0000;
  font-size: 18px;
  z-index: 2;
  pointer-events: none;
}

.yt-search-btn-inline {
  position: absolute;
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 28px;
  border: none;
  background: transparent;
  color: #555;
  border-radius: 6px;
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.yt-search-btn-inline:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--main-ui-color, #962c3e);
}


.youtube-horizontal-placeholder.media-revealed {
  width: 100% !important;
  max-width: 100% !important;
  background-color: transparent !important;
  border: none !important;
  padding: 0 !important;
}

.message-image-preview {
  width: auto;
  max-width: 180px;
  max-height: 160px;
  object-fit: cover;
  cursor: pointer;
  display: block;
  margin-left: 0;
  margin-right: auto;
}

.quoted-media {
  display: block;
  margin-top: 5px;
}
.quoted-media img, .quoted-media video {
  max-width: 100%;
  max-height: 150px;
  border-radius: 4px;
}

@media (max-width: 420px) {
  .wall-post-content {
    gap: 4px;
  }

  .wall-post-actions-row {
    margin-left: 4px;
  }

  .youtube-horizontal-placeholder,
  .media-placeholder {
    max-width: 145px !important;
  }

  .message-image-preview {
    max-width: 145px;
    max-height: 140px;
  }
}

/* Overlay Image */
.sidebar-header, .classic-header, .voice-top-bar, .bottom-tabs-bar, .other-rooms-header, .room-box, .btn-send, .wall-post-btn-send, .tab-btn, .wall-media-btn, .chat-input-container, .btn-input-action, .room-user-count, .simple-setting-label {
  background-image: var(--overlay-image, none) !important;
  background-repeat: repeat;
  background-position: top left;
}

.classic-settings-container {
  display: flex;
  flex-direction: column;
}


.settings-avatar-margin {
  margin-left: 5px;
}

.settings-footer {
  padding: 10px;
  border-top: 1px solid #000;
  background: #eee;
}

.profile-header-bg-custom {
  border-radius: 0;
  overflow: hidden;
  position: relative;
}
.profile-header-classic-custom {
  position: relative;
  z-index: 2;
  background: var(--status-bg, #444444) !important;
}
.profile-avatar-container {
  position: relative;
  width: 24px;
  height: 24px;
}
.profile-avatar-header-custom {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}
.profile-header-frame-custom {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.profile-header-flag-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-left: 4px;
  min-width: 30px;
}
.profile-header-flag-custom {
  width: 20px;
  height: 14px;
  margin-bottom: 2px;
  border-radius: 1px;
}
.profile-header-id-custom {
  font-size: 10px;
  font-weight: 900;
  color: #fff;
  letter-spacing: 0.5px;
}
.profile-cover-custom {
  height: 160px;
  object-fit: cover;
}

/* --- Consolidated Styles from index.ejs --- */
:root {
  --primary-color: #0d6efd;
  --button-color: #0d6efd;
  --text-color: #000;
}
.btn-primary { background-color: var(--button-color) !important; border-color: var(--button-color) !important; }
.bg-dark { background-color: var(--primary-color) !important; }
.btn-outline-secondary:hover { background-color: #f8f9fa !important; color: inherit !important; }
.btn-outline-secondary:hover i { color: inherit !important; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}
.shake { animation: shake 0.2s ease-in-out 0s 2; }
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}
.pulse { animation: pulse 0.4s ease-in-out; }
.form-transition { transition: none !important; }
.hidden-form { opacity: 0; visibility: hidden; position: absolute; }
.visible-form { opacity: 1; visibility: visible; position: relative; }

/* Tab Buttons Styling */
.nav-tab-btn {
  padding: 8px 16px;
  border-radius: 20px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  color: #6c757d;
  transition: all 0.3s ease;
  border: 1px solid transparent;
}
.nav-tab-btn:hover {
  background-color: #f8f9fa;
  color: #333;
}
.nav-tab-btn.active {
  background-color: #0d6efd;
  color: #fff;
  border-color: #0d6efd;
  box-shadow: 0 4px 6px rgba(13, 110, 253, 0.2);
}

/* Input Focus Glow */
.form-control:focus {
  border-color: #0d6efd;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  width: 90%;
  max-width: 350px;
}
.custom-toast {
  background: #fff;
  border-right: 5px solid #dc3545;
  padding: 12px 15px;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideDown 0.3s ease-out;
  direction: rtl;
}
@keyframes slideDown {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
#adminModal .modal-content {
  border: none;
  border-radius: 0;
}
#adminModal .modal-body {
  background: #f8f9fa;
}
#createRoomModal .modal-header {
  border-top-left-radius: 0 !important;
  border-top-right-radius: 0 !important;
}
#admin-iframe {
  display: block;
  width: 100%;
  height: 100%;
}
/* Profile Actions Grid & Buttons */
.profile-actions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  padding: 1px;
  background: #cccccc;
  border-top: 1px solid #bbbbbb;
  direction: rtl;
}
.btn-profile-action {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 2px;
  height: 30px;
  background: #fdfdfd;
  border: none;
  border-radius: 0;
  color: #000;
  font-size: 14px;
  font-weight: bold;
  transition: all 0.2s;
  text-decoration: none !important;
  width: 100%;
  padding: 2px;
  text-align: center;
  line-height: 1.1;
  flex-wrap: nowrap;
}
.btn-profile-action:hover {
  background: #eeeeee;
}
.btn-profile-action i {
  font-size: 14px;
  color: #444;
}
.btn-likes {
  background: #ff4d4d !important;
  color: #fff !important;
}
.btn-likes i {
  color: #fff !important;
}
.btn-ignore {
  color: #ff4d4d !important;
}
.btn-ignore i {
  color: #ff4d4d !important;
}
.btn-report {
  color: #333 !important;
}
.btn-report i {
  color: #333 !important;
}
/* Classic Profile Header */
.profile-header-classic {
  background: #333;
  color: #fff;
  padding: 5px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #555;
}
.profile-header-info {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-grow: 1;
  justify-content: flex-start;

}
.profile-header-avatar {
  width: 24px;
  height: 24px;
  border-radius: 2px;
  object-fit: cover;
}
.profile-header-banner {
  height: 20px;
  width: auto;
}
.profile-header-topic {
  font-size: 15px;
  font-weight: bold;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.btn-close-classic {
  background: #ff4444;
  border: none;
  color: #fff;
  width: 24px;
  height: 24px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  cursor: pointer;
  font-size: 12px;
  transition: background 0.2s;
}
.btn-close-classic:hover {
  background: #cc0000;
}
/* Profile Status Box */
.profile-status-box {
  background: transparent;
  border: none;
  padding: 0;
  display: block;
  color: #000;
  font-size: 13px;
  border-radius: 0;
  margin-top: 0;
  width: 100%;
  text-align: center;
  font-weight: bold;
  line-height: 1.3;
}

.glass-status {
  background: var(--status-bg, rgba(0, 0, 0, 0.45)) !important;
  border-radius: 6px !important;
  padding: 3px 2px !important;
  color: #fff !important;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
  display: inline-block !important;
  max-width: 100%;
  word-wrap: break-word;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  font-size: 14px;
}
.profile-avatar-frame {
  background: var(--status-bg, rgba(0, 0, 0, 0.4));
  padding: 6px;
}

@media (max-width: 576px) {
  #userProfileModal .modal-dialog {
    margin: 15px auto;
    max-width: calc(100% - 30px);
  }
}
#userProfileModal .modal-sm {
  max-width: 340px;
}

/* Alert Dialogs & Notifications */
.alert-container {
  direction: rtl;
  font-family: var(--font-family);
}

.alert-header {
  background-size: cover;
  background-position: center;
  padding: 15px;
  border-radius: 8px 8px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  position: relative;
}

.alert-header-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.4);
  border-radius: 8px 8px 0 0;
}

.alert-sender-info {
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-sender-details {
  text-align: right;
}

.alert-sender-label {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: #2b3b4e;
  color: #fff;
  padding: 3px 25px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: bold;
  z-index: 10;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
  white-space: nowrap;
  border: 1px solid #000;
  text-shadow: none !important;
}

.alert-sender-name {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: bold;
  font-size: 15px;
  padding: 2px 8px;
  border-radius: 4px;
  text-shadow: none !important;
  -webkit-text-stroke: 0px !important;
}

.alert-container, .alert-container * {
  text-shadow: none !important;
  -webkit-text-stroke: 0px !important;
}

.alert-avatar-wrapper {
  z-index: 1;
}

.alert-avatar {
  width: 45px;
  height: 45px;
  border-radius: 8px;
  object-fit: cover;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.alert-body {
  background: #fff;
  padding: 20px;
  border: 1px solid #eee;
  border-top: none;
  border-radius: 0 0 8px 8px;
  text-align: right;
  font-size: 15px;
  color: #333;
  line-height: 1.6;
  word-break: break-word;
  min-height: 100px;
}

/* Send Alert Dialog (Classic/Simple) */
.send-alert-container, .send-alert-container * {
  text-shadow: none !important;
  -webkit-text-stroke: 0px !important;
}

.send-alert-container {
  font-family: var(--font-family);
}

.send-alert-header {
  background: #333;
  padding: 10px 15px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
  margin: -1.25em -1.6em 15px -1.6em;
  direction: ltr;
}

.send-alert-name {
  color: #fff !important;
  font-weight: bold;
  font-size: 16px;
  letter-spacing: 0.5px;
  text-shadow: none !important;
  -webkit-text-stroke: 0px !important;
}

.send-alert-avatar-wrapper {
  flex-shrink: 0;
}

.send-alert-avatar {
  width: 45px;
  height: 45px;
  border-radius: 4px;
  object-fit: cover;
  border: 1px solid #555;
}

.send-alert-body-label {
  direction: rtl;
  text-align: right;
  padding: 5px 0;
}

.send-alert-input-classic {
  border-color: #ccc !important;
  border-radius: 4px !important;
  min-height: 100px !important;
  direction: rtl !important;
}

/* Notification Item in Sidebar */
.sidebar-notification-item {
  background-size: cover;
  background-position: center;
  position: relative;
  border-bottom: 1px solid #eee;
  padding: 12px;
  min-height: 70px;
}

.sidebar-notification-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.3);
}

.sidebar-notification-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
}

.sidebar-notification-avatar {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid #fff;
  margin-left: 10px;
}

.sidebar-notification-sender {
  font-size: 13px;
  font-weight: bold;
  display: inline-block;
  padding: 0 5px;
  border-radius: 3px;
  margin-bottom: 4px;
}

.sidebar-notification-text {
  font-size: 13px;
  line-height: 1.4;
  word-break: break-word;
}

.sidebar-notification-time {
  font-size: 11px;
  align-self: flex-start;
}

/* Games Lobby */
.game-card {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.game-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  border-color: var(--primary-color, #007bff);
}

.game-icon-container {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 8px;
}

/* Ludo Board Styles */
.ludo-game-container {
  background: #f0f2f5;
  border-radius: 8px;
  min-height: 100%;
}

.ludo-board-wrapper {
  width: 100%;
  aspect-ratio: 1/1;
  background: #fff;
  border: 2px solid #333;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  position: relative;
  overflow: hidden;
}

.ludo-board-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.dice-container {
  width: 40px;
  height: 40px;
  background: #fff;
  border: 2px solid #333;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: bold;
}

.dice {
  width: 30px;
  height: 30px;
  background: white;
  border-radius: 4px;
  position: relative;
  box-shadow: inset 0 0 5px rgba(0,0,0,0.1);
}

/* Ludo Colors */
.ludo-red { fill: #ff4d4d; }
.ludo-green { fill: #2ecc71; }
.ludo-yellow { fill: #f1c40f; }
.ludo-blue { fill: #3498db; }
.ludo-white { fill: #ffffff; }
.ludo-border { stroke: #333; stroke-width: 0.5; }

.ludo-piece {
  cursor: pointer;
  transition: transform 0.2s ease;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,0.3));
}

.ludo-piece:hover {
  transform: scale(1.2);
}

.ludo-piece.can-move {
  animation: piece-bounce 0.6s infinite alternate;
}

@keyframes piece-bounce {
  from { transform: translateY(0); }
  to { transform: translateY(-5px); }
}

.ludo-piece-element {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  position: absolute;
  transform: translate(-50%, -50%);
  border: 2px solid #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
  z-index: 10;
  pointer-events: auto;
  cursor: default;
}

.ludo-piece-element.can-move {
  cursor: pointer;
  box-shadow: 0 0 10px var(--primary-color);
  animation: piece-pulse 1s infinite;
}

@keyframes piece-pulse {
  0% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.2); }
  100% { transform: translate(-50%, -50%) scale(1); }
}

.player-color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.active-turn {
  background-color: rgba(0, 123, 255, 0.1) !important;
  border-right: 3px solid #007bff !important;
}

.leaderboard-classic {
  border: 1.5px solid #dee2e6 !important;
  border-radius: 0;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.02);
}

.leaderboard-classic h6 {
  color: #495057;
  letter-spacing: 0.5px;
}

.leaderboard-classic .badge {
  font-size: 0.65rem;
  border-radius: 0;
}

.active-game-card:hover {
  transform: translateX(-2px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
}

.vs-badge-classic {
  box-shadow: 0 0 5px rgba(220, 53, 69, 0.3);
  z-index: 5;
  border: 1px solid rgba(255,255,255,0.5);
  text-shadow: 1px 1px 1px rgba(0,0,0,0.2);
}

.player-mini-profile img {
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.extra-small {
  font-size: 0.7rem !important;
}

.dice-face {
  font-size: 24px;
  font-weight: bold;
}

/* Stories Styles */
.stories-container {
  display: flex;
  overflow-x: auto;
  gap: 5px;
  padding: 10px;
  background: #f8f9fa;
  border-bottom: 1px solid #ddd;
  flex-shrink: 0;
}
.stories-container::-webkit-scrollbar {
  height: 4px;
}
.stories-container::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}
.story-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 3px solid #007bff;
  padding: 2px;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
}
.story-circle.viewed {
  border-color: #ccc;
}
.story-circle img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
.story-add-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 2px dashed #007bff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  color: #007bff;
  font-size: 24px;
  background: #fff;
  position: relative;
}

.story-add-btn img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.story-add-btn .plus-icon {
  position: absolute;
  bottom: 0;
  right: 0;
  background: #007bff;
  color: white;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  border: 2px solid #fff;
}
.story-modal-content {
  background: #000;
  color: #fff;
  height: 80vh;
  position: relative;
  border-radius: 15px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.story-progress-bar {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  height: 3px;
  z-index: 10;
  display: flex;
  gap: 5px;
}
.story-progress-segment {
  flex: 1;
  background: rgba(255,255,255,0.3);
  height: 100%;
  border-radius: 2px;
  overflow: hidden;
}
.story-progress-fill {
  width: 0%;
  height: 100%;
  background: #fff;
}
.story-progress-segment.active .story-progress-fill {
  animation: storyProgress linear forwards;
}
.story-progress-segment.completed .story-progress-fill {
  width: 100%;
}
@keyframes storyProgress {
  from { width: 0%; }
  to { width: 100%; }
}
.story-media {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.story-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 24px;
  text-align: center;
  width: 90%;
  word-wrap: break-word;
}
.story-header {
  position: absolute;
  top: 20px;
  left: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  z-index: 10;
}
.story-header .story-user-avatar {
  height: 30px;
  width: 30px;
  border-radius: 50%;
  margin-left: 10px;
}

.story-header .story-super-icon {
  height: 18px;
  width: auto;
  margin-left: 4px;
  vertical-align: middle;
}
.story-viewers-btn {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.5);
  border: none;
  color: #fff;
  padding: 5px 15px;
  border-radius: 20px;
  cursor: pointer;
  z-index: 10;
}
.story-nav-btn {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 30%;
  z-index: 5;
  cursor: pointer;
}
.story-nav-btn.left { left: 0; }
.story-nav-btn.right { right: 0; }

/* Story Viewers List */
#story-viewers-list {
  position: absolute;
  bottom: 70px;
  left: 0;
  right: 0;
  height: 40%;
  background: #f8f9fa;
  color: #333;
  padding: 15px;
  z-index: 20;
  overflow-y: auto;
  transition: transform 0.3s ease-out;
  transform: translateY(100%);
  border-top: 1px solid #dee2e6;
}

.story-super-icon {
  height: 18px;
  width: auto;
  margin-left: 6px;
  vertical-align: middle;
}

#story-viewers-list.show {
  transform: translateY(0);
}

.story-viewer-item {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  padding: 8px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.story-viewer-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-left: 16px;
  object-fit: cover;
}

.story-viewer-name {
  font-weight: 500;
  margin-left: 10px;
  font-size: var(--font-size) !important;
  font-family: var(--font-family) !important;
}

.story-viewer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.story-viewer-title {
  margin: 0;
  font-weight: bold;
}

/* Mic Context Menu - Dark Modern Design (Matching Image) */
.mic-context-menu {
  position: fixed;
  background: #333333;
  border: 1px solid #444444;
  border-radius: 4px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.5);
  z-index: 10000;
  min-width: 120px;
  padding: 5px;
  margin: 0;
  font-family: var(--font-family);
  animation: fadeInClassic 0.1s ease-out;
  direction: rtl;
  transform: translateX(-50%) !important;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

@keyframes fadeInClassic {
  from { opacity: 0; transform: translate(-50%, -10px) !important; }
  to { opacity: 1; transform: translate(-50%, 0) !important; }
}

.mic-context-menu .menu-item {
  padding: 12px 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: background 0.2s;
  color: #ffffff;
  font-size: 14px;
  font-weight: bold;
  background: #444444;
  border: 1px solid #555555;
  text-align: center;
}

.mic-context-menu .menu-item:hover {
  background: #555555;
}

.mic-context-menu .menu-item i {
  font-size: 14px;
  color: #bbb;
}

.mic-context-menu .menu-item:hover i {
  color: #ffffff;
}

.mic-context-menu .menu-item.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #333333;
  color: #888888;
  border-color: #444444;
}

.mic-context-menu .menu-item.disabled:hover {
  background: #333333;
  color: #888888;
}

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

.mic-context-menu .menu-item.danger:hover {
  background: #cc0000;
  color: #ffffff;
}

.mic-context-menu .menu-divider {
  height: 1px;
  background: #555555;
  margin: 2px 0;
}

.mic-context-menu .menu-volume {
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
}

.mic-context-menu .menu-volume i {
  color: #ffffff;
  font-size: 14px;
}

.mic-context-menu .menu-volume input[type="range"] {
  flex: 1;
  height: 6px;
  cursor: pointer;
  accent-color: #007bff;
  background: #555;
  border-radius: 3px;
  appearance: none;
}

.mic-context-menu .menu-volume input[type="range"]::-webkit-slider-runnable-track {
  background: #555;
  height: 6px;
  border-radius: 3px;
}

.mic-context-menu .menu-volume input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 14px;
  height: 14px;
  background: #007bff;
  border-radius: 50%;
  margin-top: -4px;
}

/* Mic Mute Status */
.mic-mute-status {
  position: absolute;
  background: #dc3545ab;
  color: #ffffff;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 10px;
  border: 2px solid white;
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.btn-mic {
  position: relative;
}

.current-music-title {
  text-align: center;
  font-weight: bold;
  margin-bottom: 1rem;
  padding: 0 10px;
  font-size: 14px;
  color: #333;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}

/* Toggle Switch Styles */
.classic-settings-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border: 1px solid #ced4da;
  border-radius: 4px;
  padding: 8px 12px;
  margin-bottom: 2px;
}

.classic-settings-toggle-row .toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #333;
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  margin: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
}

input:checked + .slider {
  background-color: #28a745;
}

input:focus + .slider {
  box-shadow: 0 0 1px #28a745;
}

input:checked + .slider:before {
  transform: translateX(20px);
}

.slider.round {
  border-radius: 24px;
}

.slider.round:before {
  border-radius: 50%;
}


/* Private Chat Message Styles */
/* إصلاح تمدد نص الرسائل الخاصة بدون تغيير اتجاه الاسم والرسالة */
.private-msg-item {
  display: flex;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
  padding: 0;
  margin-bottom: 0;
  border-radius: 0;
  background-color: #fff;
  border-bottom: 1px solid #eee;
  position: relative;
  transition: background-color 0.2s;
  box-sizing: border-box;
  overflow: hidden;
  direction: rtl; /* مهم حتى تبقى الصورة يسار والأزرار يمين */
}

/* هذا هو العمود الذي كان حاجز 60px على يمين الرسالة */
.private-msg-item > .d-flex.flex-column.align-items-start.justify-content-between.p-2 {
  position: absolute !important;
  top: 4px;
  right: 4px;
  bottom: 4px;
  width: auto !important;
  min-width: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  z-index: 5;
  pointer-events: none;
}

/* نخلي الأزرار قابلة للضغط رغم أن العمود صار absolute */
.private-msg-item > .d-flex.flex-column.align-items-start.justify-content-between.p-2 .private-msg-actions,
.private-msg-item > .d-flex.flex-column.align-items-start.justify-content-between.p-2 button {
  pointer-events: auto;
}

/* جسم الرسالة يأخذ كل العرض المتاح */
.private-msg-body {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  text-align: left;
  direction: ltr;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  padding: 8px 10px 8px 8px !important;
  box-sizing: border-box;
  overflow: hidden;
}

/* الاسم يبقى يسار */
.private-msg-header {
  width: 100%;
  max-width: 100%;
  margin-bottom: 4px;
  box-sizing: border-box;
  text-align: left;
  direction: ltr;
  overflow: hidden;
}

.private-msg-username {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  box-sizing: border-box;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
  text-align: left;
  direction: ltr;
}

/* النص يعبّي العرض ولا يطلع خارج النافذة */
.private-msg-text {
  display: block;
  width: 100%;
  max-width: 100%;
  font-size: 15.2px !important;
  line-height: 1.4;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-align: left;
  direction: ltr;
  unicode-bidi: plaintext;
  box-sizing: border-box;
}

/* الصورة تبقى ثابتة وما تضغط النص */
.private-msg-avatar {
  width: 50px;
  height: 50px;
  min-width: 50px;
  flex-shrink: 0;
  object-fit: cover;
  cursor: pointer;
}

.private-msg-time {
  font-size: 0.7rem;
  white-space: nowrap;
}

.private-msg-quote {
  width: 100%;
  max-width: 100%;
  background: rgba(0,0,0,0.03);
  border-right: 3px solid #3498db;
  padding: 4px 8px;
  margin-bottom: 6px;
  font-size: 0.85rem;
  border-radius: 2px;
  box-sizing: border-box;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-align: left;
  direction: ltr;
}

.private-msg-audio {
  width: 100%;
  max-width: 100%;
  background: #f8f9fa;
  padding: 5px;
  border-radius: 8px;
  border: 1px solid #eee;
  margin-top: 4px;
  box-sizing: border-box;
}

.private-msg-file {
  width: 100%;
  max-width: 100%;
  align-self: stretch;
  margin-top: 4px;
  box-sizing: border-box;
}

/* حماية للجوال */
@media (max-width: 576px) {
  .private-msg-body {
    padding: 6px 8px !important;
  }

  .private-msg-text {
    font-size: 14.5px !important;
  }
}
/* =========================================
   Bot Mode UI Styles
   ========================================= */
.bot-mode-bar-custom {
  background-color: var(--main-ui-color);
  font-family: var(--font-family);
  font-size: var(--font-size);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 -3px 15px rgba(0, 0, 0, 0.4);
  transition: all 0.3s ease;
  z-index: 1040;
  border-radius: 0 !important;
}

.bot-mode-label {
  font-weight: var(--font-weight);
  font-size: var(--font-size);
}

.bot-mode-select-custom {
  background-color: rgba(0, 0, 0, 0.3) !important;
  color: #fff !important;
  font-family: var(--font-family) !important;
  font-size: var(--font-size) !important;
  font-weight: var(--font-weight) !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  min-width: 100px;
}
.bot-mode-select-custom option {
  color: #000;
  font-family: var(--font-family) !important;
  font-size: var(--font-size) !important;
}

.bot-mode-toggle-label {
  font-family: var(--font-family) !important;
  font-size: var(--font-size) !important;
  font-weight: var(--font-weight) !important;
  color: #fff;
  border-color: rgba(255,255,255,0.4);
  background: rgba(0,0,0,0.2);
}

.btn-check:checked + .bot-mode-toggle-label {
  background-color: #fff !important;
  color: #000 !important;
  border-color: #fff !important;
}

.bot-mode-change-btn {
  font-size: 0.75rem;
  opacity: 0.9;
  background-color: rgba(255,255,255,0.2);
  border: none;
  color: white;
}
.bot-mode-change-btn i {
  color: white !important;
}
.bot-mode-change-btn:hover {
  background-color: rgba(255,255,255,0.4);
}

.bot-mode-close {
  font-size: 0.6rem;
  opacity: 0.8;
}
.bot-mode-close:hover {
  opacity: 1;
}

/* Sidebar Settings Scroll Fixes */
#sidebar-settings-container {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  overscroll-behavior: contain;
  scrollbar-gutter: auto;
}

/* Sidebar Wall Scroll Fixes (Fixed input form) */
#sidebar-wall-container:not(.d-none) {
  overflow: hidden !important; /* Prevent total tab scroll */
  display: flex !important;
  flex-direction: column !important;
}

.wall-container {
  background-color: #fff;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  font-family: var(--font-family) !important;
  position: relative;
  overflow: hidden;
}

/* Custom scrollbar for Wall Posts inside the fixed container */
.wall-posts-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto !important;
  overflow-x: hidden;
  padding: 0;
  scrollbar-gutter: stable;
  position: relative;
  margin-top: 2px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.25) transparent;
}

.wall-posts-list::-webkit-scrollbar {
  width: 4px !important;
  display: block !important;
}
.wall-posts-list::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05) !important;
}
.wall-posts-list::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.2) !important;
  border-radius: 10px !important;
}
.wall-posts-list::-webkit-scrollbar-thumb:hover {
  background-color: rgba(0, 0, 0, 0.4) !important;
}

/* YouTube Search Results - Classic Style */
#yt-results-container {
    max-height: 220px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #dee2e6;
    border-top: none;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.25) transparent;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

#yt-results-container::-webkit-scrollbar {
    width: 4px;
}

#yt-results-container::-webkit-scrollbar-track {
    background: transparent;
}

#yt-results-container::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.yt-result-item {
    transition: all 0.2s ease;
    border-bottom: 1px solid #f1f1f1;
    display: flex;
    align-items: center;
    padding: 8px;
    direction: rtl; /* Right to left for Arabic */
}

.yt-result-item:hover {
    background-color: #f8f9fa;
}

.yt-result-item img {
    width: 60px;
    height: 45px;
    object-fit: cover;
    border-radius: 3px;
    margin-left: 10px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.yt-result-item .video-info {
    flex: 1;
    min-width: 0;
    text-align: right;
}

.yt-result-item .video-title {
    font-size: 11px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
  background-color: rgba(0, 0, 0, 0.25) !important;
  border-radius: 10px !important;
}
.wall-posts-list::-webkit-scrollbar-thumb:hover {
  background-color: rgba(0, 0, 0, 0.4) !important;
}

/* Custom scrollbar solely for the settings container */
#sidebar-settings-container::-webkit-scrollbar {
  width: 6px;
}
#sidebar-settings-container::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
}
#sidebar-settings-container::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
}

/* Prevent inner settings container from shrinking */
#sidebar-settings-container > .classic-settings-container {
  display: block !important;
  min-height: max-content !important;
  height: auto !important;
}

/* Camera Viewer System */
.camera-viewer-window {
  position: fixed;
  top: 100px;
  right: 20px;
  width: 320px;
  max-width: 90vw;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  z-index: 99999 !important;
  overflow: hidden;
  border: 1px solid #ccc;
  display: flex;
  flex-direction: column;
}

.camera-window-header {
  background: #333;
  color: #fff;
  padding: 8px 12px;
  cursor: move;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}

.camera-window-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  margin: 0;
}

/* Camera pulsing animation */
@keyframes camera-pulse {
  0% { transform: scale(1); opacity: 0.8; color: #ff0000; }
  50% { transform: scale(1.2); opacity: 1; color: #ff4d4d; }
  100% { transform: scale(1); opacity: 0.8; color: #ff0000; }
}

.camera-sidebar-icon.active {
  animation: camera-pulse 1.5s infinite ease-in-out;
  color: #ff0000 !important;
}

.camera-window-body {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  background: #000;
  display: block;
}

.camera-window-body video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.camera-loading {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.camera-sidebar-icon {
  margin-right: auto;
  margin-left: 8px;
  cursor: pointer;
  transition: transform 0.2s;
  font-size: 14px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  background: transparent;
  color: #555;
}

.camera-sidebar-icon:hover {
  transform: scale(1.1);
  background: transparent;
  color: #222;
}

@media (max-width: 576px) {
  .camera-viewer-window {
    top: 50px;
    right: 50%;
    transform: translateX(50%);
  }
}

/* RTL Adjustments for Sidebar User Item */
.user-pro-item .camera-sidebar-icon,
.list-group-item .camera-sidebar-icon {
    margin-right: auto;
    margin-left: 8px;
}

/* Remove chat input focus effects */
#chat-input,
#chat-input:hover,
#chat-input:focus,
#chat-input:active,
#private-chat-input,
#private-chat-input:hover,
#private-chat-input:focus,
#private-chat-input:active,
.chat-input-field,
.chat-input-field:hover,
.chat-input-field:focus,
.chat-input-field:active {
  outline: none !important;
  box-shadow: none !important;
  border-color: #ced4da !important;
  height: 38px !important;
  resize: none !important;
  overflow-y: auto !important;
}

#chat-form:focus-within,
.chat-input-area:focus-within,
.message-input-area:focus-within {
  outline: none !important;
  box-shadow: none !important;
}

/* Profile Image Lightbox */
.profile-image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(0, 0, 0, 0.75);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.profile-image-lightbox.active {
  display: flex;
}

.profile-image-lightbox img {
  max-width: min(90vw, 520px);
  max-height: 85vh;
  border-radius: 18px;
  object-fit: contain;
  background: #fff;
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.45);
  animation: profileZoomIn 0.22s ease;
}

.profile-lightbox-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  color: #111;
  font-size: 30px;
  line-height: 42px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

@keyframes profileZoomIn {
  from {
    transform: scale(0.88);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

#reportUserModal {
  z-index: 1300 !important;
}

#reportUserModal .modal-dialog {
  max-width: 420px;
  margin: auto;
}

#reportUserModal .modal-content {
  border: 1px solid #b5b5b5;
  border-radius: 6px !important;
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(0,0,0,0.35);
  background: #fff;
}

#reportUserModal .modal-header {
  background: var(--main-ui-color, #8b1e2d) !important;
  color: #fff;
  padding: 8px 12px;
}

#reportUserModal .modal-title {
  font-size: 14px;
}

#reportUserModal .modal-body {
  background: #f7f7f7 !important;
  padding: 14px;
}

#reportUserModal textarea {
  resize: none;
  min-height: 90px;
  font-size: 13px;
  border: 1px solid #bbb;
}

#reportUserModal .modal-footer {
  background: #eee;
  padding: 10px;
  border-top: 1px solid #ccc;
}

#reportUserModal #btn-submit-report {
  background: var(--main-ui-color, #8b1e2d) !important;
  border: none;
}

@media (max-width: 576px) {
  #reportUserModal .modal-dialog {
    max-width: calc(100% - 24px);
  }
}

/* Admin Report Notification Styles */
.admin-report-alert {
  text-align: right;
  font-size: 13px;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-report-alert .report-alert-summary {
  background: #f7f7f7;
  border: 1px solid #ccc;
  padding: 8px;
  border-radius: 4px;
}

.admin-report-alert .report-alert-section {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.admin-report-alert .report-alert-reason {
  background: #fff;
  border: 1px solid #ccc;
  padding: 8px;
  border-radius: 4px;
  min-height: 45px;
  max-height: 100px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.admin-report-alert .report-alert-image {
  max-width: 240px;
  max-height: 160px;
  object-fit: contain;
  border: 1px solid #ccc;
  padding: 2px;
  background: #fff;
  border-radius: 4px;
}

/* Shortcuts Tooltip */
.shortcut-text {
  cursor: help;
}

.message-text img.smiley-img,
.message-text img.sticker-img {
    max-width: 18px !important;
    cursor: default !important;
}

/* Profile Badge System */
.profile-badges {
  display: none;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 6px 4px;
  background: #f7f7f7;
  border-bottom: 1px solid #ddd;
  background: #444444;
  border-radius: 5px;
  margin: 3px;
}

.profile-badge {
  width: 55px;
  height: 55px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #aaa;
  font-size: 25px;
  filter: grayscale(1);
  opacity: 0.45;
  transition: all 0.2s ease;
}

.profile-badge.active {
  filter: grayscale(0);
  opacity: 1;
  color: #fff;
  transform: scale(1.05);
}

.profile-badge.locked {
  filter: grayscale(1);
  opacity: 0.35;
}

.room-description-text-big {
  font-size: 0.8rem !important;
}

.room-description-text-small {
  font-size: 0.7rem !important;
}

/* ستايل أسماء وحالات قائمة المتواجدين فقط */
#sidebar-users-wrapper #sidebar-users-container .user-sidebar-name,
#sidebar-users-wrapper #sidebar-users-container .user-sidebar-name span,
#sidebar-users-wrapper #sidebar-users-container .user-sidebar-status {
  font-family: serif !important;
  font-size: clamp(14.4px, 3.8vw, 15.2px) !important;
  font-weight: 700 !important;
  text-shadow: none !important;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

#sidebar-users-wrapper #sidebar-users-container .user-sidebar-name {
  line-height: 1.4 !important;
}

#sidebar-users-wrapper #sidebar-users-container .user-sidebar-status {
  line-height: 1.5 !important;
  opacity: 0.9;
  margin-top: 0;
}

/* حتى لا تضغط الأعلام والرقم على الاسم في الجوال */
#sidebar-users-wrapper #sidebar-users-container .list-group-item {
  min-width: 0;
}

#sidebar-users-wrapper #sidebar-users-container .list-group-item > .flex-grow-1 {
  min-width: 0 !important;
}

/* تصغير خفيف جدًا على الشاشات الصغيرة */
@media (max-width: 380px) {
  #sidebar-users-wrapper #sidebar-users-container .user-sidebar-name,
  #sidebar-users-wrapper #sidebar-users-container .user-sidebar-name span,
  #sidebar-users-wrapper #sidebar-users-container .user-sidebar-status {
    font-size: 14.2px !important;
  }
}

/* Ensure no hand cursor on user cards */
.js-user-profile-btn,
.list-group-item,
.user-pro-item,
.user-sidebar-name,
.user-sidebar-status {
  cursor: default !important;
}

.js-user-profile-btn img {
  cursor: default !important;
}

/* Custom Modal Fonts */
.site-font-modal,
.site-font-modal-content,
.site-font-modal * {
  font-family: var(--font-family) !important;
}

/* Mentions System */
.mentions-picker-container {
  position: absolute;
  bottom: 80px;
  right: 20px;
  width: 250px;
  max-height: 200px;
  background: white;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-shadow: 2px 2px 10px rgba(0,0,0,0.1);
  z-index: 1000;
  overflow-y: auto;
  padding: 4px 0;
  display: flex;
  flex-direction: column;
}

.mention-item {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  gap: 10px;
  cursor: pointer !important;
  transition: background 0.2s;
  font-size: 14px;
}

.mention-item:hover, .mention-item.active {
  background: #f0f7ff;
}

.mention-item img {
  width: 24px;
  height: 24px;
  border-radius: 0;
  object-fit: cover;
  pointer-events: none;
  border: 1px solid #eee;
}

.mention-item .nickname {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  color: #333;
}

.mention-highlight {
  color: #007bff;
  font-weight: bold;
  cursor: pointer;
}

/* Chat Input relative container */
.chat-input-wrapper {
  position: relative;
}

/* ==================================================
   Mobile Keyboard Fix - Chat Input
   CSS only - لا يؤثر على الكمبيوتر
================================================== */
/* ==================================================
   Mobile Keyboard Fix
   الهدف:
   - إبقاء شريط المايكات ظاهر
   - إبقاء صندوق الكتابة ظاهر فوق الكيبورد
   - إخفاء التبويبات السفلية فقط وقت الكتابة
   - لا يؤثر على الكمبيوتر
================================================== */
@media (max-width: 768px), (hover: none), (pointer: coarse) {

  html,
  body,
  #app,
  #chat-shell,
  #chat-ui {
    height: 100dvh !important;
    min-height: 100dvh !important;
    max-height: 100dvh !important;
    overflow: hidden !important;
  }

  #chat-shell,
  #chat-ui {
    display: flex !important;
    flex-direction: column !important;
  }

  /* شريط المايكات يبقى ظاهر ولا يختفي */
  .voice-top-bar {
    display: flex !important;
    flex: 0 0 auto !important;
    min-height: 45px !important;
    max-height: 75px !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    z-index: 100 !important;
  }

  /* منطقة الرسائل تأخذ المساحة المتبقية فقط */
  #messages-container {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: auto !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
  }

  /* صندوق الكتابة يبقى ثابت داخل ترتيب الصفحة فوق الكيبورد */
  .chat-input-container {
    flex: 0 0 auto !important;
    position: relative !important;
    bottom: auto !important;
    z-index: 1200 !important;
    width: 100% !important;
    padding: 4px !important;
    padding-bottom: max(4px, env(safe-area-inset-bottom)) !important;
    background-color: var(--chat-input-bg, #f8f9fa) !important;
  }

  #chat-form {
    width: 100% !important;
    min-width: 0 !important;
  }

  #chat-input,
  #private-chat-input,
  .chat-input-field {
    font-size: 16px !important;
    height: 38px !important;
    min-height: 38px !important;
    max-height: 90px !important;
    line-height: 1.35 !important;
    resize: none !important;
  }

  /* عند فتح الكيبورد نخفي التبويبات السفلية فقط */
  #chat-ui:has(#chat-input:focus) .bottom-tabs-bar,
  #chat-ui:has(.chat-input-field:focus) .bottom-tabs-bar,
  body:has(#chat-input:focus) .bottom-tabs-bar,
  body:has(.chat-input-field:focus) .bottom-tabs-bar {
    display: none !important;
  }

  /* لا نخفي المايكات وقت الكتابة */
  #chat-ui:has(#chat-input:focus) .voice-top-bar,
  #chat-ui:has(.chat-input-field:focus) .voice-top-bar,
  body:has(#chat-input:focus) .voice-top-bar,
  body:has(.chat-input-field:focus) .voice-top-bar {
    display: flex !important;
  }

  /* السايدبار لو مفتوح وقت الكتابة لا يترك فراغ التبويبات */
  body:has(#chat-input:focus) .sidebar-container,
  body:has(.chat-input-field:focus) .sidebar-container {
    bottom: 0 !important;
  }
}
