/* styles.css */
/* Modern white background and black text theme with improved aesthetics */
:root {
  --bg-color: #ffffff;
  --text-color: #1a1a1a;
  --accent-color: #212529;
  --input-bg: #f8f9fa;
  --input-border: #ced4da;
  --message-user-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --message-bot-bg: rgba(255, 255, 255, 0.8);
  --sidebar-bg: #f8f9fa;
  --sidebar-border: #e9ecef;
  --border-radius: 16px;
  --sidebar-width: 280px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1), 0 0 20px rgba(102, 126, 234, 0.1);
  --header-height: 48px;
  --input-height: 60px;
  --welcome-bg: linear-gradient(to bottom, #e0f7fa 0%, #ffffff 50%);
  --bottom-nav-height: 60px;
  --futuristic-glow: 0 0 10px rgba(102, 126, 234, 0.3);
}
/* Reset and global styles */
* {
  box-sizing: border-box;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  margin: 0;
  padding: 0;
  height: 100dvh;
  overflow: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
/* Modern input styles */
.modern-input {
  background-color: #ffffff;
  border: 2px solid #e1e5e9;
  border-radius: var(--border-radius);
  color: var(--text-color);
  padding: 0.75rem 1rem;
  width: 100%;
  font-size: 1rem;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.modern-input:focus {
  outline: none;
  border-color: var(--accent-color);
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(33, 37, 41, 0.1);
  transform: translateY(-1px);
}
.modern-input:hover {
  border-color: #b8c2cc;
}
.modern-select {
  background-color: #ffffff;
  border: 2px solid #e1e5e9;
  border-radius: var(--border-radius);
  color: var(--text-color);
  padding: 0.75rem 1rem;
  width: 100%;
  font-size: 1rem;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.75rem center;
  background-repeat: no-repeat;
  background-size: 1rem;
}
.modern-select:focus {
  outline: none;
  border-color: var(--accent-color);
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(33, 37, 41, 0.1);
  transform: translateY(-1px);
}
.modern-select:hover {
  border-color: #b8c2cc;
}
/* Login Section */
.login-container {
  min-height: 100dvh;
  width: 100%;
  background-color: var(--bg-color);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
}
.login-card {
  background: var(--bg-color);
  border: 1px solid var(--input-border);
  border-radius: var(--border-radius);
  max-width: 500px;
  width: 90%;
  box-shadow: var(--shadow-md);
  padding: 1.5rem !important;
  margin: 1rem auto;
}
.login-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-color);
}
.form-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-color);
}
.form-input,
.form-select {
  background-color: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--border-radius);
  color: var(--text-color);
  padding: 0.5rem 0.75rem;
  width: 100%;
  font-size: 0.9rem;
}
.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 0.2rem rgba(33, 37, 41, 0.25);
}
.signup-text a {
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 500;
}
.signup-text a:hover {
  text-decoration: underline;
}
.auth-error {
  margin-top: 0.5rem;
  font-size: 0.85rem;
}
.small-text {
  font-size: 0.7rem;
  color: gray;
  margin-top: 0.25rem;
}
.required {
  color: red;
}
/* Register buttons in login-card */
.login-card .btn-dark {
  background-color: var(--accent-color);
  border-color: var(--accent-color);
  color: white !important;
  font-weight: 500;
  padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius);
  transition: all 0.2s ease;
}
.login-card .btn-dark:hover {
  background-color: #000;
  border-color: #000;
  transform: scale(1.02);
}
.login-card .btn-dark:focus {
  outline: none;
  box-shadow: 0 0 0 0.2rem rgba(33, 37, 41, 0.25);
}
.login-card .btn-dark {
  padding: 0.75rem;
  font-size: 0.95rem;
}
/* Chat Section - Fixed layout */
#chat-section {
  min-height: 100dvh;
  width: 100%;
  display: flex;
  flex-direction: row;
  overflow: hidden;
}
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  height: 100dvh;
  overflow: hidden;
  position: relative;
  z-index: 100;
  box-shadow: var(--shadow-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
}
.dashboard-link {
  color: var(--text-color);
  text-decoration: none;
  font-weight: 500;
  display: block;
  padding: 0.5rem 0;
}
.dashboard-link:hover {
  color: var(--accent-color);
}
.history-section {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  min-height: 0;
  margin-bottom: 1rem;
  position: relative;
}
.history-section h5 {
  color: var(--text-color);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  position: sticky;
  top: 0;
  background-color: var(--sidebar-bg);
  padding: 0.5rem 0;
  z-index: 20;
  border-bottom: 1px solid var(--sidebar-border);
}
#chat-history .list-group-item {
  background-color: transparent;
  border: none;
  color: var(--text-color);
  font-size: 0.9rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--border-radius);
  transition: background-color 0.2s;
  max-width: 100%;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 10;
  margin-bottom: 0.25rem;
}
#chat-history .list-group-item:hover {
  background-color: rgba(33, 37, 41, 0.1);
}
.chat-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.chat-menu {
  position: relative;
  z-index: 1002;
  flex-shrink: 0;
}
.chat-menu-button {
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 1rem;
  cursor: pointer;
  padding: 0 0.5rem;
  line-height: 1;
  z-index: 1002;
  transition: color 0.2s ease;
}
.chat-menu-button:hover {
  color: var(--accent-color);
}
.chat-menu-button:focus {
  outline: none;
}
.chat-menu-dropdown,
.profile-menu-dropdown {
  background: var(--bg-color);
  border: 1px solid var(--input-border);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  z-index: 2000;
  min-width: 180px;
  overflow: hidden;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.chat-menu-dropdown.show,
.profile-menu-dropdown.show {
  opacity: 1;
  transform: translateY(0);
}
.chat-menu-dropdown button,
.profile-menu-dropdown button {
  background: none;
  border: none;
  color: var(--text-color);
  padding: 0.75rem 1rem;
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  font-size: 0.9rem;
  transition: background-color 0.2s ease;
}
.chat-menu-dropdown button:hover,
.profile-menu-dropdown button:hover {
  background-color: rgba(33, 37, 41, 0.05);
}
.chat-menu-dropdown button i,
.profile-menu-dropdown button i {
  margin-right: 0.75rem;
  font-size: 1.1rem;
}
/* Profile bar styles */
.profile-bar {
  position: sticky;
  bottom: 0;
  background-color: var(--sidebar-bg);
  border-top: 1px solid var(--sidebar-border);
  margin: 0 -1rem -1rem -1rem;
  padding: 0 1rem 1rem 1rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.profile-bar:hover {
  background-color: rgba(33, 37, 41, 0.05);
}
.profile-icon {
  width: 32px;
  height: 32px;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: white;
  font-weight: bold;
}
.profile-icon.small {
  width: 24px;
  height: 24px;
  font-size: 0.7rem;
}
/* Gmail-like color classes for profile icons */
.profile-color-1 { background-color: #4285F4; } /* Blue */
.profile-color-2 { background-color: #EA4335; } /* Red */
.profile-color-3 { background-color: #FBBC05; } /* Yellow */
.profile-color-4 { background-color: #34A853; } /* Green */
.profile-color-5 { background-color: #8E24AA; } /* Purple */
.profile-color-6 { background-color: #FF6D00; } /* Orange */
.profile-color-7 { background-color: #00BFA5; } /* Teal */
.profile-color-8 { background-color: #F50057; } /* Pink */
/* Guest buttons - Ensure Register button matches Log In button */
.guest-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  padding: 1rem;
}
.guest-buttons .btn {
  min-width: 120px;
  padding: 0.75rem 1.5rem;
  font-weight: 500;
  border-radius: var(--border-radius);
  transition: all 0.2s ease;
  font-size: 0.95rem;
  -webkit-font-smoothing: antialiased; /* Improve text rendering */
  -moz-osx-font-smoothing: grayscale;
}
.guest-buttons .btn-light {
  background-color: white;
  color: var(--text-color);
  border: 1px solid var(--input-border);
}
.guest-buttons .btn-light:hover {
  background-color: #f8f9fa;
  border-color: var(--accent-color);
  transform: scale(1.02);
}
.guest-buttons .btn-light:focus {
  outline: none;
  box-shadow: 0 0 0 0.2rem rgba(33, 37, 41, 0.25);
}
.guest-buttons .btn-dark {
  background-color: var(--accent-color);
  border-color: var(--accent-color);
  color: white !important;
}
.guest-buttons .btn-dark:hover {
  background-color: #000;
  border-color: #000;
  transform: scale(1.02);
}
.guest-buttons .btn-dark:focus {
  outline: none;
  box-shadow: 0 0 0 0.2rem rgba(33, 37, 41, 0.25);
}
/* Modal Styles */
.modal-content {
  border-radius: var(--border-radius);
  border: 1px solid var(--input-border);
}
.modal-header {
  border-bottom: 1px solid var(--sidebar-border);
}
.modal-footer {
  border-top: 1px solid var(--sidebar-border);
}
.modal-title {
  font-size: 1.2rem;
  font-weight: 600;
}
.btn-primary {
  background-color: var(--accent-color);
  border-color: var(--accent-color);
}
.btn-primary:hover {
  background-color: #000;
  border-color: #000;
}
.btn-secondary {
  background-color: #6c757d;
  border-color: #6c757d;
}
.btn-secondary:hover {
  background-color: #5a6268;
  border-color: #5a6268;
}
/* Desktop Styles (Default) */
.chat-main {
  background-color: var(--bg-color);
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  width: 100%;
  position: relative;
}
.chat-main::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, rgba(102, 126, 234, 0.02) 0%, rgba(118, 75, 162, 0.02) 100%);
  pointer-events: none;
  z-index: 1;
}
.chat-header {
  background-color: var(--bg-color);
  border-bottom: 1px solid var(--sidebar-border);
  padding: 0.75rem 1rem;
  font-size: 1.2rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  box-shadow: var(--shadow-sm);
  height: var(--header-height);
  flex-shrink: 0;
  z-index: 100;
  width: 100%;
  position: relative;
}
.header-logo {
  height: 30px;
  width: auto;
  object-fit: contain;
}
#sidebar-toggle {
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 1.5rem;
  margin-right: 0.5rem;
  cursor: pointer;
  display: none;
}
/* Messages container */
#chat-messages {
  flex: 1;
  overflow-y: auto;
  background-color: var(--bg-color);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
  position: relative;
  z-index: 2;
}
.message-content {
  padding: 1rem 1.25rem;
  border-radius: var(--border-radius);
  max-width: 80%;
  word-wrap: break-word;
  background-color: var(--message-bot-bg);
  color: var(--text-color);
  border: 1px solid rgba(102, 126, 234, 0.2);
  box-shadow: var(--shadow-md), var(--futuristic-glow);
  font-size: 0.95rem;
  line-height: 1.4;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(10px);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.message-content:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15), var(--futuristic-glow);
}
.d-flex.justify-content-end .message-content {
  background: var(--message-user-bg);
  border: 1px solid rgba(118, 75, 162, 0.3);
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}
.message-text {
  flex: 1;
}
.message-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  font-size: 0.7rem;
  color: #666666;
  margin-top: 0.2rem;
}
.d-flex.justify-content-end .message-footer {
  color: #ffffff;
}
.ticks {
  margin-left: 0.3rem;
  font-size: 0.9rem;
}
.date-separator {
  text-align: center;
  margin: 1rem 0;
  color: #666666;
  font-size: 0.8rem;
  background: rgba(102, 126, 234, 0.1);
  padding: 0.2rem 1rem;
  border-radius: 20px;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
  box-shadow: var(--futuristic-glow);
}
.typing-indicator {
  color: #6c757d;
  font-size: 0.9rem;
  padding: 1rem 1.25rem;
  background-color: var(--message-bot-bg);
  border: 1px solid rgba(102, 126, 234, 0.2);
  border-radius: var(--border-radius);
  max-width: 80%;
  box-shadow: var(--shadow-md), var(--futuristic-glow);
  display: flex;
  align-items: center;
  backdrop-filter: blur(10px);
}
.typing-dots {
  display: inline-block;
  width: 2.5em;
  position: relative;
  margin-left: 0.5rem;
}
.typing-dots span {
  position: absolute;
  width: 5px;
  height: 5px;
  background-color: #6c757d;
  border-radius: 50%;
  animation: typing-bounce 1.4s infinite ease-in-out both;
}
.typing-dots span:nth-child(1) {
  left: 0;
  animation-delay: -0.32s;
}
.typing-dots span:nth-child(2) {
  left: 0.8em;
  animation-delay: -0.16s;
}
.typing-dots span:nth-child(3) {
  left: 1.6em;
  animation-delay: 0s;
}
@keyframes typing-bounce {
  0%, 80%, 100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}
.input-group .input-container .btn-dark {
  border-radius: var(--border-radius);
  border: 1px solid rgba(102, 126, 234, 0.3);
  background: linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(248,249,250,0.9) 100%);
  color: var(--text-color);
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm), var(--futuristic-glow);
  backdrop-filter: blur(5px);
}
.input-group .input-container .btn-dark:hover {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  border-color: rgba(102, 126, 234, 0.5);
  transform: translateX(5px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}
.input-group .input-container .btn-dark:active {
  transform: translateX(2px) scale(0.98);
}
/* Input area */
.input-group {
  background-color: var(--bg-color);
  border-top: 1px solid var(--sidebar-border);
  padding: 0.75rem 1rem;
  padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
  flex-shrink: 0;
  z-index: 100;
  position: relative;
  width: 100%;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
}
.input-container {
  display: flex;
  gap: 0.5rem;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  align-items: flex-end;
}
.input-group .form-control {
  overflow: hidden;
  resize: none;
  background-color: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--border-radius);
  color: var(--text-color);
  padding: 0.5rem 0.75rem;
  flex: 1;
  min-height: 44px;
  resize: none;
  font-size: 0.95rem;
  overflow: hidden;
  box-shadow: var(--shadow-sm), var(--futuristic-glow);
  transition: box-shadow 0.2s ease;
  backdrop-filter: blur(5px);
}
.input-group .form-control:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 0.2rem rgba(33, 37, 41, 0.1), var(--futuristic-glow);
}
/* Profile Tab */
#profile-tab {
  background-color: var(--bg-color);
  overflow-y: auto;
  padding: 1rem;
}
@media (min-width: 768px) {
  #profile-tab {
    padding: 2rem;
    max-width: 600px;
    margin: 0 auto;
  }
}
/* Welcome Message Styles */
.welcome-container {
  background: var(--welcome-bg);
  padding: 2rem;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: hidden; /* Prevent scrolling */
}
.welcome-logo {
  max-width: 200px;
  height: auto;
  margin-bottom: 1rem;
}
.welcome-subheading {
  font-size: 1.2rem;
  font-weight: bold;
  margin-bottom: 1.5rem;
}
.recommendations-container {
  width: 100%;
}
.recommendations {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
}
.recommendation {
  background-color: #f8f9fa;
  border: 1px solid #ced4da;
  border-radius: 20px;
  padding: 0.5rem 1rem;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1.2;
  transition: background-color 0.2s ease;
}
.recommendation:hover {
  background-color: #e2e6ea;
}
.recommendation:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
/* Suggestion Menu Styles */
.suggestion-menu {
  background: var(--bg-color) !important;
  border: 1px solid var(--input-border) !important;
  border-radius: var(--border-radius) !important;
  box-shadow: var(--shadow-md) !important;
  z-index: 10000 !important;
  overflow-y: auto;
}
.suggestion-menu .suggestion-header {
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--sidebar-border);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-color);
}
.suggestion-menu .suggestion-content {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.suggestion-menu .suggestion-content div {
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
  border-bottom: 1px solid var(--sidebar-border);
}
.suggestion-menu .suggestion-content div:hover {
  background-color: var(--input-bg) !important;
}
.suggestion-menu .suggestion-content div:last-child {
  border-bottom: none !important;
}
/* Desktop-specific suggestion menu styles */
@media (min-width: 769px) {
  .suggestion-menu {
    max-height: none;
    overflow-y: visible;
  }
}
/* Mobile-specific suggestion menu styles */
@media (max-width: 768px) {
  .suggestion-menu {
    position: fixed !important;
    left: 10px !important;
    right: 10px !important;
    top: auto !important;
    width: calc(100% - 20px) !important;
    max-height: 65dvh !important;
    min-height: 160px !important;
    z-index: 10000 !important;
    display: flex;
    flex-direction: column;
  }
  .keyboard-open .suggestion-menu {
    bottom: calc(var(--input-height) + env(safe-area-inset-bottom, 0px) + 20px) !important;
  }
  .suggestion-menu .suggestion-header {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--bg-color);
    border-bottom: 1px solid var(--sidebar-border);
  }
  .suggestion-menu .suggestion-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .suggestion-menu .suggestion-content div {
    padding: 0.5rem 0.75rem;
  }
  .suggestion-menu .suggestion-content div strong {
    font-size: 0.85rem;
  }
  .suggestion-menu .suggestion-content div small {
    font-size: 0.75rem;
  }
}
/* Ensure modals have proper z-index */
.modal {
  z-index: 10050 !important;
}
.modal-backdrop {
  z-index: 10040 !important;
}
/* Post description with read more */
.post-description {
  position: relative;
  line-height: 1.2em;
  margin-bottom: 0.5rem;
}
.post-description.expanded {
  max-height: none;
}
.read-more, .read-less {
  color: #1877f2;
  cursor: pointer;
  font-weight: 500;
}
.read-more:hover, .read-less:hover {
  text-decoration: underline;
}
/* Post action buttons spacing */
.post .card-body .d-flex.gap-2 {
  margin-top: 0.75rem;
  margin-bottom: 0.5rem;
}
.post .price-title-container {
  margin-top: 0.75rem;
}
/* FULL WIDTH POSTS AND QUESTIONS STYLES - ADDED TO FIX THE ISSUE */
#posts-list, #questions-list {
  width: 100%;
  padding: 0 !important;
  margin: 0 !important;
}
.post, .question {
  width: 100%;
  margin: 0 !important;
  border-radius: 0 !important;
  border: none !important;
  border-bottom: 1px solid var(--sidebar-border) !important;
  box-shadow: none !important;
  background: var(--bg-color);
}
.post .card-body, .question .card-body {
  padding: 1rem;
  width: 100%;
}
/* Remove any container padding that might be limiting width */
.feed-content {
  width: 100%;
}
.post-form, .question-form {
  width: 100%;
  background: var(--bg-color);
  border-bottom: 1px solid var(--sidebar-border);
}
/* Ensure images and content stretch full width */
.post .image-wrapper, .question .image-wrapper {
  margin-left: 0;
  margin-right: 0;
}
/* END OF FULL WIDTH FIXES */
/* Image Cropping and Full View Styles */
.image-wrapper {
  width: 100%;
  height: 500px; /* Increased height */
  overflow: hidden;
  position: relative;
  cursor: pointer;
}
.image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.image-wrapper .carousel-inner,
.image-wrapper .carousel-item {
  height: 100%;
}
.image-wrapper .carousel-item img {
  height: 100%;
  object-fit: cover;
  object-position: center;
}
@media (max-width: 768px) {
  .image-wrapper {
    height: 400px; /* Increased height on mobile */
  }
  .post .image-wrapper, .question .image-wrapper {
    margin: 0 -0.75rem;
    width: calc(100% + 1.5rem);
  }
}
/* Image Preview Modal Styles */
#image-preview-modal .modal-backdrop {
  opacity: 0.9 !important;
}
#image-preview-modal .modal-content {
  background: transparent !important;
  box-shadow: none;
}
#image-preview-modal .btn-close {
  filter: invert(1); /* White close button */
  background-color: rgba(0, 0, 0, 0.5) !important;
  border-radius: 50%;
  padding: 0.5rem;
  opacity: 1 !important;
  z-index: 1051;
}
/* Make sure the close button is clickable and visible */
#image-preview-modal .modal-header {
  z-index: 1051;
}
/* Post in feed */
.post .card-body {
  padding: 1rem;
}
.post .price {
  margin: 0.5rem 0;
  color: #1877f2; /* Facebook blue */
}
.post .card-title {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}
.post .price-title-container {
  background-color: #f0f2f5;
  padding: 0.5rem;
  border-radius: var(--border-radius);
  margin-top: 0.5rem;
}
.post .price-title-container .price {
  font-weight: normal;
  color: #65676b;
  font-size: 0.9rem;
}
.post .price-title-container .card-title {
  font-weight: bold;
  font-size: 1rem;
  margin: 0;
}
/* Modern Popup Modal */
#modern-popup-modal .modal-content {
  border-radius: 16px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}
#modern-popup-modal .modal-header {
  border-bottom: none;
  padding-bottom: 0;
}
#modern-popup-modal .modal-body {
  font-size: 1.1rem;
  padding-top: 0.5rem;
  padding-bottom: 1.5rem;
}
#modern-popup-modal .modal-footer {
  border-top: none;
  padding-top: 0;
}
/* Carousel Styles */
.carousel-indicators {
  bottom: 10px;
}
.carousel-indicators button {
  background-color: #fff !important;
  opacity: 0.7;
}
.carousel-indicators .active {
  opacity: 1;
}
.carousel-control-prev, .carousel-control-next {
  filter: invert(1); /* Make controls visible on light background */
}
/* Skeleton Loading */
.skeleton {
  background-color: var(--sidebar-border);
  animation: skeleton-loading 1s linear infinite alternate;
  border-radius: var(--border-radius);
}
@keyframes skeleton-loading {
  0% {
    background-color: hsl(200, 20%, 95%);
  }
  100% {
    background-color: hsl(200, 20%, 80%);
  }
}
/* Theme Banner Styles - Modern and Stylish */
.theme-banner {
  background-color: #f0f2f5; /* Default light background */
  padding: 1.5rem !important;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.theme-banner:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.theme-banner h5 {
  font-weight: 700;
  font-size: 1.25rem;
}
.theme-banner p {
  font-size: 0.95rem;
  line-height: 1.4;
}
.theme-banner .btn-primary {
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius);
  transition: all 0.2s ease;
}
.theme-banner .btn-primary:hover {
  transform: scale(1.02);
}
/* AI Search Box Styles - Modern and Fancy */
.ai-search {
  background-color: var(--bg-color);
}
.ai-search-group {
  background: white;
  border-radius: var(--border-radius);
  border-width: 2px;
  border-style: solid;
  border-color: transparent;
  border-image: linear-gradient(to right, #ff7e00, #ff0000, #cc00ff, #0066ff) 1;
  padding: 0.25rem 1rem;
  box-shadow: none;
  transition: box-shadow 0.2s ease;
}
.ai-search-group:focus-within {
  box-shadow: none;
}
.ai-search-group .input-group-text {
  background: transparent;
  border: none;
  padding: 0;
}
.ai-search-group .bi-stars {
  font-size: 1.2rem;
  color: #4285F4; /* AI-inspired blue */
  animation: sparkle 2s infinite ease-in-out;
}
@keyframes sparkle {
  0%, 100% { opacity: 0.8; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.1); }
}
.ai-search-input {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  font-size: 0.95rem;
  color: var(--text-color);
  padding: 0.5rem 1rem;
}
.ai-search-input::placeholder {
  color: #65676b;
  font-style: italic;
  font-size: 0.85rem;
}
.ai-search-input:focus {
  outline: none;
  box-shadow: none !important;
}
/* Suggestion Chips Styles - Full Width Futuristic */
.suggestion-chips-container {
  margin-top: 1rem;
}
.suggestion-chips-message {
  background: rgba(102, 126, 234, 0.05);
  border: 1px solid rgba(102, 126, 234, 0.2);
  border-radius: var(--border-radius);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
}
.suggestion-chips {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.suggestion-chip {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  border: 1px solid rgba(102, 126, 234, 0.3);
  border-radius: var(--border-radius);
  background: linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(248,249,250,0.9) 100%);
  color: var(--text-color);
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm), var(--futuristic-glow);
  backdrop-filter: blur(5px);
  position: relative;
  overflow: hidden;
}
.suggestion-chip::before {
  content: '\21b7';
  font-family: 'Bootstrap Icons', sans-serif;
  font-style: normal;
  font-weight: normal;
  font-variant: normal;
  text-transform: none;
  line-height: 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: inline-block;
  margin-right: 0.5rem;
  color: #667eea;
  font-size: 1rem;
}
.suggestion-chip:hover {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  border-color: rgba(102, 126, 234, 0.5);
  transform: translateX(5px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}
.suggestion-chip:active {
  transform: translateX(2px) scale(0.98);
}
/* Media Queries */
@media (max-width: 768px) {
  .recommendations {
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    padding-bottom: 1rem;
    position: absolute;
    bottom: calc(-10px + var(--bottom-nav-height));
    left: 0;
    right: 0;
    padding: 0 1rem;
    background-color: #ffffff;
    scroll-behavior: auto;
  }
  .recommendations::-webkit-scrollbar {
    display: none;
  }
  .recommendations {
    -ms-overflow-style: none;
    scrollbar-width: none;
  }
  .recommendation {
    min-width: auto;
    width: auto;
    padding: 0.75rem 1.25rem;
    white-space: normal;
    flex-shrink: 0;
    margin-right: 0.75rem;
    border: none;
    box-shadow: var(--shadow-sm);
    border-radius: 12px;
    font-size: 0.95rem;
  }
  .guest-buttons {
    flex-direction: column;
    gap: 0.5rem;
  }
  .guest-buttons .btn {
    width: 100%;
    padding: 0.75rem;
    font-size: 0.95rem;
  }
  .welcome-container {
    padding: 1.5rem 1rem;
    min-height: calc(100dvh - var(--header-height) - var(--input-height));
    justify-content: center;
    position: relative;
    overflow: hidden; /* Prevent scrolling */
    padding-bottom: 0; /* Remove extra padding */
  }
  .welcome-logo {
    max-width: 150px;
  }
  .welcome-subheading {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
  }
  .login-card {
    width: 95%;
    padding: 1rem !important;
    margin: 0.5rem auto;
  }
  .login-title {
    font-size: 1.2rem;
  }
  .form-group {
    margin-bottom: 0.8rem !important;
  }
  .form-label {
    font-size: 0.75rem;
  }
  .form-input,
  .form-select {
    padding: 0.3rem 0.5rem;
    font-size: 0.8rem;
    line-height: 1.4;
  }
  .auth-error {
    font-size: 0.75rem;
  }
  .signup-text {
    font-size: 0.8rem;
  }
  .login-card .btn-dark {
    padding: 0.75rem;
    font-size: 0.95rem;
  }
  .sidebar {
    width: 80%;
    max-width: 260px;
    position: fixed;
    top: 0;
    left: -100%;
    z-index: 1050;
    transition: left 0.3s ease;
    box-shadow: var(--shadow-md);
    padding: 1rem;
  }
  .sidebar.show {
    left: 0;
  }
  #chat-section {
    flex-direction: column;
  }
  .chat-main {
    margin-left: 0;
    width: 100%;
  }
  .chat-header {
    padding: 0.75rem 1rem;
    font-size: 1.2rem;
  }
  #sidebar-toggle {
    display: block;
  }
  .input-group {
    padding: 0.5rem;
    padding-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px));
  }
  .message-content {
    font-size: 1rem;
    max-width: 75%;
    padding: 0.8rem 1.2rem;
  }
  .input-group .form-control {
    font-size: 1rem;
    min-height: 48px;
  }
  .input-group .input-container .btn-dark {
    min-width: 48px;
    min-height: 48px;
  }
  .header-logo {
    height: 40px;
  }
  #bottom-nav {
    height: var(--bottom-nav-height);
    z-index: 1000;
  }
  #chat-section .chat-main,
  #discover-section .discover-main,
  #create-post-section,
  #forum-section .forum-main {
    padding-bottom: var(--bottom-nav-height);
  }
  #bottom-nav .btn-link {
    color: #000;
    padding: 0.5rem;
    transition: transform 0.2s;
  }
  #bottom-nav .btn-link.active {
    transform: scale(1.2);
  }
  .keyboard-open #bottom-nav {
    bottom: 0 !important;
  }
  .keyboard-open #chat-section .chat-main,
  .keyboard-open #discover-section .discover-main,
  .keyboard-open #create-post-section,
  .keyboard-open #forum-section .forum-main {
    padding-bottom: 0 !important;
  }
}
/* Custom Scrollbar */
#chat-messages::-webkit-scrollbar,
.history-section::-webkit-scrollbar {
  width: 8px;
}
#chat-messages::-webkit-scrollbar-track,
.history-section::-webkit-scrollbar-track {
  background: transparent;
}
#chat-messages::-webkit-scrollbar-thumb,
.history-section::-webkit-scrollbar-thumb {
  background: #ced4da;
  border-radius: 10px;
}
#chat-messages::-webkit-scrollbar-thumb:hover,
.history-section::-webkit-scrollbar-thumb:hover {
  background: #adb5bd;
}
/* Overlay for mobile when sidebar is open */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1040;
  display: none;
}
.sidebar-overlay.show {
  display: block;
}
/* Discover and Forum Styles */
.post-form,
.question-form {
  background: var(--bg-color);
  padding: 1rem;
}
.post.card,
.question.card {
  background: var(--bg-color);
  border: none;
  box-shadow: var(--shadow-sm);
}
.post .card-img-top {
  border-radius: var(--border-radius);
}
.comment,
.answer {
  font-size: 0.9rem;
}
.comment-form,
.answer-form,
.reply-form {
  display: flex;
  flex-direction: column;
}
.custom-file-upload {
  cursor: pointer;
  display: inline-block;
}
.custom-file-upload input[type="file"] {
  display: none;
}
/* Switch country button */
.chat-header .btn-link {
  color: var(--text-color);
  text-decoration: none;
  padding: 0;
}
.chat-header .btn-link:hover {
  text-decoration: underline;
}
/* Comments modal */
#comments-modal .modal-content {
  height: 75vh;
}
#comments-modal .modal-body {
  overflow-y: auto;
}
/* Ensure proper viewport height */
@supports (height: 100dvh) {
  body {
    height: 100dvh;
  }
  .chat-main {
    height: 100dvh;
  }
  .sidebar {
    height: 100dvh;
  }
}
/* Create Post Section */
#create-post-section .form-group {
  margin-bottom: 1rem;
}
#create-post-section .form-label {
  font-size: 0.9rem;
  font-weight: 500;
}
#create-post-section .form-control,
#create-post-section .form-select {
  border-radius: var(--border-radius);
}
#create-post-section .btn-dark {
  border-radius: var(--border-radius);
}
/* Modern native design */
#create-post-section {
  background: var(--bg-color);
}
#create-post-section .chat-header {
  border-bottom: 1px solid var(--sidebar-border);
}
#create-post-section .border-top {
  background: var(--bg-color);
}
/* Price in feed */
.price {
  font-weight: bold;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}
/* Fill form */
#create-post-section .form-group.flex-grow-1 {
  display: flex;
  flex-direction: column;
}
#create-post-section .form-group.flex-grow-1 .form-control {
  flex-grow: 1;
}
.post .card-body {
  padding: 1rem;
}
.post .price {
  margin: 0.5rem 0;
  color: #1877f2; /* Facebook blue */
}
.post .card-title {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}
.post .price-title-container {
  background-color: #f0f2f5;
  padding: 0.5rem;
  border-radius: var(--border-radius);
  margin-top: 0.5rem;
}
.post .price-title-container .price {
  font-weight: normal;
  color: #65676b;
  font-size: 0.9rem;
}
.post .price-title-container .card-title {
  font-weight: bold;
  font-size: 1rem;
  margin: 0;
}
/* Modern Popup Modal */
#modern-popup-modal .modal-content {
  border-radius: 16px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}
#modern-popup-modal .modal-header {
  border-bottom: none;
  padding-bottom: 0;
}
#modern-popup-modal .modal-body {
  font-size: 1.1rem;
  padding-top: 0.5rem;
  padding-bottom: 1.5rem;
}
#modern-popup-modal .modal-footer {
  border-top: none;
  padding-top: 0;
}
/* Carousel Styles */
.carousel-indicators {
  bottom: 10px;
}
.carousel-indicators button {
  background-color: #fff !important;
  opacity: 0.7;
}
.carousel-indicators .active {
  opacity: 1;
}
.carousel-control-prev, .carousel-control-next {
  filter: invert(1); /* Make controls visible on light background */
}
/* Skeleton Loading */
.skeleton {
  background-color: var(--sidebar-border);
  animation: skeleton-loading 1s linear infinite alternate;
  border-radius: var(--border-radius);
}
@keyframes skeleton-loading {
  0% {
    background-color: hsl(200, 20%, 95%);
  }
  100% {
    background-color: hsl(200, 20%, 80%);
  }
}
/* Theme Banner Styles - Modern and Stylish */
.theme-banner {
  background-color: #f0f2f5; /* Default light background */
  padding: 1.5rem !important;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.theme-banner:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.theme-banner h5 {
  font-weight: 700;
  font-size: 1.25rem;
}
.theme-banner p {
  font-size: 0.95rem;
  line-height: 1.4;
}
.theme-banner .btn-primary {
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius);
  transition: all 0.2s ease;
}
.theme-banner .btn-primary:hover {
  transform: scale(1.02);
}