/* Theme Variables */
:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f0f2f5;
  --bg-tertiary: #e9ecef;
  --bg-chat: #efeae2;
  --text-primary: #111b21;
  --text-secondary: #667781;
  --border-color: #e9edef;
  --card-bg: #ffffff;
  --card-border: #25d366;
  --info-bg: #d9fdd3;
  --info-border: #25d366;
  --message-out-bg: #d9fdd3;
  --message-in-bg: #ffffff;
  --header-bg: #f0f2f5;
  --accent-color: #25d366;
  --accent-hover: #20b858;
  --avatar-size: 32px;
}

/* Dark Theme - WhatsApp Dark Mode Colors */
body.theme-dark {
  --bg-primary: #111b21;
  --bg-secondary: #202c33;
  --bg-tertiary: #2a3942;
  --bg-chat: #0b141a;
  --text-primary: #e9edef;
  --text-secondary: #8696a0;
  --border-color: #2a3942;
  --card-bg: #202c33;
  --card-border: #25d366;
  --info-bg: #025144;
  --info-border: #25d366;
  --message-out-bg: #005c4b;
  --message-in-bg: #202c33;
  --header-bg: #202c33;
  --accent-color: #25d366;
  --accent-hover: #20b858;
}

/* ============================================
   COLOR PALETTES
   ============================================ */

/* Default Green (WhatsApp-like) - already defined in :root */

/* Blue Palette (Telegram-like) */
body.palette-blue {
  --accent-color: #0088cc;
  --accent-hover: #0077b5;
  --card-border: #0088cc;
  --info-bg: #e3f2fd;
  --info-border: #0088cc;
  --message-out-bg: #e3f2fd;
}
body.theme-dark.palette-blue {
  --accent-color: #64b5f6;
  --accent-hover: #42a5f5;
  --card-border: #64b5f6;
  --info-bg: #1a3a52;
  --info-border: #64b5f6;
  --message-out-bg: #1a3a52;
}

/* Purple Palette (Discord-like) */
body.palette-purple {
  --accent-color: #7289da;
  --accent-hover: #5b6eae;
  --card-border: #7289da;
  --info-bg: #ede7f6;
  --info-border: #7289da;
  --message-out-bg: #ede7f6;
}
body.theme-dark.palette-purple {
  --accent-color: #9c7cff;
  --accent-hover: #8a6ef5;
  --card-border: #9c7cff;
  --info-bg: #2d2547;
  --info-border: #9c7cff;
  --message-out-bg: #2d2547;
}

/* Orange Palette (Warm) */
body.palette-orange {
  --accent-color: #ff6b35;
  --accent-hover: #e55a27;
  --card-border: #ff6b35;
  --info-bg: #fff3e0;
  --info-border: #ff6b35;
  --message-out-bg: #fff3e0;
}
body.theme-dark.palette-orange {
  --accent-color: #ffab91;
  --accent-hover: #ff8a65;
  --card-border: #ffab91;
  --info-bg: #3e2723;
  --info-border: #ffab91;
  --message-out-bg: #3e2723;
}

/* Pink Palette (Messenger-like) */
body.palette-pink {
  --accent-color: #e91e63;
  --accent-hover: #c2185b;
  --card-border: #e91e63;
  --info-bg: #fce4ec;
  --info-border: #e91e63;
  --message-out-bg: #fce4ec;
}
body.theme-dark.palette-pink {
  --accent-color: #f48fb1;
  --accent-hover: #f06292;
  --card-border: #f48fb1;
  --info-bg: #3e1a2e;
  --info-border: #f48fb1;
  --message-out-bg: #3e1a2e;
}

/* Teal Palette (Calm) */
body.palette-teal {
  --accent-color: #009688;
  --accent-hover: #00796b;
  --card-border: #009688;
  --info-bg: #e0f2f1;
  --info-border: #009688;
  --message-out-bg: #e0f2f1;
}
body.theme-dark.palette-teal {
  --accent-color: #4db6ac;
  --accent-hover: #26a69a;
  --card-border: #4db6ac;
  --info-bg: #1a3f3c;
  --info-border: #4db6ac;
  --message-out-bg: #1a3f3c;
}

/* Import Google Fonts - Segoe UI fallback similar to WhatsApp */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  height: 100vh;
  overflow: hidden;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  transition: background-color 0.3s ease, color 0.3s ease;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Toast Notification Styles - Bootstrap 5 Native Toast */
/* z-index 1055 is above Bootstrap's default modal z-index (1050) to ensure toasts appear above modals */
.toast-container {
  z-index: 1055;
  max-width: 350px;
  overflow: hidden;
  right: 0 !important;
}

.toast {
  min-width: 250px;
  max-width: calc(100vw - 2rem);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  word-break: break-word;
}

/* Desktop toast positioning fix - prevent overflow */
@media (min-width: 768px) {
  .toast-container {
    max-width: 350px;
    margin-right: 1rem;
  }
  
  .toast {
    max-width: 350px;
  }
}

.toast .toast-header {
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}

.toast .toast-body {
  color: var(--text-primary);
}

/* Dark theme toast adjustments */
body.theme-dark .toast {
  background-color: var(--bg-primary);
  border-color: var(--border-color);
}

body.theme-dark .toast .toast-header {
  background-color: var(--bg-secondary);
}

/* ============================================
   WHATSAPP-LIKE CHAT STYLES
   ============================================ */

/* Chat Container - WhatsApp doodle background */
#messagesContainer {
  background-color: var(--bg-chat);
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23c9d8cd' fill-opacity='0.15'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  padding: 20px 40px !important;
}

body.theme-dark #messagesContainer {
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23182229' fill-opacity='0.3'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* Message bubbles - WhatsApp style */
#messagesContainer .card {
  border: none;
  border-radius: 8px;
  box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13);
  max-width: 65%;
  margin-bottom: 8px;
  background-color: var(--message-in-bg);
  position: relative;
}

#messagesContainer .card::before {
  content: '';
  position: absolute;
  top: 0;
  width: 8px;
  height: 13px;
}

/* Outgoing message style (right side) */
#messagesContainer .card.message-out {
  margin-left: auto;
  background-color: var(--message-out-bg);
}

#messagesContainer .card.message-out::before {
  right: -8px;
  border-left: 8px solid var(--message-out-bg);
  border-top: 0;
  border-bottom: 8px solid transparent;
}

/* Incoming message style (left side) */
#messagesContainer .card.message-in::before {
  left: -8px;
  border-right: 8px solid var(--message-in-bg);
  border-top: 0;
  border-bottom: 8px solid transparent;
}

#messagesContainer .card .card-body {
  padding: 6px 8px 8px 9px;
}

#messagesContainer .card .card-text {
  font-size: 14.2px;
  line-height: 19px;
  color: var(--text-primary);
  word-wrap: break-word;
}

/* Message time - WhatsApp style bottom right */
#messagesContainer .message-time {
  font-size: 11px;
  color: var(--text-secondary);
  float: right;
  margin-left: 12px;
  margin-top: 3px;
}

/* System message - WhatsApp style center bubble */
#messagesContainer .alert-info {
  background-color: rgba(255, 255, 255, 0.9);
  color: var(--text-secondary);
  border: none;
  border-radius: 7.5px;
  font-size: 12.5px;
  text-align: center;
  max-width: 85%;
  margin: 8px auto;
  box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13);
  padding: 6px 12px;
  font-style: normal;
}

body.theme-dark #messagesContainer .alert-info {
  background-color: rgba(32, 44, 51, 0.95);
}

/* Header - WhatsApp style */
.chat-header, .border-bottom {
  background-color: var(--header-bg) !important;
}

/* Message input area - WhatsApp style */
.message-input-container {
  background-color: var(--header-bg) !important;
  padding: 10px 16px !important;
}

.message-input-container .form-control {
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 15px;
  background-color: var(--bg-primary);
  border-color: var(--border-color);
  color: var(--text-primary);
}

.message-input-container .form-control:focus {
  box-shadow: none;
  border-color: var(--accent-color);
}

.message-input-container .btn-primary {
  background-color: var(--accent-color);
  border-color: var(--accent-color);
  border-radius: 50%;
  width: 42px;
  height: 42px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.message-input-container .btn-primary:hover {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
}

/* Message avatar styling */
.message-avatar {
  width: var(--avatar-size);
  height: var(--avatar-size);
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  overflow: hidden;
}

/* Ensure avatar images are circular */
.message-avatar img,
img.message-avatar {
  width: var(--avatar-size);
  height: var(--avatar-size);
  border-radius: 50%;
  object-fit: cover;
}

/* Message sender name styling */
.message-sender {
  font-size: 13px;
  color: var(--accent-color) !important;
}

/* ============================================
   SKELETON LOADING STYLES
   ============================================ */

.skeleton-message {
  display: flex;
  margin-bottom: 12px;
  animation: pulse 1.5s ease-in-out infinite;
}

.skeleton-message.skeleton-out {
  justify-content: flex-end;
}

.skeleton-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-secondary) 50%, var(--bg-tertiary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  margin-right: 8px;
  flex-shrink: 0;
}

.skeleton-bubble {
  border-radius: 8px;
  padding: 12px 16px;
  max-width: 65%;
  background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-secondary) 50%, var(--bg-tertiary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.skeleton-bubble.skeleton-in {
  background-color: var(--message-in-bg);
}

.skeleton-bubble.skeleton-out-bubble {
  background-color: var(--message-out-bg);
}

.skeleton-line {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--border-color) 50%, var(--bg-tertiary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  margin-bottom: 6px;
}

.skeleton-line:last-child {
  margin-bottom: 0;
  width: 60%;
}

.skeleton-line.skeleton-short {
  width: 40%;
}

.skeleton-line.skeleton-medium {
  width: 70%;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* ============================================
   DEMO MESSAGES (When no channel selected)
   ============================================ */

.demo-messages-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 20px;
}

.demo-messages-info {
  text-align: center;
  margin-bottom: 30px;
  color: var(--text-secondary);
}

.demo-messages-info h5 {
  color: var(--text-primary);
  margin-bottom: 10px;
}

.demo-messages-wrapper {
  width: 100%;
  max-width: 600px;
  overflow: hidden;
}

.demo-message {
  animation: slideIn 0.5s ease-out forwards;
  opacity: 0;
  transform: translateY(20px);
}

/* Animation delays are now set dynamically via inline styles in JavaScript
   to support any number of demo messages */

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

/* Delete button in message */
.delete-msg-btn {
  opacity: 0.6;
  font-size: 11px !important;
  vertical-align: middle;
}

.delete-msg-btn:hover {
  opacity: 1;
}

/* Settings Button with Icon */
#settingsBtn i {
  font-size: 1.1rem;
}

/* Modal Enhancements */
.modal.show {
  backdrop-filter: blur(3px);
}

.modal-content {
  border-radius: 0.5rem;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.3);
}

.form-switch .form-check-input {
  width: 3rem;
  height: 1.5rem;
}

.form-switch .form-check-input:checked {
  background-color: #0d6efd;
}

/* Responsive Design */
@media (max-width: 576px) {
  .toast-container {
    max-width: 100%;
    left: 0;
    right: 0;
    padding: 0.5rem;
  }
  
  .toast {
    min-width: 100%;
    max-width: 100%;
  }
  
  #messagesContainer {
    height: calc(100vh - 180px) !important;
  }
  
  /* Mobile header improvements */
  #roomTitle {
    font-size: 1rem;
  }
}

/* Mobile: Full height chat */
@media (max-width: 768px) {
  html, body {
    height: 100%;
    overflow: hidden;
  }
  
  .container-fluid {
    padding: 0;
  }
}

/* Room Sidebar Styles */
.room-item {
  transition: background-color 0.2s ease;
  border-color: var(--border-color);
}

.room-item:hover {
  background-color: var(--bg-tertiary);
}

.room-item.active {
  background-color: var(--info-bg);
  border-left: 4px solid var(--card-border);
}

.room-item .badge {
  font-size: 0.7rem;
  padding: 0.25rem 0.5rem;
}

/* ============================================
   MOBILE BOTTOM NAVIGATION BAR
   ============================================ */

.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background-color: var(--bg-primary);
  border-top: 1px solid var(--border-color);
  z-index: 1000;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.mobile-bottom-nav .nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.mobile-bottom-nav .nav-item i {
  font-size: 1.5rem;
  margin-bottom: 2px;
}

.mobile-bottom-nav .nav-item:active {
  background-color: var(--bg-tertiary);
}

.mobile-bottom-nav .nav-item.active {
  color: #0d6efd;
}

.mobile-bottom-nav .nav-item .badge {
  position: absolute;
  top: 5px;
  right: 25%;
  font-size: 0.6rem;
  padding: 2px 5px;
}

/* Mobile sidebar overlay */
.mobile-sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-sidebar-overlay.show {
  opacity: 1;
}

/* Responsive Sidebar */
@media (max-width: 768px) {
  /* Show bottom nav on mobile */
  .mobile-bottom-nav {
    display: flex;
  }
  
  /* Hide desktop sidebar by default */
  .col-md-3 {
    position: fixed;
    top: 0;
    left: -100%;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    z-index: 1001;
    transition: left 0.3s ease;
    background-color: var(--bg-primary);
    border-right: 1px solid var(--border-color);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
  }
  
  /* Show sidebar when active */
  .col-md-3.mobile-sidebar-open {
    left: 0;
  }
  
  /* Show overlay when sidebar is open */
  .mobile-sidebar-overlay.show {
    display: block;
  }
  
  /* Full width chat area */
  .col-md-9 {
    flex: 0 0 100%;
    max-width: 100%;
  }
  
  /* Adjust chat area for bottom nav */
  #messagesContainer {
    height: calc(100vh - 200px) !important;
  }
  
  /* Adjust message input container */
  .message-input-container {
    position: fixed;
    bottom: 60px;
    left: 0;
    right: 0;
    background-color: var(--bg-primary);
    z-index: 100;
    padding: 10px 15px !important;
    border-top: 1px solid var(--border-color);
  }
}

/* Sidebar scrollbar styling */
#roomSidebarContainer {
  scrollbar-width: thin;
  scrollbar-color: var(--text-secondary) var(--bg-secondary);
}

#roomSidebarContainer::-webkit-scrollbar {
  width: 6px;
}

#roomSidebarContainer::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

#roomSidebarContainer::-webkit-scrollbar-thumb {
  background: var(--text-secondary);
  border-radius: 3px;
}

#roomSidebarContainer::-webkit-scrollbar-thumb:hover {
  background: var(--text-primary);
}

/* Additional theme styles */
.border-end {
  border-color: var(--border-color) !important;
}

.border-bottom {
  border-color: var(--border-color) !important;
}

.border-top {
  border-color: var(--border-color) !important;
}

.bg-light {
  background-color: var(--bg-secondary) !important;
}

.text-muted {
  color: var(--text-secondary) !important;
}

.card-subtitle {
  color: var(--text-secondary) !important;
}

/* Language Selector Positioning */

/* Dark theme modal styles */
body.theme-dark .modal-content {
  background-color: var(--bg-primary);
  color: var(--text-primary);
}

body.theme-dark .modal-header {
  border-bottom-color: var(--border-color);
}

body.theme-dark .modal-footer {
  border-top-color: var(--border-color);
}

body.theme-dark .form-control {
  background-color: var(--bg-secondary);
  border-color: var(--border-color);
  color: var(--text-primary);
}

body.theme-dark .form-control:focus {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  border-color: #0d6efd;
}

body.theme-dark .btn-close {
  filter: invert(1);
}

/* ============================================
   VERSION DISPLAY & UPDATE NOTIFICATION
   ============================================ */

/* Version display in bottom-left corner */
.version-display {
  user-select: none;
  pointer-events: none;
}

/* Update notification banner (WhatsApp-style) */
.update-banner {
  position: fixed;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #25d366;
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1060;
  transition: top 0.3s ease-out;
  min-width: 300px;
  max-width: 500px;
}

.update-banner.show {
  top: 20px;
}

.update-banner-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.update-banner-text {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.update-banner-text i {
  font-size: 1.2rem;
  animation: rotate 2s linear infinite;
}

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

.update-banner-button {
  background-color: white;
  color: #25d366;
  border: none;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 20px;
  cursor: pointer;
  transition: background-color 0.2s;
  white-space: nowrap;
}

.update-banner-button:hover {
  background-color: #f0f0f0;
  color: #25d366;
}

/* Dark theme adjustments for version display */
body.theme-dark .version-display {
  color: var(--text-secondary) !important;
}

/* Mobile responsive */
@media (max-width: 576px) {
  .update-banner {
    min-width: calc(100% - 40px);
    max-width: calc(100% - 40px);
    left: 20px;
    right: 20px;
    transform: none;
  }
  
  .update-banner-content {
    flex-direction: column;
    gap: 10px;
  }
  
  .update-banner-button {
    width: 100%;
  }
}

/* ============================================
   LANDING PAGE STYLES
   ============================================ */

/* Override body overflow for landing page */
body.landing-page {
  overflow-y: auto;
  overflow-x: hidden;
  height: auto;
  -webkit-overflow-scrolling: touch;
}

/* Also override html overflow when landing page is active */
html:has(body.landing-page) {
  overflow-y: auto;
  overflow-x: hidden;
  height: auto;
}

/* ============================================
   CONTENT PAGE STYLES (About, Privacy, Terms)
   ============================================ */

/* Override body overflow for content pages */
body.content-page {
  overflow-y: auto;
  overflow-x: hidden;
  height: auto;
  -webkit-overflow-scrolling: touch;
}

/* Also override html overflow when content page is active */
html:has(body.content-page) {
  overflow-y: auto;
  overflow-x: hidden;
  height: auto;
}

/* Hero Section */
.hero-section {
  background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
  background-size: 400% 400%;
  animation: gradientAnimation 15s ease infinite;
  color: white;
  position: relative;
  overflow: hidden;
}

@keyframes gradientAnimation {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.3;
  z-index: 0;
}

/* Semi-transparent overlay for better text readability */
.hero-section::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.25);
  z-index: 0;
  pointer-events: none; /* Allow clicks through the overlay */
}

/* Top controls container for language and theme toggle */
.hero-controls {
  position: relative;
  z-index: 2;
}

.hero-content {
  position: relative;
  z-index: 1;
  /* Add backdrop blur and background for better readability */
  background: rgba(0, 0, 0, 0.2);
  padding: 2rem;
  border-radius: 1rem;
  backdrop-filter: blur(5px);
}

.hero-title {
  text-shadow: 2px 2px 8px rgba(0,0,0,0.5);
  animation: fadeInUp 0.8s ease-out;
  color: white;
}

.hero-subtitle {
  text-shadow: 1px 1px 6px rgba(0,0,0,0.4);
  color: rgba(255, 255, 255, 0.95) !important;
}

.hero-text {
  color: rgba(255, 255, 255, 0.9) !important;
  text-shadow: 1px 1px 4px rgba(0,0,0,0.3);
}

.hero-section .lead {
  text-shadow: 1px 1px 4px rgba(0,0,0,0.25);
  color: rgba(255, 255, 255, 0.95);
}

.hero-section .text-muted {
  color: rgba(255, 255, 255, 0.85) !important;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.2);
}

/* Dark mode toggle in hero section */
.hero-section .form-check-input {
  cursor: pointer;
}

.hero-section .form-check-input:checked {
  background-color: #25d366;
  border-color: #25d366;
}

.hero-section .form-select {
  background-color: rgba(255, 255, 255, 0.9);
  border: none;
  font-weight: 500;
}

.hero-section .form-select:focus {
  box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.25);
}

.min-vh-50 {
  min-height: 50vh;
}

/* Features Section */
.features-section {
  padding: 80px 0;
}

.feature-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.feature-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.15) !important;
}

.feature-icon i {
  animation: fadeIn 0.6s ease-out;
}

/* CTA Section */
.cta-section {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
  color: white;
  padding: 80px 0;
}

.cta-section h2,
.cta-section .lead {
  text-shadow: 1px 1px 3px rgba(0,0,0,0.2);
}

/* Landing Footer */
.landing-footer {
  background-color: #212529 !important;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.landing-footer p {
  font-size: 0.9rem;
}

.landing-footer #versionNumber {
  font-weight: 600;
  color: #ffffff;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* Button Enhancements */
.btn-lg {
  font-weight: 600;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 20px rgba(13, 110, 253, 0.4);
}

.btn-outline-secondary {
  transition: all 0.3s ease;
}

.btn-outline-secondary:hover {
  transform: translateY(-2px);
}

/* Utility color classes */
.text-purple {
  color: #6f42c1;
}

/* Dark theme adjustments for landing page */
body.theme-dark .hero-section {
  background: linear-gradient(-45deg, #1a1a2e, #16213e, #0f3460, #1a1a2e);
  background-size: 400% 400%;
  animation: gradientAnimation 15s ease infinite;
}

body.theme-dark .features-section {
  background-color: var(--bg-secondary);
}

body.theme-dark .feature-card {
  background-color: var(--card-bg);
  color: var(--text-primary);
}

body.theme-dark .cta-section {
  background: linear-gradient(135deg, #e94057 0%, #8a2387 100%);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .hero-section {
    padding: 40px 0;
  }
  
  .hero-title {
    font-size: 2rem;
  }
  
  .features-section {
    padding: 60px 0;
  }
  
  .cta-section {
    padding: 60px 0;
  }
  
  .display-3 {
    font-size: 2.5rem;
  }
}

/* ============================================
   LANGUAGE SELECTOR POSITIONING
   ============================================ */


/* ============================================
   SIDEBAR TAB STYLES
   ============================================ */

/* Tab button styles */
#roomSidebarContainer .btn {
  transition: all 0.2s ease;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.75rem 0.5rem;
}

#roomSidebarContainer .btn-link {
  color: var(--text-secondary);
  text-decoration: none;
  border-bottom: 3px solid transparent;
}

#roomSidebarContainer .btn-link:hover {
  color: var(--text-primary);
  background-color: var(--bg-tertiary);
}

#roomSidebarContainer .btn-primary {
  border-bottom: 3px solid #0d6efd;
}

/* Badge on unread count */
#roomSidebarContainer .badge {
  font-size: 0.7rem;
  padding: 0.25rem 0.5rem;
  vertical-align: middle;
}

/* Room and message items hover */
.room-item:hover,
#roomSidebarContainer .p-3:hover,
.user-item:hover {
  background-color: var(--bg-tertiary);
}

/* User item styling */
.user-item {
  transition: background-color 0.2s ease;
}

.user-item .min-w-0 {
  min-width: 0;
}

/* Responsive tab buttons for mobile */
@media (max-width: 768px) {
  #roomSidebarContainer .btn {
    font-size: 0.8rem;
    padding: 0.5rem 0.25rem;
  }
  
  #roomSidebarContainer .btn i {
    font-size: 0.9rem;
  }
}

/* ============================================
   ADMIN DASHBOARD STYLES
   ============================================ */

/* Fix scroll issue in admin panel - use class-based approach for better browser compatibility */
html:has(body.admin-page),
html.admin-page-html {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  height: auto !important;
}

body.admin-page {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  height: auto !important;
  min-height: 100vh;
}

.admin-dashboard {
  min-height: 100vh;
  padding-bottom: 2rem;
}

/* Admin stats cards */
.admin-stat-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border-left: 4px solid var(--accent-color);
}

.admin-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.admin-stat-card .stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent-color);
}

.admin-stat-card .stat-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Admin table styles */
.admin-table {
  font-size: 0.9rem;
}

.admin-table th {
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
}

/* Admin action buttons */
.admin-action-btn {
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
}

/* Room management form */
.room-form-card {
  border: 2px dashed var(--border-color);
  background-color: var(--bg-secondary);
}

/* Dark theme adjustments for admin panel */
body.theme-dark .admin-stat-card {
  background-color: var(--card-bg);
}

body.theme-dark .room-form-card {
  background-color: var(--bg-tertiary);
}
