/* Theme Variables */
:root {
  --bg-color: #f5f6fa;
  --surface: #ffffff;
  --text-primary: #222;
  --text-secondary: #888;
  --border: #e5e5e5;
  --accent: #007bff;
  --accent-text: #fff;
  --danger: #ff4757;
}

[data-theme="dark"] {
  --bg-color: #121212;
  --surface: #1e1e1e;
  --text-primary: #f5f5f5;
  --text-secondary: #aaa;
  --border: #333;
  --accent: #007bff;
  --accent-text: #000;
}

/* Global Reset Cleanup */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}

body {
  background: var(--bg-color);
  color: var(--text-primary);
  transition: background 0.3s ease;
}

/* Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.logo {
  display: flex;
  align-items: center;
  font-size: 18px;
  font-weight: bold;
  gap: 6px;
}
.search-bar {
  flex: 1;
  margin: 0 15px;
  position: relative;
}
.search-bar input {
  width: 100%;
  padding: 8px 35px 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-color);
  color: var(--text-primary);
}
.search-bar input:focus {
  outline: none;
  border-color: var(--accent);
}
.search-bar i {
  position: absolute;
  right: 10px;
  top: 8px;
  color: var(--text-secondary);
}
.header-icons i {
  font-size: 20px;
  margin-left: 10px;
  cursor: pointer;
}

/* Filters Bar */
.filters-bar {
  display: flex;
  gap: 10px;
  padding: 10px 15px;
  overflow-x: auto;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  -ms-overflow-style: none; /* IE and Edge */
  scrollbar-width: none; /* Firefox */
}
.filters-bar::-webkit-scrollbar {
  display: none;
}
.filter-chip {
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-color);
  white-space: nowrap;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-primary);
}
.filter-chip.active {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
}

/* Sticky Filter Chips */
.filters-bar {
  position: sticky;
  top: 52px;
  z-index: 100;

  /* Ensure horizontal scrolling still works for the chips themselves */
  display: flex;
  overflow-x: auto;
  -ms-overflow-style: none; /* IE and Edge */
  scrollbar-width: none; /* Firefox */
}

/* Hide scrollbar for Chrome, Safari and Opera */
.filters-chips::-webkit-scrollbar {
  display: none;
}

.filter-chip#openFiltersBtn {
  position: sticky;
  right: 0;
  z-index: 2;
}

/* Layout & Views */
.view {
  display: none;
  padding-bottom: 80px;
}
.view.active {
  display: block;
}

/* Products Grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  padding: 15px;
}
@media (min-width: 768px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (min-width: 1200px) {
  .products-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

.product-card {
  background: var(--surface);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
}
.product-image {
  position: relative;
}
.product-image img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
}
.fav-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--danger);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
.product-info {
  padding: 12px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
.product-info h3 {
  font-size: 14px;
  margin: 0 0 5px 0;
  font-weight: 500;
}
.price {
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--accent);
}

/* Buttons */
.buy-btn {
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}
.buy-btn:active {
  opacity: 0.7;
}
.buy-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Bottom Nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-around;
  padding: 10px 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 900;
}
.nav-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  cursor: pointer;
  text-decoration: none;
}
.nav-btn.active {
  color: var(--accent);
}
.nav-btn i {
  font-size: 20px;
}

/* Modals & Bottom Sheets */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.bottom-sheet {
  position: fixed;
  bottom: -100%;
  left: 0;
  width: 100%;
  max-height: 85vh;
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  z-index: 1000;
  transition: bottom 0.3s cubic-bezier(0.1, 0.8, 0.2, 1);
  padding: 20px;
  display: flex;
  flex-direction: column;
}
.bottom-sheet.active {
  bottom: 0;
}
.sheet-handle {
  width: 40px;
  height: 5px;
  background: var(--border);
  border-radius: 5px;
  margin: 0 auto 15px auto;
  cursor: pointer;
}
.modal-content {
  overflow-y: auto;
  padding: 15px;
}

@media (min-width: 768px) {
  .bottom-sheet {
    width: 450px;
    top: 50%;
    left: 50%;
    border-radius: 20px;
    transform: translate(-50%, -50%);
    height: fit-content;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
  }
  .bottom-sheet.active {
    opacity: 1;
    pointer-events: auto;
  }
}

/* Forms inside Modals */
.form-input {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-color);
  color: var(--text-primary);
  font-size: 14px;
}
.form-input:focus {
  outline: none;
  border-color: var(--accent);
}

/* Toast Notifications - Moved higher to avoid bottom nav overlap */
.toast-container {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 90%;
  max-width: 400px;
}
.toast {
  background: #323232;
  color: #fff;
  padding: 12px 24px;
  border-radius: 50px;
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0;
  transform: translateY(20px);
  animation: slideUpFade 0.3s forwards, fadeOut 0.3s 2.7s forwards;
  text-align: center;
}

@keyframes slideUpFade {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes fadeOut {
  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}

/* Skeletons */
.loading-sentinel {
  text-align: center;
  padding: 20px;
  color: var(--text-secondary);
  width: 100%;
  grid-column: 1 / -1;
}
.skeleton {
  background: linear-gradient(
    90deg,
    var(--border) 25%,
    var(--bg-color) 50%,
    var(--border) 75%
  );
  background-size: 200% 100%;
  animation: skeletonLoading 1.5s infinite;
  border-radius: 8px;
}
@keyframes skeletonLoading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}
.skeleton-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--border);
}
.skeleton-img {
  width: 100%;
  aspect-ratio: 1/1;
  border-radius: 8px;
}
.skeleton-text {
  height: 14px;
  width: 80%;
}
.skeleton-price {
  height: 18px;
  width: 40%;
  margin-top: 5px;
}

/* Misc Details */
.top-tabs {
  display: flex;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.top-tabs::-webkit-scrollbar {
  display: none;
}
.top-tab {
  flex: 1;
  min-width: 80px;
  text-align: center;
  padding: 12px 10px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
}
.top-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.contact-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
}
.contact-btn:hover {
  background: var(--bg-color);
}
.contact-btn.chat-btn {
  background: var(--accent);
  color: var(--accent-text);
  border: none;
}

/* Vendor Cards */
.vendor-card {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px;
  background: var(--surface);
  border-radius: 12px;
  margin-bottom: 15px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  cursor: pointer;
}
.vendor-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  background: #eee;
  border: 1px solid var(--border);
}

/* Theme Toggle Switch */
.theme-switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
}
.theme-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.theme-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border);
  transition: 0.3s;
  border-radius: 24px;
}
.theme-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
input:checked + .theme-slider {
  background-color: var(--accent);
}
input:checked + .theme-slider:before {
  transform: translateX(22px);
}

/* Post Actions (Ellipsis) */
.post-options-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-primary);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  z-index: 10;
}
[data-theme="dark"] .post-options-btn {
  background: var(--surface);
}

/* Custom Dialog Box */
.dialog-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dialog-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.dialog-box {
  background: var(--surface);
  width: 90%;
  max-width: 350px;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  transform: translateY(20px);
  transition: transform 0.2s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}
.dialog-overlay.active .dialog-box {
  transform: translateY(0);
}
.dialog-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}
.dialog-btn {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}
.dialog-btn.cancel {
  background: var(--bg-color);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.dialog-btn.confirm {
  background: var(--danger);
  color: white;
}

/* =========================================
   PROFILE UX IMPROVEMENTS
   ========================================= */
.profile-header-card {
  text-align: center;
  padding: 30px 20px;
  background: var(--surface);
  border-radius: 16px;
  border: 1px solid var(--border);
  margin-bottom: 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.profile-avatar-wrapper {
  position: relative;
  display: inline-block;
}

.profile-avatar-wrapper img {
  width: 100px;
  height: 100px;
  aspect-ratio: 1/1;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent);
  padding: 3px;
  background: var(--bg-color);
}

.profile-menu-group {
  background: var(--surface);
  border-radius: 16px;
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 20px;
}

.profile-menu-item {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  cursor: pointer;
  transition: background 0.2s ease;
  border-bottom: 1px solid var(--border);
}
.profile-menu-item:last-child {
  border-bottom: none;
}
.profile-menu-item:hover {
  background: var(--bg-color);
}

.profile-menu-item .menu-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--bg-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-right: 15px;
  color: var(--accent);
}

.profile-menu-item .menu-text {
  flex: 1;
  font-weight: 500;
  font-size: 15px;
  color: var(--text-primary);
}

.profile-menu-item .menu-arrow {
  color: var(--text-secondary);
  font-size: 20px;
}

.logout-btn-clean {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 12px;
  background: rgba(255, 71, 87, 0.1);
  color: var(--danger);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.2s ease;
}
.logout-btn-clean:hover {
  background: rgba(255, 71, 87, 0.2);
}

/* --- BADGES & COUNTERS --- */
.nav-badge {
  position: absolute;
  top: 2px;
  right: 25%;
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 10px;
  border: 2px solid var(--surface);
  line-height: 1;
}
.menu-badge {
  background: var(--danger);
  color: white;
  font-size: 12px;
  font-weight: bold;
  padding: 2px 8px;
  border-radius: 12px;
  margin-right: 10px;
}

/* --- CHAT LIST --- */
.chat-list-item {
  display: flex;
  align-items: center;
  padding: 15px;
  background: var(--surface);
  border-radius: 12px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: 0.2s;
}
.chat-list-item:hover {
  background: var(--bg-color);
}
.chat-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 15px;
  border: 1px solid var(--border);
}
.chat-list-info {
  flex: 1;
  overflow: hidden;
}
.chat-list-name {
  margin: 0 0 5px;
  font-size: 15px;
  font-weight: 600;
}
.chat-list-snippet {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-list-meta {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}
.chat-time {
  font-size: 11px;
  color: var(--text-secondary);
}
.unread-dot {
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: 50%;
}

/* --- CHAT MESSAGES --- */
.chat-bubble {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.4;
  word-wrap: break-word;
  position: relative;
}
.chat-bubble.sent {
  background: var(--accent);
  color: var(--accent-text);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.chat-bubble.received {
  background: var(--bg-color);
  color: var(--text-primary);
  border: 1px solid var(--border);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.chat-meta {
  font-size: 10px;
  opacity: 0.7;
  margin-top: 5px;
  text-align: right;
  display: block;
}
.chat-bubble img {
  max-width: 100%;
  border-radius: 8px;
  margin-bottom: 5px;
}
.chat-bubble .attachment {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.1);
  padding: 8px;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
}

/* --- CHAT INPUT AREA --- */
.chat-input-area {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 10px 15px;
  gap: 10px;
  z-index: 1000;
}
#chatMessageInput {
  flex: 1;
  padding: 12px 15px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-color);
  color: var(--text-primary);
  outline: none;
}
#chatMessageInput:focus {
  border-color: var(--accent);
}
.chat-attach-btn {
  background: none;
  border: none;
  font-size: 22px;
  color: var(--text-secondary);
  cursor: pointer;
}
.chat-send-btn {
  background: var(--accent);
  color: var(--accent-text);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
}

/* =========================================
   CHAT BUBBLE WRAPPERS & CONTEXT MENUS
   ========================================= */
.chat-bubble-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  max-width: 85%;
}
.chat-bubble-wrapper.sent {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.chat-bubble-wrapper.received {
  align-self: flex-start;
}
.chat-bubble-wrapper .chat-bubble {
  max-width: 100%; /* Overrides the previous 80% limit since the wrapper constrains it */
}

/* 3-Dot Options Menu Button */
.chat-bubble-menu-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: none; /* Hidden by default */
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  flex-shrink: 0;
  transition: 0.2s;
}
.chat-bubble-menu-btn:hover {
  background: var(--bg-color);
  color: var(--text-primary);
}

/* Show menu on hover (Desktop) or keep visible on touch screens */
@media (hover: hover) {
  .chat-bubble-wrapper:hover .chat-bubble-menu-btn {
    display: flex;
  }
}
@media (hover: none) {
  .chat-bubble-menu-btn {
    display: flex;
    background: transparent;
    border: none;
    box-shadow: none;
    opacity: 0.6;
  }
}

/* Context Menu Dropdown */
.chat-context-menu {
  position: absolute;
  top: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  z-index: 100;
  display: none;
  flex-direction: column;
  min-width: 140px;
  overflow: hidden;
  margin-top: 5px;
}
.chat-bubble-wrapper.sent .chat-context-menu {
  right: 0;
}
.chat-bubble-wrapper.received .chat-context-menu {
  left: 0;
}

[data-theme="dark"] .chat-context-menu {
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.chat-context-item {
  padding: 12px 15px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
  transition: background 0.2s;
}
.chat-context-item:hover {
  background: var(--bg-color);
}
.chat-context-item.danger {
  color: var(--danger);
}

/* --- SEARCH VIEW SPECIFICS --- */
.recent-search-chip {
  padding: 8px 15px;
  background: var(--bg-color);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: background 0.2s ease;
}
.recent-search-chip:hover {
  background: var(--surface);
  border-color: var(--accent);
}
.recent-search-chip i {
  color: var(--text-secondary);
  font-size: 14px;
}
#searchFilterBtn:active {
  background: var(--border) !important;
}

input,
select,
textarea {
  width: 100%;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-color);
  color: var(--text-primary);
  resize: none;
}

/* Promo Badge */
.promo-badge {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: linear-gradient(45deg, #f1c40f, #f39c12);
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: bold;
  z-index: 5;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Promo Selection Packages */
.promo-voucher {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 15px;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: 0.2s;
}
.promo-voucher:hover {
  background: rgba(254, 202, 87, 0.1);
  border-color: #f39c12;
}
.promo-voucher h4 {
  margin: 0;
  font-size: 15px;
  color: var(--text-primary);
}
.promo-voucher p {
  margin: 0;
  font-size: 14px;
  font-weight: bold;
  color: #f39c12;
}

/* --- Image Carousel for Posts --- */
.post-carousel {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  gap: 10px;
  -ms-overflow-style: none; /* IE and Edge */
  scrollbar-width: none; /* Firefox */
}
.post-carousel::-webkit-scrollbar {
  display: none;
}
.post-carousel .carousel-item {
  flex: 0 0 100%;
  scroll-snap-align: start;
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  border-radius: 12px;
  background: var(--bg-color);
}
.carousel-hint {
  text-align: center;
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.enter-sections:not(:empty) {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
}

.enter-sections button {
  width: 100% !important;
  text-align: center !important;
  justify-content: center !important;
}
.separator {
  color: var(--text-secondary);
  width: 100%;
  text-align: center;
  padding: 15px 0;
}
.enter-sections:empty + .separator {
  display: none !important;
}

.XaID_IframesContainer {
  z-index: 9000 !important;
}

/* =========================================
   AUTH MODAL UX IMPROVEMENTS
   ========================================= */
   .auth-separator {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 20px 0;
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
  }
  .auth-separator::before,
  .auth-separator::after {
    content: "";
    flex: 1;
    border-bottom: 1px solid var(--border);
  }
  .auth-separator:not(:empty)::before { margin-right: 15px; }
  .auth-separator:not(:empty)::after { margin-left: 15px; }
  
  .input-group {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
  }
  .input-group .input-icon {
    position: absolute;
    left: 15px;
    color: var(--text-secondary);
    font-size: 18px;
    pointer-events: none; /* Prevents icon from blocking clicks */
  }
  .form-input {
    padding: 14px 15px;
    border-radius: 12px;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
    background: var(--bg-color);
    font-size: 15px;
  }
  .form-input.with-icon {
    padding-left: 45px;
  }
  .form-input.pr-40 {
    padding-right: 45px;
  }
  .form-input:focus {
    background: var(--surface);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
  }
  .password-toggle {
    position: absolute;
    right: 15px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 18px;
    padding: 5px;
    transition: color 0.2s;
  }
  .password-toggle:hover {
    color: var(--text-primary);
  }


/* =========================================
   DESKTOP & TABLET LAYOUT (768px and up)
   ========================================= */
@media (min-width: 768px) {
  /* Transform Bottom Nav into a Left Sidebar */
  .bottom-nav {
    top: 0;
    left: 0;
    bottom: auto;
    height: 100vh;
    width: 80px; /* Mini aside width */
    flex-direction: column;
    justify-content: center;
    padding-top: 20px;
    border-top: none;
    border-right: 1px solid var(--border);
    background: var(--surface);
    z-index: 1000;
  }

  .nav-btn {
    flex: none;
    width: 100%;
    padding: 20px 0;
    margin-bottom: 5px;
    border-radius: 0; /* Remove any mobile rounding */
  }

  .nav-btn i {
    font-size: 24px;
    margin-bottom: 6px;
  }

  .nav-btn span {
    font-size: 11px;
    display: block; /* Ensure text drops below icon */
  }

  .app-header {
    left: 80px;
    width: calc(100% - 80px);
  }

  #app {
    margin-left: 80px;
    padding-bottom: 40px; /* Remove the heavy bottom padding from mobile */
    min-height: 100vh;
  }

  .search-bar {
    max-width: 400px;
    margin: 0 auto; /* Center it */
  }
}

/* Desktop overrides for chats */
@media (min-width: 768px) {
  body:has(#chat-details.active) #app {
    margin-left: 0px !important;
  }

  body:has(#chat-details.active) .app-header {
    left: 0px !important;
    width: 100% !important;
  }
}
