/* Modern Islamic-inspired color palette */
:root {
  --primary: #2A6041;      /* Deep green - represents growth and tranquility */
  --primary-light: #3A8C61; /* Lighter green for hover states */
  --primary-dark: #1e4430;  /* Darker green for depth */
  --secondary: #D4AF37;    /* Gold accent - represents wisdom and value */
  --secondary-light: #e9c662; /* Lighter gold */
  --neutral-bg: #F7F6F1;   /* Soft off-white background */
  --neutral-text: #2C3539; /* Dark slate for text - WCAG AAA compliant */
  --neutral-border: #E0DED5; /* Subtle border color */
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  --message-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  
  /* 8px spacing system */
  --spacing-xs: 8px;
  --spacing-sm: 16px;
  --spacing-md: 24px;
  --spacing-lg: 32px;
  --spacing-xl: 40px;
  --spacing-xxl: 48px;
  
  /* Consistent transitions */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Global styling with modern typography */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 0;
  color: var(--neutral-text);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background-color: var(--neutral-bg);
  background-image: url("data:image/svg+xml,%3Csvg width='120' height='120' viewBox='0 0 120 120' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M9 0h2v20H9V0zm25.134.84l1.732 1-10 17.32-1.732-1 10-17.32zm-20 20l1.732 1-10 17.32-1.732-1 10-17.32zM58.16 4.134l1 1.732-17.32 10-1-1.732 17.32-10zm-40 40l1 1.732-17.32 10-1-1.732 17.32-10zM80 9v2H60V9h20zM20 69v2H0v-2h20zm79.32-55l-1 1.732-17.32-10L82 4l17.32 10zm-80 80l-1 1.732-17.32-10L2 84l17.32 10zm96.546-75.84l-1.732 1-10-17.32 1.732-1 10 17.32zm-100 100l-1.732 1-10-17.32 1.732-1 10 17.32zM38.16 24.134l1 1.732-17.32 10-1-1.732 17.32-10zM60 29v2H40v-2h20zm19.32 5l-1 1.732-17.32-10L62 24l17.32 10zm16.546 4.16l-1.732 1-10-17.32 1.732-1 10 17.32zM111 40h-2V20h2v20zm3.134.84l1.732 1-10 17.32-1.732-1 10-17.32zM40 49v2H20v-2h20zm19.32 5l-1 1.732-17.32-10L42 44l17.32 10zm-40 40l-1 1.732-17.32-10L2 84l17.32 10zm39.32-30l-1 1.732-17.32-10L22 54l17.32 10zm80 30l-1 1.732-17.32-10L102 84l17.32 10zm-80-50l-1 1.732-17.32-10L22 34l17.32 10zm-40 40l-1 1.732-17.32-10L2 64l17.32 10zm99.32-70l-1 1.732-17.32-10L102 24l17.32 10zM119 40h-2V20h2v20zm0 20h-2V40h2v20zm0 20h-2V60h2v20z' fill='%232A6041' fill-opacity='0.03' fill-rule='evenodd'/%3E%3C/svg%3E");
  height: 100dvh;
  height: 100vh; /* fallback for older browsers */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Beautiful text selection styling */
::selection {
  background-color: var(--primary);
  color: white;
  text-shadow: none;
}

::-moz-selection {
  background-color: var(--primary);
  color: white;
  text-shadow: none;
}

/* Improved paragraph spacing in messages */
.bot .formatted-content p + p {
  margin-top: 16px;
}

.bot .formatted-content p {
  margin-bottom: 12px;
  line-height: 1.7;
}

/* Better list spacing */
.bot .formatted-content ul,
.bot .formatted-content ol {
  margin: 12px 0;
  padding-left: 24px;
}

.bot .formatted-content li {
  margin-bottom: 8px;
  line-height: 1.6;
}

/* ------ ONBOARDING STYLES (ORIGINAL CENTERED CARD) ------ */
#onboarding-container {
  /* Base sizing */
  width: 90%;
  max-width: 500px;
  
  /* Styling */
  background-color: white;
  border-radius: 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
  
  /* Positioning - centered in viewport */
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  
  /* Other */
  transition: all 0.3s ease;
  z-index: 5;
}

/* Enhanced onboarding experience */
.onboarding-header {
  background-color: var(--primary);
  color: white;
  padding: 30px 20px;
  border-radius: 20px 20px 0 0;
  position: relative;
  overflow: hidden;
  text-align: center;
}

.onboarding-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.1));
}

.onboarding-header h2 {
  font-weight: 500;
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.4;
}

.onboarding-content {
  padding: 25px 30px;
}

/* Improved mode selection with visual indicators */
.mode-selection {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 25px 0;
}

.mode-btn {
  padding: 16px 20px;
  border: 2px solid var(--neutral-border);
  border-radius: 12px;
  cursor: pointer;
  font-size: 16px;
  background-color: white;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  text-align: left;
}

.mode-btn .mode-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  margin-right: 15px;
  background-color: rgba(42, 96, 65, 0.1);
}

.mode-btn .mode-text {
  flex: 1;
}

.mode-btn .mode-title {
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--primary);
}

.mode-btn .mode-description {
  font-size: 13px;
  color: #666;
}

.mode-btn:hover {
  border-color: var(--primary-light);
  background-color: rgba(42, 96, 65, 0.03);
}

.mode-btn.selected {
  border-color: var(--primary);
  background-color: rgba(42, 96, 65, 0.05);
  box-shadow: 0 2px 12px rgba(42, 96, 65, 0.1);
}

/* User details form styling */
.user-form {
  margin-top: 25px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  text-align: left;
  gap: 6px;
}

.form-group label {
  font-size: 14px;
  font-weight: 500;
  color: var(--neutral-text);
}

.form-control {
  padding: 12px 16px;
  border: 1px solid var(--neutral-border);
  border-radius: 10px;
  font-size: 15px;
  transition: all 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 2px rgba(42, 96, 65, 0.1);
}

/* Start chat button with enhanced style */
#start-chat-btn {
  margin-top: 30px;
  padding: 14px 0;
  background-color: var(--primary);
  color: white;
  font-size: 16px;
  font-weight: 500;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
}

#start-chat-btn:hover {
  background-color: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(42, 96, 65, 0.2);
}

#start-chat-btn.disabled {
  background-color: #cccccc;
  cursor: not-allowed;
  opacity: 0.7;
  transform: none;
  box-shadow: none;
}

/* ------ CHAT INTERFACE STYLES------ */
app-container {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar core styling */
.sidebar {
  width: 260px;
  background: linear-gradient(180deg, #1e4430 0%, #2A6041 60%, #1e4430 100%);
  color: white;
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  padding-top: calc(20px + env(safe-area-inset-top, 0px));
  box-sizing: border-box;
  height: 100dvh;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  box-shadow: 2px 0 16px rgba(0, 0, 0, 0.2);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  line-height: 1.5;
  flex-shrink: 0;
}

/* Enhanced scrollbar for sidebar */
.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 10px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  transition: background 0.3s ease;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}


/* Sidebar toggle button - always visible */
.sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  color: white;
  height: 40px;
  width: 40px;
  margin-right: 5px; /* Add some space between the toggle and the logo */
}

.sidebar-toggle svg {
  width: 24px;
  height: 24px;
}


.new-chat {
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: all 0.2s ease;
}

.new-chat:hover {
  background-color: var(--primary-light);
  transform: translateY(-1px);
}

.new-chat-icon {
  margin-right: 10px;
  font-size: 18px;
}

.bottom-nav {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  margin-bottom: 6px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.nav-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  background: var(--secondary);
  border-radius: 0 3px 3px 0;
  transition: height 0.3s ease;
}

.nav-item:hover::before {
  height: 70%;
}

.nav-item:hover {
  background-color: rgba(255, 255, 255, 0.15);
  transform: translateX(3px);
}

.nav-item:active {
  transform: translateX(1px);
}

.nav-icon {
  margin-right: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  transition: transform 0.3s ease;
}

.nav-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
}

.nav-item:hover .nav-icon {
  transform: scale(1.1);
}

/* Main area - the container for chat interface */
.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  background-color: var(--neutral-bg);
  background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%232A6041' fill-opacity='0.03' fill-rule='evenodd'/%3E%3C/svg%3E");
  margin-left: 260px; /* Start with margin equal to sidebar width */
  transition: all 0.3s ease;
  width: calc(100% - 260px); /* Start with width reduced by sidebar */
}

/* Chatbot container - contains the main chat interface */
#chatbot-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  position: relative;
  transition: max-width 0.3s ease, margin 0.3s ease;
}

/* Chat content elements - enable smooth transitions */
#chatbox, #input-container {
  transition: max-width 0.3s ease, margin 0.3s ease;
}

.app-container {
  display: flex;
  width: 100vw;
  height: 100dvh;
  height: 100vh;
  overflow: hidden;
}

/* Loading state — show header instantly, hide rest until auth resolves */
.app-container.app-loading .sidebar,
.app-container.app-loading #chatbox,
.app-container.app-loading #input-container {
  visibility: hidden;
}

.app-container.app-loading .chat-header {
  visibility: visible;
}

/* COLLAPSED STATE - Desktop */
.app-container.sidebar-collapsed .sidebar {
  transform: translateX(-100%);
}

.app-container.sidebar-collapsed .main-area {
  margin-left: 0;
  width: 100%; /* Full width when sidebar is collapsed */
  transition: all 0.3s ease;
}

/* Center content when sidebar is collapsed */
.app-container.sidebar-collapsed #chatbot-container {
  width: 100%;
  max-width: 100%;
}

/* When sidebar is collapsed */
.app-container.sidebar-collapsed #input-container {
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

/* Make the actual text input element wider */
.app-container.sidebar-collapsed #user-input {
  width: 100%;
  max-width: calc(100% - 60px);
  box-sizing: border-box;
  flex: 1;
}

/* Make the container for the text input area take full width while maintaining max-width for readability */
@media (min-width: 901px) {
  .app-container.sidebar-collapsed #input-container {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    box-sizing: border-box;
    padding-left: 20px;
    padding-right: 20px;
    transition: all 0.3s ease;
  }
  
  .app-container.sidebar-collapsed #input-container::before {
    content: "";
    flex: 1;
    max-width: 200px;
  }
  
  .app-container.sidebar-collapsed #input-container::after {
    content: "";
    flex: 1;
    max-width: 200px;
  }
}

.app-container.sidebar-collapsed #chatbox {
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
}

/* user input box */
.app-container.sidebar-collapsed #input-container {
  width: 100%;
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
  box-sizing: border-box;
  padding-left: 20px;
  padding-right: 20px;
  transition: all 0.3s ease;
}

.app-container.sidebar-collapsed #user-input {
  width: 100%;
  max-width: calc(100% - 60px); /* Account for the send button and some padding */
  box-sizing: border-box;
  flex: 1;
}

.app-container.sidebar-collapsed .message {
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.chat-header {
  background: linear-gradient(135deg, #1e4430 0%, #2A6041 50%, #1e4430 100%);
  color: white;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15), 0 4px 16px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  z-index: 10;
  width: 100%;
  box-sizing: border-box;
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--secondary), transparent);
  opacity: 0.5;
}

.chat-header h2 {
  margin: 0;
  font-weight: 500;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%);
  margin-right: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
}

.logo svg {
  width: 20px;
  height: 20px;
  fill: var(--primary);
  transition: transform 0.3s ease;
}

.logo:hover {
  transform: scale(1.05);
}

.logo:hover svg {
  transform: rotate(5deg);
}

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

.icon-btn {
  background: transparent;
  border: none;
  color: white;
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.icon-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.icon-btn:hover::before {
  opacity: 1;
}

.icon-btn:hover {
  transform: scale(1.1);
  color: var(--secondary);
}

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

/* Improved chat message area */
#chatbox {
  flex: 1;
  padding: var(--spacing-md);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  background-color: var(--neutral-bg);
  position: relative;
  -webkit-overflow-scrolling: touch;
}

/* Empty state styling */
#chatbox:empty::before {
  content: 'Start a conversation';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: rgba(0, 0, 0, 0.2);
  font-size: 1.2rem;
  font-weight: 500;
  text-align: center;
}

/* Better message bubbles with visual distinction */
.message {
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: 18px;
  position: relative;
  line-height: 1.6;
  font-size: 15px;
  margin-top: var(--spacing-xs);
  margin-bottom: var(--spacing-xs);
  box-shadow: var(--message-shadow);
  word-wrap: break-word;
  transition: all var(--transition-base);
  animation: slideInFromBottom 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Semantic message types with color coding */
.message.message-question {
  border-left: 4px solid #3498db;
}

.message.message-reflection {
  border-left: 4px solid #9b59b6;
}

.message.message-guidance {
  border-left: 4px solid var(--secondary);
}

/* Enhanced entrance animation */
@keyframes slideInFromBottom {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

.message:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.message-timestamp {
  font-size: 11px;
  opacity: 0.6;
  margin-top: 5px;
  text-align: right;
}

.user {
  background: linear-gradient(135deg, var(--primary) 0%, #1e5038 100%);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  padding-right: 20px;
  position: relative;
}

.user .message-timestamp {
  color: rgba(255, 255, 255, 0.8);
}

.bot {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  color: var(--neutral-text);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  border-left: 4px solid var(--secondary);
  padding-left: 20px;
  max-width: 700px;
  width: 100%;
  position: relative;
}

/* Bot avatar with Islamic geometric pattern */
.bot::after {
  content: '';
  position: absolute;
  left: -45px;
  top: 8px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='20' height='20' fill='%23ffffff'%3E%3Cpath d='M12 2l2.5 7.5H22l-6 4.5 2.5 7.5L12 17l-6.5 4.5L8 14 2 9.5h7.5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 18px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
  border: 2px solid white;
  display: none; /* Hide the star icon */
}

/* Input area */
#input-container {
  display: flex;
  align-items: center;
  padding: var(--spacing-sm) var(--spacing-md);
  background-color: white;
  border-top: 1px solid var(--neutral-border);
  box-sizing: border-box;
  position: relative;
  z-index: 10;
  width: 100%;
  transition: all var(--transition-base);
}

/* When sidebar is visible (default state) */
.main-area #input-container {
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
}

#user-input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--neutral-border);
  border-radius: 24px;
  font-size: 15px;
  resize: none;
  overflow-y: auto;
  min-height: 24px;
  max-height: 120px;
  line-height: 1.5;
  background-color: var(--neutral-bg);
  transition: all 0.2s ease;
}

#user-input {
  flex: 1;
  width: 100%;
  max-width: calc(100% - 60px); /* Account for send button */
  box-sizing: border-box;
}

#user-input:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 2px rgba(42, 96, 65, 0.1);
}

#send-btn {
  width: 42px;
  height: 42px;
  margin-left: var(--spacing-sm);
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

#send-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width var(--transition-base), height var(--transition-base);
}

#send-btn:active::before {
  width: 100%;
  height: 100%;
}

#send-btn:hover {
  background-color: var(--primary-light);
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(42, 96, 65, 0.3);
}

#send-btn:active {
  transform: scale(0.95);
}

/* Footer styling */
.footer {
  display: flex;
  justify-content: space-between;
  padding: 10px 20px;
  color: var(--neutral-text);
  opacity: 0.7;
  font-size: 12px;
  border-top: 1px solid var(--neutral-border);
  background-color: white;
}

/* Disabled states */
#user-input:disabled {
  background-color: #f0f0f0;
  cursor: not-allowed;
  opacity: 0.7;
}

#send-btn:disabled {
  background-color: #cccccc;
  cursor: not-allowed;
  opacity: 0.7;
}

/* Loading animation */
.loading-dots {
  display: inline-flex;
  align-items: center;
  padding-left: 4px;
  font-weight: 500;
  position: relative;
}

.loading-dots::after {
  content: "";
  position: relative;
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-left: 8px;
  background-color: var(--primary);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(0.8);
    opacity: 0.5;
    box-shadow:
      8px 0 0 0 rgba(42, 96, 65, 0.3),
      16px 0 0 0 rgba(42, 96, 65, 0.1);
  }
  40% {
    transform: scale(1);
    opacity: 1;
    box-shadow:
      8px 0 0 0 rgba(42, 96, 65, 0.5),
      16px 0 0 0 rgba(42, 96, 65, 0.3);
  }
  60% {
    box-shadow:
      8px 0 0 0 rgba(42, 96, 65, 0.8),
      16px 0 0 0 rgba(42, 96, 65, 0.5);
  }
  80% {
    box-shadow:
      8px 0 0 0 rgba(42, 96, 65, 0.6),
      16px 0 0 0 rgba(42, 96, 65, 0.8);
  }
}

/* Error notification */
.error-notification {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #f44336;
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  max-width: 90%;
  text-align: center;
  animation: notification-appear 0.3s ease-out;
}

.error-notification.fade-out {
  animation: notification-disappear 0.5s ease-out forwards;
}

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

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

/* Better markdown formatting in bot messages */
.bot .formatted-content {
  font-family: inherit;
  line-height: 1.6;
}

/* Message grouping divider for time-based separation */
.message-time-divider {
  text-align: center;
  margin: 24px 0 16px 0;
  position: relative;
}

.message-time-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--neutral-border), transparent);
}

.message-time-divider span {
  background-color: var(--neutral-bg);
  padding: 4px 16px;
  font-size: 12px;
  color: #999;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: relative;
  z-index: 1;
}

/* Quoted text and references with better visual distinction */
.bot .formatted-content .quoted-text,
.bot .formatted-content .reference-text {
  background-color: rgba(42, 96, 65, 0.05);
  border-left: 4px solid var(--secondary);
  padding: 12px 16px;
  margin: 16px 0;
  border-radius: 0 8px 8px 0;
  font-style: italic;
}

.bot .formatted-content .reference-text {
  background-color: rgba(212, 175, 55, 0.08);
  border-left-color: var(--primary);
}

.bot .formatted-content .reference-text::before {
  content: '📖 ';
  margin-right: 6px;
}

.bot .formatted-content strong {
  font-weight: 600;
  color: var(--neutral-text);
}

.bot .formatted-content em {
  font-style: italic;
  color: #556341;
  background-color: rgba(213, 222, 190, 0.2);
  /* padding removed - causes spaced-out characters in typing animation */
  border-radius: 2px;
}

.bot .formatted-content blockquote {
  border-left: 3px solid var(--secondary);
  margin: 12px 0;
  padding: 8px 16px;
  background-color: rgba(212, 175, 55, 0.05);
  border-radius: 4px;
}

.bot .formatted-content a {
  color: var(--primary);
  text-decoration: none;
  border-bottom: 1px dotted var(--primary);
}

/* Settings, Resources, Help, and Coping panel styles */
.settings-panel, .resources-panel, .help-panel, .coping-panel {
  position: fixed;
  top: 0;
  right: -400px;
  width: 380px;
  height: 100vh;
  background-color: white;
  box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  transition: right 0.3s ease;
  overflow-y: auto;
}

.settings-panel.show, .resources-panel.show, .help-panel.show, .coping-panel.show {
  right: 0;
}

.panel-header, .settings-header {
  background-color: var(--primary);
  color: white;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-header h3, .settings-header h3 {
  margin: 0;
  font-weight: 500;
}

.close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.close-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.panel-content, .settings-content {
  padding: 20px;
}

/* Islamic Resources - Emotion tabs */
.resources-intro {
  color: #666;
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 16px;
}

.emotion-tab {
  border: 1px solid #e8f0e8;
  border-radius: 10px;
  margin-bottom: 8px;
  overflow: hidden;
}

.emotion-tab-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  cursor: pointer;
  font-weight: 600;
  color: #2a6041;
  background: #f8faf8;
  transition: background 0.2s ease;
}

.emotion-tab-header:hover {
  background: #eef5ee;
}

.emotion-tab-arrow {
  font-size: 0.7rem;
  transition: transform 0.3s ease;
  color: #999;
}

.emotion-tab.open .emotion-tab-arrow {
  transform: rotate(90deg);
}

.emotion-tab-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.emotion-tab.open .emotion-tab-content {
  max-height: 600px;
}

.verse-item {
  padding: 12px 16px;
  border-top: 1px solid #eef3ee;
  cursor: pointer;
  transition: background 0.2s ease;
}

.verse-item:hover {
  background: #f0f7f0;
}

.verse-ref {
  display: inline-block;
  background: #e8f5e8;
  color: #2a6041;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  margin-bottom: 4px;
}

.verse-item p {
  margin: 4px 0 0 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #444;
  font-style: italic;
}

/* Dark theme - Emotion tabs */
body.theme-dark .resources-intro {
  color: #999;
}

body.theme-dark .emotion-tab {
  border-color: #333;
}

body.theme-dark .emotion-tab-header {
  background: #2a2a2a;
  color: #a8d4b8;
}

body.theme-dark .emotion-tab-header:hover {
  background: #333;
}

body.theme-dark .verse-item {
  border-top-color: #333;
}

body.theme-dark .verse-item:hover {
  background: #2a2a2a;
}

body.theme-dark .verse-ref {
  background: rgba(74, 124, 93, 0.3);
  color: #a8d4b8;
}

body.theme-dark .verse-item p {
  color: #ccc;
}

/* Coping tools panel */
.coping-intro {
  color: #666;
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 16px;
}

.coping-card {
  background: #f8faf8;
  border: 1px solid #e8f0e8;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  transition: box-shadow 0.2s ease;
}

.coping-card:hover {
  box-shadow: 0 2px 8px rgba(42, 96, 65, 0.1);
}

.coping-card-icon {
  font-size: 1.5rem;
  margin-bottom: 6px;
}

.coping-card h4 {
  margin: 0 0 8px 0;
  color: #2a6041;
  font-size: 1rem;
  font-weight: 600;
}

.coping-card p {
  margin: 0 0 10px 0;
  color: #444;
  font-size: 0.88rem;
  line-height: 1.55;
}

.coping-card em {
  color: #2a6041;
}

.coping-tag {
  display: inline-block;
  background: #e8f5e8;
  color: #2a6041;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 20px;
}

/* Coping panel dark theme */
body.theme-dark .coping-intro {
  color: #999;
}

body.theme-dark .coping-card {
  background: #2a2a2a;
  border-color: #333;
}

body.theme-dark .coping-card h4 {
  color: #a8d4b8;
}

body.theme-dark .coping-card p {
  color: #ccc;
}

body.theme-dark .coping-card em {
  color: #a8d4b8;
}

body.theme-dark .coping-tag {
  background: rgba(74, 124, 93, 0.3);
  color: #a8d4b8;
}

.setting-group {
  margin-bottom: 20px;
}

.setting-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
}

.setting-group select, .setting-group input {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--neutral-border);
  border-radius: 8px;
  font-size: 14px;
}

.settings-footer {
  padding: 20px;
  border-top: 1px solid var(--neutral-border);
  display: flex;
  justify-content: flex-end;
}

#save-settings-btn {
  padding: 10px 20px;
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

#save-settings-btn:hover {
  background-color: var(--primary-light);
}

/* Danger Zone */
.settings-danger-zone {
  padding: 20px;
  border-top: 1px solid #e74c3c33;
  margin-top: 10px;
}

.settings-danger-zone h4 {
  color: #e74c3c;
  margin: 0 0 8px 0;
  font-size: 14px;
}

.settings-danger-zone p {
  font-size: 13px;
  color: #666;
  margin: 0 0 12px 0;
  line-height: 1.4;
}

.delete-account-btn {
  background-color: transparent;
  color: #e74c3c;
  border: 1px solid #e74c3c;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.delete-account-btn:hover {
  background-color: #e74c3c;
  color: white;
}

/* Delete Confirmation Modal */
.delete-confirm-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.delete-confirm-overlay.show {
  opacity: 1;
}

.delete-confirm-modal {
  background: white;
  border-radius: 12px;
  padding: 28px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.delete-confirm-modal h3 {
  margin: 0 0 12px 0;
  color: #e74c3c;
  font-size: 18px;
}

.delete-confirm-modal p {
  font-size: 14px;
  color: #444;
  line-height: 1.5;
  margin: 0 0 12px 0;
}

#delete-confirm-input {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  margin-bottom: 16px;
  box-sizing: border-box;
  transition: border-color 0.2s ease;
}

#delete-confirm-input:focus {
  outline: none;
  border-color: #e74c3c;
}

.delete-confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.delete-cancel-btn {
  padding: 10px 20px;
  background: #f0f0f0;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #333;
}

.delete-cancel-btn:hover {
  background: #e0e0e0;
}

.delete-final-btn {
  padding: 10px 20px;
  background: #e74c3c;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: opacity 0.2s ease;
}

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

.delete-final-btn:not(:disabled):hover {
  background: #c0392b;
}

/* Dark theme overrides */
body.theme-dark .delete-confirm-modal {
  background: #1e1e1e;
}

body.theme-dark .delete-confirm-modal p {
  color: #ccc;
}

body.theme-dark #delete-confirm-input {
  background: #2a2a2a;
  border-color: #444;
  color: #eee;
}

body.theme-dark .delete-cancel-btn {
  background: #333;
  color: #eee;
}

body.theme-dark .settings-danger-zone p {
  color: #999;
}

/* Communication Style Options (Settings Panel) */
.communication-style-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
}

.style-option {
  border: 2px solid var(--neutral-border);
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  background-color: #f9f9f9;
}

.style-option:hover {
  border-color: var(--primary-light);
  background-color: rgba(42, 96, 65, 0.05);
}

.style-option.selected {
  border-color: var(--primary);
  background-color: rgba(42, 96, 65, 0.08);
  box-shadow: 0 2px 8px rgba(42, 96, 65, 0.15);
}

.style-option-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.style-radio {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #ccc;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.style-option.selected .style-radio {
  border-color: var(--primary);
  background-color: var(--primary);
  box-shadow: inset 0 0 0 3px white;
}

.style-name {
  font-weight: 600;
  color: var(--neutral-text);
  font-size: 15px;
}

.style-recommended {
  background-color: var(--secondary);
  color: var(--primary-dark);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  text-transform: uppercase;
}

.style-description {
  margin-top: 6px;
  margin-left: 28px;
  font-size: 13px;
  color: #666;
}

/* Onboarding Communication Style Selection */
.onboarding-style-section {
  margin: 20px 0;
}

.onboarding-style-section > label {
  display: block;
  margin-bottom: 12px;
  font-weight: 500;
  font-size: 15px;
  color: var(--neutral-text);
}

.onboarding-style-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.onboarding-style-option {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  border: 2px solid var(--neutral-border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  background-color: #f9f9f9;
}

.onboarding-style-option:hover {
  border-color: var(--primary-light);
  background-color: rgba(42, 96, 65, 0.05);
}

.onboarding-style-option.selected {
  border-color: var(--primary);
  background-color: rgba(42, 96, 65, 0.08);
}

.onboarding-style-option .style-radio {
  width: 16px;
  height: 16px;
  margin-right: 12px;
}

.onboarding-style-option.selected .style-radio {
  border-color: var(--primary);
  background-color: var(--primary);
  box-shadow: inset 0 0 0 3px white;
}

.onboarding-style-option .style-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.onboarding-style-option .style-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--neutral-text);
}

.onboarding-style-option .style-recommended {
  background-color: var(--secondary);
  color: var(--primary-dark);
  font-size: 9px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 8px;
}

.onboarding-style-option .style-desc {
  width: 100%;
  font-size: 12px;
  color: #666;
  margin-top: 2px;
}

/* Dark theme support for communication styles */
body.theme-dark .style-option,
body.theme-dark .onboarding-style-option {
  background-color: #333;
  border-color: #444;
}

body.theme-dark .style-option:hover,
body.theme-dark .onboarding-style-option:hover {
  background-color: rgba(42, 96, 65, 0.15);
}

body.theme-dark .style-option.selected,
body.theme-dark .onboarding-style-option.selected {
  background-color: rgba(42, 96, 65, 0.2);
}

body.theme-dark .style-name,
body.theme-dark .onboarding-style-option .style-name {
  color: #E0E0E0;
}

body.theme-dark .style-description,
body.theme-dark .onboarding-style-option .style-desc {
  color: #aaa;
}

.faq-item {
  margin-bottom: 20px;
}

.faq-item h4 {
  margin-top: 0;
  margin-bottom: 8px;
  color: var(--primary);
}

.faq-item p {
  margin: 0;
  line-height: 1.5;
}


.resource-category {
  margin-bottom: 24px;
}

.resource-category h4 {
  color: var(--primary);
  margin-bottom: 10px;
  border-bottom: 1px solid var(--neutral-border);
  padding-bottom: 8px;
}

.resource-category ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.resource-category li {
  margin-bottom: 10px;
}

.resource-category a {
  color: var(--primary);
  text-decoration: none;
  display: block;
  padding: 8px 12px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.resource-category a:hover {
  background-color: rgba(42, 96, 65, 0.08);
}

/* Theme support - Comprehensive Dark Mode */
body.theme-dark {
  --neutral-bg: #1a1a1a;
  --neutral-text: #E0E0E0;
  --neutral-border: #333333;
  --primary-dark-mode: #1a3f28;
  --primary-light-dark-mode: #225533;
  background-color: #1a1a1a;
  color: var(--neutral-text);
}

/* Dark mode backgrounds */
body.theme-dark .main-area {
  background-color: #1a1a1a;
  background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%231a3f28' fill-opacity='0.03' fill-rule='evenodd'/%3E%3C/svg%3E");
}

body.theme-dark #chatbox {
  background-color: #1a1a1a;
}

/* Darken sidebar gradient */
body.theme-dark .sidebar {
  background: linear-gradient(180deg, #0f1f18 0%, #1a3f28 60%, #0f1f18 100%);
}

/* Darken header gradient */
body.theme-dark .chat-header {
  background: linear-gradient(135deg, #0f1f18 0%, #1a3f28 50%, #0f1f18 100%);
  border-bottom-color: rgba(255, 255, 255, 0.05);
}

/* Fix message bubbles */
body.theme-dark .bot {
  background: linear-gradient(135deg, #252525 0%, #2a2a2a 100%);
  color: #E0E0E0;
  border-left-color: #4a7c5d;
}

body.theme-dark .user {
  background: linear-gradient(135deg, #1a3f28 0%, #153523 100%);
  color: #E0E0E0;
}

/* Fix input area - completely dark */
body.theme-dark #input-container {
  background-color: #1f1f1f;
  border-top-color: #2a2a2a;
}

body.theme-dark #user-input {
  background-color: #252525;
  color: #E0E0E0;
  border-color: #333333;
}

body.theme-dark #user-input:focus {
  border-color: #4a7c5d;
  box-shadow: 0 0 0 2px rgba(74, 124, 93, 0.2);
}

/* Dark theme scrollbars — applies to all scrollable elements */
body.theme-dark ::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

body.theme-dark ::-webkit-scrollbar-track {
  background: transparent;
}

body.theme-dark ::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
}

body.theme-dark ::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

body.theme-dark #send-btn {
  background-color: #1a3f28;
}

body.theme-dark #send-btn:hover {
  background-color: #225533;
}

/* Fix footer */
body.theme-dark .footer {
  background-color: #1f1f1f;
  border-top-color: #2a2a2a;
  color: #888;
}

/* Fix panels and modals */
body.theme-dark .settings-panel,
body.theme-dark .resources-panel,
body.theme-dark .help-panel,
body.theme-dark .coping-panel {
  background-color: #1f1f1f;
}

body.theme-dark .panel-header,
body.theme-dark .settings-header {
  background-color: #1a3f28;
}

body.theme-dark .panel-content,
body.theme-dark .settings-content {
  background-color: #1f1f1f;
}

body.theme-dark .setting-group select,
body.theme-dark .setting-group input,
body.theme-dark .setting-group textarea {
  background-color: #252525;
  border-color: #333333;
  color: #E0E0E0;
}

/* Fix buttons */
body.theme-dark .todays-conversation-btn {
  background: rgba(26, 63, 40, 0.3);
  border-color: rgba(255, 255, 255, 0.15);
}

body.theme-dark .todays-conversation-btn:hover {
  background: rgba(26, 63, 40, 0.5);
}

body.theme-dark .todays-conversation-btn.active {
  background: linear-gradient(135deg, rgba(74, 124, 93, 0.4), rgba(74, 124, 93, 0.2));
  border-color: #4a7c5d;
}

body.theme-dark .new-chat {
  background-color: rgba(26, 63, 40, 0.2);
  border-color: rgba(255, 255, 255, 0.15);
}

body.theme-dark .new-chat:hover {
  background-color: rgba(34, 85, 51, 0.4);
}

/* Fix past conversation items */
body.theme-dark .past-conversation-item {
  background-color: rgba(255, 255, 255, 0.03);
}

body.theme-dark .past-conversation-item:hover {
  background-color: rgba(255, 255, 255, 0.08);
}

/* Fix message counter */
body.theme-dark .daily-message-counter {
  background-color: #252525;
  color: #aaa;
}

body.theme-dark .message-counter {
  color: #aaa;
}

/* Fix scrollbars */
body.theme-dark .sidebar::-webkit-scrollbar-track,
body.theme-dark .conversations-list::-webkit-scrollbar-track,
body.theme-dark .past-conversations-list::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

body.theme-dark .sidebar::-webkit-scrollbar-thumb,
body.theme-dark .conversations-list::-webkit-scrollbar-thumb,
body.theme-dark .past-conversations-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
}

/* Fix formatted content */
body.theme-dark .bot .formatted-content strong {
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
}


/* Fix notification colors */
body.theme-dark .notification-info {
  background-color: #1a3f28;
}

/* Fix limit reached banner */
body.theme-dark .limit-reached-banner {
  background-color: #252525;
}

body.theme-dark .limit-reached-content p {
  color: #aaa;
}

/* Fix past conversation indicator */
body.theme-dark .past-conversation-indicator {
  background-color: rgba(255, 255, 255, 0.03);
}

/* Font size support */
body.font-small {
  font-size: 14px;
}

body.font-medium {
  font-size: 16px;
}

body.font-large {
  font-size: 18px;
}

/* Responsive design adjustments */
@media (max-width: 768px) {
  .chat-header {
    padding: 8px 10px;
  }

  .chat-header h2 {
    font-size: 0.95rem;
  }
  
  .logo {
    width: 24px; /* Smaller logo */
    height: 24px;
    margin-right: 6px; /* Less spacing */
  }
  
  .logo svg {
    width: 16px; /* Smaller icon within logo */
    height: 16px;
  }
  
  .header-controls {
    gap: 5px; /* Less space between control buttons */
  }
  
  .icon-btn {
    width: 28px; /* Smaller buttons */
    height: 28px;
  }
  
  .subscription-badge {
    font-size: 10px; /* Smaller badge text */
    padding: 2px 6px;
    height: 16px;
    margin-left: 4px;
  }
  
  .upgrade-header-btn {
    padding: 4px 10px;
    font-size: 10px;
    margin-right: 5px;
  }
}

/* Mobile specific styling */
@media (max-width: 900px) {
  .sidebar-toggle {
    display: flex; /* Always visible on mobile */
    left: 0; /* Reset left position on mobile */
  }

  .app-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    height: 100%;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-sizing: border-box;
  }

  .main-area {
    margin-left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  #chatbot-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
  }

  .chat-header {
    flex-shrink: 0;
    z-index: 10;
  }

  #chatbox {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
  }

  #input-container {
    flex-shrink: 0;
    z-index: 10;
    background-color: white;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  
  /* Sidebar is hidden by default on mobile */
  .sidebar {
    display: flex !important;
    transform: translateX(-100%);
    width: 250px;
  }
  
  /* Show sidebar when expanded class is added */
  .app-container.sidebar-expanded .sidebar {
    transform: translateX(0);
  }
  
  /* Add overlay when sidebar is open on 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: 99;
    transition: opacity 0.3s ease;
    opacity: 0;
  }
  
  .app-container.sidebar-expanded .sidebar-overlay {
    display: block;
    opacity: 1;
  }
  
  /* Prevent horizontal scrolling */
  #chatbox {
    max-width: 100%;
    width: 100%;
    padding: 8px 6px;
    overflow-x: hidden;
    box-sizing: border-box;
    gap: 6px;
  }

  #input-container {
    max-width: 100%;
    width: 100%;
    padding: 6px 8px;
    box-sizing: border-box;
  }

  /* Messages fit viewport with less padding */
  .message {
    max-width: 100%;
    width: calc(100% - 12px);
    margin-left: 6px;
    margin-right: 6px;
    margin-top: 2px;
    margin-bottom: 2px;
    padding: 10px 12px;
    font-size: 14px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    box-sizing: border-box;
  }

  .bot {
    max-width: 100%;
    width: calc(100% - 12px);
    padding-left: 12px;
    box-sizing: border-box;
  }

  .user {
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Input prevents zoom on mobile (font-size >= 16px) */
  #user-input {
    font-size: 16px !important;
    -webkit-text-size-adjust: 100%;
    padding: 8px 12px;
    max-width: 100%;
    box-sizing: border-box;
    min-height: 20px;
    max-height: 100px;
  }
  
  /* Hide bot avatar on mobile to save space */
  .bot::after {
    display: none;
  }
}

@media (max-width: 480px) {
  .chat-header h2 {
    font-size: 1rem;
  }

  #input-container {
    padding: 10px 8px;
  }
  
  /* CRITICAL: Keep font-size at 16px to prevent zoom */
  #user-input {
    padding: 10px 12px;
    font-size: 16px !important; /* Must be 16px+ to prevent mobile zoom */
    -webkit-text-size-adjust: 100%; /* Prevent iOS text size adjustment */
    max-width: calc(100% - 54px); /* Account for send button */
  }
  
  #send-btn {
    width: 38px;
    height: 38px;
    margin-left: 8px;
  }
  
  .bot::before {
    display: none; /* Hide avatar on very small screens */
  }
  
  /* Ensure messages fit properly */
  .message {
    padding: 12px;
    font-size: 15px; /* Slightly smaller for readability */
    max-width: 100%;
    width: calc(100% - 16px);
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
  
  .onboarding-content {
    padding: 20px;
  }
  
  .mode-btn .mode-icon {
    width: 32px;
    height: 32px;
  }
  
  /* Ensure chatbox prevents horizontal scroll */
  #chatbox {
    padding: var(--spacing-sm) 4px;
    overflow-x: hidden;
  }
}


/* Enhanced Authentication Modal Styles */
.auth-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  backdrop-filter: blur(5px);
}

.auth-modal.show {
  opacity: 1;
  visibility: visible;
}

.auth-modal-content {
  background-color: white;
  border-radius: 16px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  transform: translateY(20px);
  transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1);
  position: relative;
}

.auth-modal.show .auth-modal-content {
  transform: translateY(0);
}

/* Decorative Islamic pattern overlay */
.auth-modal-content::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 120px;
  height: 120px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 80' width='80' height='80'%3E%3Cpath fill='none' stroke='%232A6041' stroke-width='1' opacity='0.2' d='M30 10L15 30 30 50 15 70M50 10L65 30 50 50 65 70M30 10L50 10M15 30L65 30M30 50L50 50M15 70L65 70'/%3E%3C/svg%3E");
  opacity: 0.5;
  pointer-events: none;
}

.auth-modal-header {
  background: linear-gradient(135deg, var(--primary) 0%, #1a3f2a 100%);
  color: white;
  padding: 22px 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

.auth-modal-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--secondary) 0%, rgba(212, 175, 55, 0.4) 100%);
}

.auth-modal-header h3 {
  margin: 0;
  font-weight: 500;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
}

/* Add a small icon before the title */
.auth-modal-header h3::before {
  content: '';
  display: inline-block;
  width: 24px;
  height: 24px;
  margin-right: 10px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24' fill='%23ffffff'%3E%3Cpath d='M12 1L9 9H2l5.5 4L5 22l7-5 7 5-2.5-9L22 9h-7l-3-8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

.auth-modal-body {
  padding: 25px;
  position: relative;
}

.auth-error {
  color: #f44336;
  margin-bottom: 15px;
  font-size: 14px;
  background-color: rgba(244, 67, 54, 0.05);
  border-left: 3px solid #f44336;
  padding: 8px 12px;
  border-radius: 0 4px 4px 0;
}

.form-group {
  margin-bottom: 18px;
  position: relative;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #555;
}

.form-control {
  display: block;
  width: 100%;
  padding: 12px 15px;
  font-size: 15px;
  background-color: #f8f9fa;
  border: 1px solid #e7e7e7;
  border-radius: 10px;
  box-sizing: border-box;
  transition: all 0.25s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(42, 96, 65, 0.1);
  background-color: white;
}

.auth-button {
  background: linear-gradient(to right, var(--primary), var(--primary-light));
  color: white;
  border: none;
  border-radius: 10px;
  padding: 14px;
  width: 100%;
  font-weight: 500;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 6px rgba(42, 96, 65, 0.1);
  position: relative;
  overflow: hidden;
}

.auth-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(42, 96, 65, 0.15);
}

.auth-button:before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: 0.5s;
}

.auth-button:hover:before {
  left: 100%;
}

.auth-button:disabled {
  background: #cccccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.auth-alt-option {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: #666;
}

.auth-alt-option a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.25s ease;
}

.auth-alt-option a:hover {
  color: var(--primary-light);
  text-decoration: underline;
}

.auth-separator {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 25px 0;
}

.auth-separator::before,
.auth-separator::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--neutral-border);
}

.auth-separator span {
  padding: 0 10px;
  background-color: white;
  color: #777;
  font-size: 14px;
  position: relative;
  top: 2px;
}

.google-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background-color: white;
  color: #444;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 12px;
  width: 100%;
  font-weight: 500;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.google-button:hover {
  background-color: #f5f5f5;
  border-color: #ccc;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Close button styling */
.close-btn {
  background: transparent;
  border: none;
  color: white;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.8;
  transition: all 0.2s ease;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.close-btn:hover {
  opacity: 1;
  background-color: rgba(255, 255, 255, 0.1);
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .auth-modal-content {
    width: 95%;
    max-width: 350px;
  }
  
  .auth-modal-header {
    padding: 18px 20px;
  }
  
  .auth-modal-body {
    padding: 20px;
  }
  
  .form-control {
    padding: 10px 12px;
  }
  
  .auth-button {
    padding: 12px;
  }
}

/* Dark theme support */
body.theme-dark .auth-modal-content {
  background-color: #2C2C2C;
}

body.theme-dark .form-control {
  background-color: #3A3A3A;
  border-color: #444444;
  color: #E0E0E0;
}

body.theme-dark .form-control:focus {
  background-color: #333333;
}

body.theme-dark .auth-separator span {
  background-color: #2C2C2C;
  color: #BBBBBB;
}

body.theme-dark .form-group label {
  color: #CCCCCC;
}

body.theme-dark .auth-alt-option {
  color: #AAAAAA;
}

body.theme-dark .google-button {
  background-color: #333333;
  color: #E0E0E0;
  border-color: #444444;
}

body.theme-dark .google-button:hover {
  background-color: #3D3D3D;
}

/* Subscription Badge Styles */
.subscription-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  margin-left: 8px;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  height: 16px;
}

.subscription-badge.free {
  background-color: rgba(100, 100, 100, 0.1);
  color: #777;
}

.subscription-badge.premium {
  background-color: rgba(212, 175, 55, 0.2);
  color: #b38b24;
}

.subscription-badge.pro {
  background-color: rgba(42, 96, 65, 0.2);
  color: var(--primary);
}

/* Message Limit Warning */
.message-limit-warning {
  background-color: rgba(255, 166, 0, 0.1);
  border-left: 3px solid orange;
  margin: 10px 20px;
  padding: 10px 15px;
  border-radius: 0 8px 8px 0;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
}

.message-limit-warning.show {
  opacity: 1;
  transform: translateY(0);
}

.message-limit-warning .warning-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.message-limit-warning p {
  margin: 0;
  font-size: 14px;
}

.upgrade-now-btn {
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.upgrade-now-btn:hover {
  background-color: var(--primary-light);
  transform: translateY(-1px);
}

/* Subscription Modal */
.subscription-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  backdrop-filter: blur(5px);
}

.subscription-modal.show {
  opacity: 1;
  visibility: visible;
}

.subscription-modal-content {
  background-color: white;
  border-radius: 16px;
  width: 90%;
  max-width: 800px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  transform: translateY(20px);
  transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

.subscription-modal.show .subscription-modal-content {
  transform: translateY(0);
}

.subscription-modal-header {
  background: linear-gradient(135deg, var(--primary) 0%, #1a3f2a 100%);
  color: white;
  padding: 22px 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.subscription-modal-header h3 {
  margin: 0;
  font-weight: 500;
  font-size: 1.25rem;
}

.subscription-modal-body {
  padding: 25px;
  max-height: 70vh;
  overflow-y: auto;
}

/* Plan comparison styles */
.plan-comparison {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

.plan {
  flex: 1;
  min-width: 220px;
  max-width: 280px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  position: relative;
  background-color: white;
}

.plan:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.plan-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background-color: var(--secondary);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 10px;
}

.plan-header {
  padding: 20px;
  background-color: #f8f9fa;
  border-bottom: 1px solid #eee;
  text-align: center;
}

.free-plan .plan-header {
  background-color: #f8f9fa;
}

.premium-plan .plan-header {
  background-color: rgba(212, 175, 55, 0.1);
}

.pro-plan .plan-header {
  background-color: rgba(42, 96, 65, 0.1);
}

.plan-header h4 {
  margin: 0 0 10px 0;
  font-size: 18px;
}

.plan-price {
  font-size: 24px;
  font-weight: 700;
}

.plan-price span {
  font-size: 14px;
  font-weight: 400;
  opacity: 0.7;
}

.plan-features {
  list-style-type: none;
  padding: 20px;
  margin: 0;
}

.plan-features li {
  margin-bottom: 12px;
  padding-left: 24px;
  position: relative;
}

.plan-features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: bold;
}

.plan-footer {
  padding: 15px 20px 20px;
  text-align: center;
}

.upgrade-btn {
  background: linear-gradient(to right, var(--primary), var(--primary-light));
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  width: 100%;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.upgrade-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(42, 96, 65, 0.2);
}

.upgrade-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.current-plan {
  color: var(--primary);
  font-weight: 600;
  font-size: 14px;
}

.manage-subscription-btn {
  margin-top: 10px;
  background-color: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
  border-radius: 8px;
  padding: 8px 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.manage-subscription-btn:hover {
  background-color: rgba(42, 96, 65, 0.05);
}

/* Dark theme support */
body.theme-dark .subscription-modal-content {
  background-color: #2C2C2C;
}

body.theme-dark .plan {
  background-color: #333;
}

body.theme-dark .plan-header {
  background-color: #3a3a3a;
  border-color: #444;
}

body.theme-dark .free-plan .plan-header {
  background-color: #3a3a3a;
}

body.theme-dark .premium-plan .plan-header {
  background-color: rgba(212, 175, 55, 0.15);
}

body.theme-dark .pro-plan .plan-header {
  background-color: rgba(42, 96, 65, 0.15);
}

body.theme-dark .current-plan {
  color: #8abb9c;
}

body.theme-dark .manage-subscription-btn {
  color: #8abb9c;
  border-color: #8abb9c;
}

body.theme-dark .manage-subscription-btn:hover {
  background-color: rgba(138, 187, 156, 0.1);
}

/* Mobile responsive design */
@media (max-width: 768px) {
  .subscription-modal-content {
    width: 95%;
  }
  
  .plan-comparison {
    flex-direction: column;
    align-items: center;
  }
  
  .plan {
    max-width: 100%;
    width: 100%;
  }
  
  .message-limit-warning .warning-content {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .message-limit-warning .upgrade-now-btn {
    margin-top: 8px;
  }
}

/* Upgrade button in header */
.upgrade-header-btn {
  background: linear-gradient(135deg, var(--secondary) 0%, #f0d060 100%);
  color: #1e4430;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 20px;
  padding: 6px 16px;
  margin-right: 10px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 12px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  box-shadow: 0 2px 8px rgba(212, 175, 55, 0.3);
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1;
}

.upgrade-header-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(212, 175, 55, 0.45);
  background: linear-gradient(135deg, #f0d060 0%, var(--secondary) 100%);
}

.upgrade-header-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(212, 175, 55, 0.3);
}

/* Dark mode upgrade button */
body.theme-dark .upgrade-header-btn {
  background: linear-gradient(135deg, var(--secondary) 0%, #c9a834 100%);
  color: #0f1f18;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 8px rgba(212, 175, 55, 0.25);
}

body.theme-dark .upgrade-header-btn:hover {
  box-shadow: 0 4px 16px rgba(212, 175, 55, 0.4);
}

/* Mobile upgrade button */
@media (max-width: 768px) {
  .upgrade-header-btn {
    padding: 5px 12px;
    font-size: 10px;
    border-radius: 16px;
    margin-right: 5px;
    letter-spacing: 0.3px;
  }
}

/* Enhanced subscription badge */
.subscription-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
  margin-left: 8px;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  height: 20px;
  text-transform: uppercase;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.subscription-badge.free {
  background-color: #276e04;
  color: #44bb08;
}

.subscription-badge.premium {
  background-color: rgba(212, 175, 55, 0.25);
  color: #b38b24;
  border: 1px solid rgba(212, 175, 55, 0.4);
}

.subscription-badge.pro {
  background-color: rgba(212, 175, 55, 0.25);
  color: #b38b24;
  border: 1px solid rgba(212, 175, 55, 0.4);
}

/* Message counter styles */
.message-counter {
  margin: 0 20px;
  padding: 8px 0;
  color: #666;
  font-size: 13px;
  display: flex;
  justify-content: flex-end;
  transition: all 0.3s ease;
}

.message-counter.low {
  color: #e67e22;
}

.count-warning {
  color: #e67e22;
  font-weight: 500;
}

.count-label {
  color: #888;
  margin-right: 5px;
}

/* Add styles for when sidebar is collapsed on desktop */
.app-container.sidebar-collapsed .sidebar {
  transform: translateX(-100%);
}

/* Add styles for when sidebar is collapsed on desktop */
.app-container.sidebar-collapsed .sidebar {
  transform: translateX(-100%);
}

/* Content centering when sidebar is collapsed */
#chatbox, #input-container {
  transition: max-width 0.3s ease, margin 0.3s ease;
}

.app-container.sidebar-collapsed #chatbox,
.app-container.sidebar-collapsed #input-container {
  width: 100%;
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
  box-sizing: border-box;
  padding-left: 20px;
  padding-right: 20px;
  transition: all 0.3s ease;
}

.app-container.sidebar-collapsed .message {
  max-width: 700px;
}


/* Responsive design adjustments - update the mobile media query */
@media (max-width: 900px) {
  /* Override the display:none for sidebar on mobile */
  .sidebar {
    display: flex !important; /* Force display */
    transform: translateX(-100%); /* Hidden by default */
    width: 250px;
  }
  
  /* Main area should start with no left margin on mobile */
  .main-area {
    margin-left: 0;
  }
  
  /* Show sidebar when expanded class is added */
  .app-container.sidebar-expanded .sidebar {
    transform: translateX(0); /* Show sidebar */
  }
  
  /* Add overlay when sidebar is open on 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: 99; /* Below sidebar but above everything else */
    transition: opacity 0.3s ease;
    opacity: 0;
  }
  
  .app-container.sidebar-expanded .sidebar-overlay {
    display: block;
    opacity: 1;
  }
  
  /* Keep these existing mobile styles */
  .settings-panel, .resources-panel, .help-panel, .coping-panel {
    width: 100%;
    right: -100%;
  }
  
  /* IMPROVED ONBOARDING CONTAINER FOR MOBILE */
  #onboarding-container {
    width: 90%;
    max-width: 500px;
    /* Keep the absolute positioning and center transform */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    /* Remove any height constraints */
    height: auto;
    max-height: 90vh;
    overflow-y: auto;
  }
  
  .onboarding-header h2 {
    font-size: 1.3rem;
  }
  
  .mode-btn {
    padding: 14px 16px;
  }
  
  .mode-btn .mode-icon {
    width: 36px;
    height: 36px;
  }
  
  .mode-btn .mode-description {
    font-size: 12px;
  }
  
  #chatbox {
    padding: 15px 10px;
  }
  
  .bot::before {
    left: -35px;
    width: 28px;
    height: 28px;
  }
}

/* Very small screens */
/* Even smaller for very small screens */
@media (max-width: 480px) {
  .chat-header h2 {
    font-size: 0.9rem;
  }
  
  /* Hide or further reduce elements if needed */
  .subscription-badge {
    padding: 2px 4px;
    font-size: 9px;
  }
  
  .sidebar-toggle {
    width: 32px;
    height: 32px;
  }
  
  .sidebar-toggle svg {
    width: 20px;
    height: 20px;
  }
}

/* Sidebar scrolling for mobile devices */
@media (max-width: 900px) {
  .sidebar {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    max-height: 100dvh;
    max-height: 100vh;
    padding-bottom: 30px; /* Add some padding at the bottom */
  }
  
  /* Prevent content from being hidden behind bottom navigation bars on mobile */
  .bottom-nav {
    margin-top: 20px;
    padding-bottom: 20px;
  }
}

/* Conversation list styling */
.conversations-list {
  margin: 10px 0 20px 0;
  max-height: 50vh;
  overflow-y: auto;
}

.conversations-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.7;
  padding: 0 15px;
  margin: 15px 0 8px 0;
}

.conversation-item {
  padding: 10px 15px;
  border-radius: 8px;
  margin: 2px 0;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-item:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.conversation-item.selected {
  background-color: rgba(255, 255, 255, 0.15);
  font-weight: 500;
}

.conversation-title {
  font-size: 14px;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conversation-date {
  font-size: 11px;
  opacity: 0.7;
}

/* Context menu for conversations */
.context-menu {
  position: absolute;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  z-index: 1000;
}

.menu-item {
  padding: 10px 15px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.menu-item:hover {
  background-color: #f5f5f5;
}

/* For dark theme */
body.theme-dark .context-menu {
  background-color: #333;
}

body.theme-dark .menu-item:hover {
  background-color: #444;
}

/* Notification styling */
.notification {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 20px;
  border-radius: 8px;
  color: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  max-width: 90%;
  text-align: center;
  animation: notification-appear 0.3s ease-out;
}

.notification-info {
  background-color: var(--primary);
}

.notification-warning {
  background-color: #e67e22;
}

.notification-error {
  background-color: #e74c3c;
}

.notification-success {
  background-color: #2ecc71;
}

.notification.fade-out {
  animation: notification-disappear 0.5s ease-out forwards;
}


/* Side bar conversations styles */
/* Conversation section in sidebar */
.conversations-container {
  margin: 15px 0;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.conversations-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.7;
  padding: 0 15px;
  margin-bottom: 8px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
}

.conversations-list {
  max-height: 40vh;
  overflow-y: auto;
  margin: 0;
  padding: 0 10px;
}

.empty-conversations {
  padding: 10px 5px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  font-style: italic;
  text-align: center;
}

.conversation-item {
  padding: 10px 15px;
  border-radius: 8px;
  margin: 4px 0;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  background-color: rgba(255, 255, 255, 0.05);
}

.conversation-item:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.conversation-item.selected {
  background-color: rgba(255, 255, 255, 0.15);
  border-left: 3px solid var(--secondary);
}

.conversation-title {
  font-size: 14px;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: 20px; /* Space for delete button */
}

.conversation-date {
  font-size: 11px;
  opacity: 0.7;
}

.conversation-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.conversation-item:hover .conversation-actions {
  opacity: 1;
}

.delete-conversation {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 18px;
  line-height: 1;
  padding: 2px 6px;
  cursor: pointer;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.delete-conversation:hover {
  background-color: rgba(255, 0, 0, 0.2);
  color: rgba(255, 255, 255, 0.9);
}

/* Notification styling */
.notification {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 20px;
  border-radius: 8px;
  color: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  max-width: 90%;
  text-align: center;
  animation: notification-appear 0.3s ease-out;
}

.notification-info {
  background-color: var(--primary);
}

.notification-warning {
  background-color: #e67e22;
}

.notification-error {
  background-color: #e74c3c;
}

.notification-success {
  background-color: #2ecc71;
}

.notification.fade-out {
  animation: notification-disappear 0.5s ease-out forwards;
}

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

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

/* Scrollbar styling for conversation list */
.conversations-list::-webkit-scrollbar {
  width: 6px;
}

.conversations-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

.conversations-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
}

.conversations-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Login Page Styles */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background-color: var(--neutral-bg);
  background-image: url("data:image/svg+xml,%3Csvg width='120' height='120' viewBox='0 0 120 120' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M9 0h2v20H9V0zm25.134.84l1.732 1-10 17.32-1.732-1 10-17.32zm-20 20l1.732 1-10 17.32-1.732-1 10-17.32zM58.16 4.134l1 1.732-17.32 10-1-1.732 17.32-10zm-40 40l1 1.732-17.32 10-1-1.732 17.32-10zM80 9v2H60V9h20zM20 69v2H0v-2h20zm79.32-55l-1 1.732-17.32-10L82 4l17.32 10zm-80 80l-1 1.732-17.32-10L2 84l17.32 10zm96.546-75.84l-1.732 1-10-17.32 1.732-1 10 17.32zm-100 100l-1.732 1-10-17.32 1.732-1 10 17.32zM38.16 24.134l1 1.732-17.32 10-1-1.732 17.32-10zM60 29v2H40v-2h20zm19.32 5l-1 1.732-17.32-10L62 24l17.32 10zm16.546 4.16l-1.732 1-10-17.32 1.732-1 10 17.32zM111 40h-2V20h2v20zm3.134.84l1.732 1-10 17.32-1.732-1 10-17.32zM40 49v2H20v-2h20zm19.32 5l-1 1.732-17.32-10L42 44l17.32 10zm-40 40l-1 1.732-17.32-10L2 84l17.32 10zm39.32-30l-1 1.732-17.32-10L22 54l17.32 10zm80 30l-1 1.732-17.32-10L102 84l17.32 10zm-80-50l-1 1.732-17.32-10L22 34l17.32 10zm-40 40l-1 1.732-17.32-10L2 64l17.32 10zm99.32-70l-1 1.732-17.32-10L102 24l17.32 10zM119 40h-2V20h2v20zm0 20h-2V40h2v20zm0 20h-2V60h2v20z' fill='%232A6041' fill-opacity='0.03' fill-rule='evenodd'/%3E%3C/svg%3E");
}

.login-container {
  width: 90%;
  max-width: 450px;
  background-color: white;
  border-radius: 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: fadeIn 0.5s ease-out;
}

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

.login-header {
  background-color: var(--primary);
  color: white;
  padding: 30px 20px;
  text-align: center;
  position: relative;
}

.login-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--secondary) 0%, rgba(212, 175, 55, 0.4) 100%);
}

.login-header h1 {
  margin: 0 0 10px 0;
  font-weight: 500;
  font-size: 2rem;
}

.login-header p {
  margin: 0;
  opacity: 0.9;
  font-size: 1rem;
}

.login-content {
  padding: 30px;
}

.login-footer {
  padding: 15px 20px;
  text-align: center;
  border-top: 1px solid var(--neutral-border);
  font-size: 0.8rem;
  color: #777;
}

.auth-form-container {
  animation: slideUp 0.4s ease-out;
}

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

.auth-form-container h2 {
  margin: 0 0 20px 0;
  font-weight: 500;
  color: var(--neutral-text);
  text-align: center;
}

.auth-form {
  margin-bottom: 20px;
}

.auth-alt-options {
  text-align: center;
  margin: 15px 0;
  font-size: 0.9rem;
}

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  backdrop-filter: blur(5px);
  color: white;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
  margin-bottom: 15px;
}

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

/* Dark theme support for login page */
body.theme-dark .login-container {
  background-color: #2C2C2C;
}

body.theme-dark .login-footer {
  border-color: #444;
  color: #aaa;
}

body.theme-dark .auth-form-container h2 {
  color: #eee;
}

/* Mode Selection Modal Styles - Exactly matching screenshots */
.mode-selection-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000; /* Ensure it's above all other elements */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mode-selection-modal.show {
  opacity: 1;
  visibility: visible;
}

.mode-selection-modal-content {
  background-color: white;
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.mode-selection-modal.show .mode-selection-modal-content {
  transform: translateY(0);
}

.mode-selection-modal-header {
  background-color: var(--primary);
  color: white;
  padding: 25px 20px;
  text-align: center;
}

.mode-selection-modal-header h2 {
  margin: 0 0 10px 0;
  font-size: 26px;
  font-weight: 500;
}

.mode-selection-modal-header p {
  margin: 0;
  font-size: 14px;
  opacity: 0.95;
  line-height: 1.4;
}

.mode-selection-modal-body {
  padding: 25px;
}

.mode-selection-modal-body h3 {
  margin: 0 0 8px 0;
  font-size: 20px;
  font-weight: 500;
  text-align: center;
  color: #333;
}

.mode-selection-modal-body > p {
  text-align: center;
  color: #666;
  margin: 0 0 16px 0;
  font-size: 14px;
}

.privacy-warning {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #fef9e7;
  border-left: 3px solid #d4af37;
  padding: 10px 14px;
  border-radius: 0 8px 8px 0;
  margin-bottom: 18px;
  font-size: 12.5px;
  color: #6b5c00;
  line-height: 1.4;
}

.privacy-warning svg {
  flex-shrink: 0;
  margin-top: 1px;
  stroke: #d4af37;
}

body.theme-dark .privacy-warning {
  background: rgba(212, 175, 55, 0.1);
  color: #e9c662;
  border-left-color: #d4af37;
}

body.theme-dark .privacy-warning svg {
  stroke: #e9c662;
}

.allah-reminder {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #e8f5ee;
  border-left: 3px solid #2A6041;
  padding: 10px 14px;
  border-radius: 0 8px 8px 0;
  margin-bottom: 18px;
  font-size: 12.5px;
  color: #1e4430;
  line-height: 1.4;
}

.allah-reminder svg {
  flex-shrink: 0;
  margin-top: 1px;
  stroke: #2A6041;
}

body.theme-dark .allah-reminder {
  background: rgba(42, 96, 65, 0.15);
  color: #7dcfa4;
  border-left-color: #3A8C61;
}

body.theme-dark .allah-reminder svg {
  stroke: #7dcfa4;
}

/* Mode options styling to match your screenshot */
.mode-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.mode-option {
  display: flex;
  align-items: center;
  padding: 16px;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  background-color: #f9f9f9;
}

.mode-option:hover {
  border-color: var(--primary);
  background-color: rgba(42, 96, 65, 0.05);
}

.mode-option.selected {
  border-color: var(--primary);
  background-color: rgba(42, 96, 65, 0.1);
}

.mode-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: #ededed;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 16px;
}

.mode-icon svg {
  width: 24px;
  height: 24px;
  fill: var(--primary);
}

.mode-text {
  display: flex;
  flex-direction: column;
}

.mode-title {
  margin-bottom: 4px;
  font-size: 17px;
  font-weight: 600;
  color: var(--primary);
}

.mode-description {
  font-size: 14px;
  color: #666;
}

/* Name field styling to match screenshot */
.name-field {
  margin: 20px 0;
}

.name-field label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  font-size: 15px;
}

.name-field input {
  width: 100%;
  padding: 14px 15px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 15px;
  background-color: #f9f9f9;
}

.name-field input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(42, 96, 65, 0.1);
}

/* Button styling to match screenshot */
.start-chat-btn {
  width: 100%;
  margin-top: 15px;
  padding: 14px 0;
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.start-chat-btn:hover:not([disabled]) {
  background-color: var(--primary-light);
}

.start-chat-btn:disabled {
  background-color: #cccccc;
  cursor: not-allowed;
  opacity: 0.7;
}

/* Dark theme support */
body.theme-dark .mode-selection-modal-content {
  background-color: #2C2C2C;
}

body.theme-dark .mode-option {
  border-color: #444;
  background-color: #333;
}

body.theme-dark .mode-option:hover {
  background-color: rgba(42, 96, 65, 0.15);
}

body.theme-dark .mode-option.selected {
  background-color: rgba(42, 96, 65, 0.2);
}

body.theme-dark .mode-icon {
  background-color: #444;
}

body.theme-dark .mode-description {
  color: #aaa;
}

body.theme-dark .name-field input {
  background-color: #333;
  border-color: #444;
  color: #eee;
}

body.theme-dark .mode-selection-modal-body h3 {
  color: #eee;
}

.auth-modal {
  z-index: 3500 !important;
}

.mode-selection-modal {
  z-index: 3000 !important; /* Very high z-index */
}

.mode-selection-modal.show {
  display: flex !important;
  opacity: 1;
  visibility: visible;
}

/* Force hide onboarding */
#onboarding-container {
  display: none !important;
}

/* Ensure auth modal has highest priority */
.auth-modal {
  z-index: 3500 !important;
}

.new-chat.disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background-color: rgba(255, 255, 255, 0.05);
}

.new-chat.disabled:hover {
  background-color: rgba(255, 255, 255, 0.05);
  transform: none;
}

.mode-options.highlight-required {
  animation: pulse-highlight 1.5s ease;
}

@keyframes pulse-highlight {
  0%, 100% { box-shadow: 0 0 0 0 rgba(42, 96, 65, 0); }
  50% { box-shadow: 0 0 0 6px rgba(42, 96, 65, 0.3); }
}


.guidance-notification {
  background-color: var(--primary);
  padding: 15px 20px;
  max-width: 400px;
  text-align: left;
}

.guidance-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.guidance-content p {
  margin: 0;
  color: white;
}

.start-new-chat-btn {
  background-color: white;
  color: var(--primary);
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-weight: 500;
  cursor: pointer;
  align-self: flex-start;
  transition: all 0.2s ease;
}

.start-new-chat-btn:hover {
  background-color: var(--secondary);
  color: var(--primary-dark);
  transform: translateY(-2px);
}

/* Make the user input field visually disabled in welcome screen mode */
.input-disabled {
  background-color: #f0f0f0 !important;
  cursor: not-allowed !important;
  opacity: 0.7 !important;
}

/* For dark theme */
body.theme-dark .input-disabled {
  background-color: #333 !important;
}

/* Ensure the notification stands out on mobile */
@media (max-width: 768px) {
  .guidance-notification {
    max-width: 90%;
  }
}

/* Add to your styles.css file */
.setting-group textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--neutral-border);
  border-radius: 8px;
  font-size: 14px;
  min-height: 80px;
  resize: vertical;
  font-family: inherit;
}

.setting-group textarea:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 2px rgba(42, 96, 65, 0.1);
}

/* Dark theme support */
body.theme-dark .setting-group textarea {
  background-color: #2C2C2C;
  color: var(--neutral-text);
  border-color: #444444;
}

/* Memory feature indicator */
.memory-status-indicator {
  display: inline-flex;
  align-items: center;
  margin-left: 10px;
  background-color: rgba(212, 175, 55, 0.15);
  border-radius: 12px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  color: #b38b24;
  animation: pulse-memory 2s infinite;
}

.memory-status-indicator svg {
  margin-right: 4px;
  stroke: #b38b24;
}

@keyframes pulse-memory {
  0% {
    opacity: 0.8;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.8;
  }
}

/* Premium feature badge for memory */
.memory-premium-badge {
  display: inline-flex;
  align-items: center;
  background-color: rgba(212, 175, 55, 0.2);
  color: #b38b24;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: 6px;
}

/* Dark theme support */
body.theme-dark .memory-status-indicator {
  background-color: rgba(212, 175, 55, 0.2);
  color: #d4b654;
}

body.theme-dark .memory-status-indicator svg {
  stroke: #d4b654;
}

body.theme-dark .memory-premium-badge {
  background-color: rgba(212, 175, 55, 0.25);
  color: #d4b654;
}

/* Memory feature indicator */
.memory-status-indicator {
  display: inline-flex;
  align-items: center;
  margin-left: 10px;
  background-color: rgba(212, 175, 55, 0.15);
  border-radius: 12px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  color: #b38b24;
  animation: pulse-memory 2s infinite;
}

.memory-status-indicator svg {
  margin-right: 4px;
  stroke: #b38b24;
}

@keyframes pulse-memory {
  0% {
    opacity: 0.8;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.8;
  }
}

/* Premium feature badge for memory */
.memory-premium-badge {
  display: inline-flex;
  align-items: center;
  background-color: rgba(212, 175, 55, 0.2);
  color: #b38b24;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: 6px;
}

/* Feature promotion styling */
.feature-promotion {
  margin: 20px auto;
  max-width: 600px;
  background-color: white;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  animation: slide-up 0.5s ease;
}

.promotion-content {
  display: flex;
  align-items: center;
  padding: 15px;
  position: relative;
}

.promotion-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 15px;
  flex-shrink: 0;
}

.promotion-icon svg {
  stroke: white;
}

.promotion-text {
  flex: 1;
}

.promotion-text h4 {
  margin: 0 0 5px 0;
  font-size: 16px;
  color: var(--primary);
  display: flex;
  align-items: center;
}

.promotion-text p {
  margin: 0;
  font-size: 13px;
  color: #666;
  line-height: 1.4;
}

.promotion-cta-btn {
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  margin-left: 15px;
  transition: all 0.2s ease;
}

.promotion-cta-btn:hover {
  background-color: var(--primary-light);
  transform: translateY(-2px);
}

.close-promotion {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  color: #999;
  font-size: 18px;
  cursor: pointer;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.close-promotion:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: #666;
}

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

/* Dark theme support */
body.theme-dark .memory-status-indicator {
  background-color: rgba(212, 175, 55, 0.2);
  color: #d4b654;
}

body.theme-dark .memory-status-indicator svg {
  stroke: #d4b654;
}

body.theme-dark .memory-premium-badge {
  background-color: rgba(212, 175, 55, 0.25);
  color: #d4b654;
}

body.theme-dark .feature-promotion {
  background-color: #2C2C2C;
}

body.theme-dark .promotion-text p {
  color: #BBB;
}

body.theme-dark .close-promotion {
  color: #777;
}

body.theme-dark .close-promotion:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #AAA;
}

/* Daily Conversation System Styles */

/* Message counter */
.daily-message-counter {
  margin: 10px 20px;
  padding: 8px 12px;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  font-size: 13px;
  color: #666;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  transition: all 0.3s ease;
}

.daily-message-counter.low {
  color: #e67e22;
  background-color: rgba(230, 126, 34, 0.05);
}

.count-warning {
  color: #e67e22;
  font-weight: 500;
}

.count-label {
  color: #888;
  margin-right: 5px;
}

/* Limit reached banner */
.limit-reached-banner {
  margin: 15px;
  padding: 15px;
  background-color: white;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  animation: slide-up 0.4s ease;
}

.limit-reached-content {
  text-align: center;
}

.limit-reached-content h3 {
  margin: 0 0 10px 0;
  color: #e67e22;
  font-size: 18px;
}

.limit-reached-content p {
  margin: 0 0 15px 0;
  color: #666;
  font-size: 14px;
  line-height: 1.5;
}

.limit-reached-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.upgrade-btn {
  background-color: var(--primary);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.upgrade-btn:hover {
  background-color: var(--primary-light);
  transform: translateY(-2px);
}

.reset-btn {
  background-color: transparent;
  color: #666;
  border: 1px solid #ddd;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.2s ease;
}

.reset-btn:hover {
  background-color: #f5f5f5;
  border-color: #ccc;
}

/* Past conversation indicator */
.past-conversation-indicator {
  margin: 15px;
  padding: 12px 15px;
  background-color: rgba(0, 0, 0, 0.05);
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  animation: slide-up 0.4s ease;
}

.past-conversation-info {
  display: flex;
  align-items: center;
}

.date-label {
  font-size: 14px;
  font-weight: 500;
}

.readonly-badge {
  background-color: #777;
  color: white;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: 8px;
}

.return-to-today-btn {
  background-color: var(--primary);
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.return-to-today-btn:hover {
  background-color: var(--primary-light);
}

/* Past conversations sidebar */
.past-conversations-section {
  margin: 15px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 15px;
}

.sidebar-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  opacity: 0.7;
  padding: 0 16px;
  margin: 20px 0 12px 0;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  position: relative;
}

.sidebar-section-title::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 16px;
  width: 30px;
  height: 2px;
  background: linear-gradient(90deg, var(--secondary), transparent);
  border-radius: 2px;
}

.past-conversations-list {
  max-height: 350px;
  overflow-y: auto;
  padding: 0 5px;
}

.empty-past-conversations {
  padding: 10px;
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
  font-style: italic;
}

.past-month-section {
  margin-bottom: 12px;
}

.month-label {
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  margin-bottom: 6px;
}

.past-conversation-item {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-bottom: 4px;
  position: relative;
}

.past-conversation-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  background: var(--secondary);
  border-radius: 0 3px 3px 0;
  transition: height 0.3s ease;
}

.past-conversation-item:hover::before {
  height: 60%;
}

.past-conversation-item:hover {
  background-color: rgba(255, 255, 255, 0.15);
  transform: translateX(3px);
}

.past-conversation-item:active {
  transform: translateX(1px);
}

.past-conversation-day {
  width: 24px;
  height: 24px;
  background-color: rgba(255, 255, 255, 0.15);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 500;
  margin-right: 10px;
}

.past-conversation-info {
  flex: 1;
}

.past-conversation-label {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
}

.past-conversation-messages {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
}

.past-conversations-upgrade {
  padding: 15px;
  text-align: center;
  color: rgba(255, 255, 255, 0.8);
}

.past-conversations-upgrade svg {
  margin-bottom: 10px;
  opacity: 0.7;
}

.past-conversations-upgrade p {
  margin-bottom: 12px;
  font-size: 13px;
  line-height: 1.4;
}

.upgrade-prompt-btn {
  background-color: var(--secondary);
  color: var(--neutral-text);
  border: none;
  padding: 6px 12px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.upgrade-prompt-btn:hover {
  background-color: #e1ba45;
  transform: translateY(-1px);
}

/* Animation */
@keyframes slide-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Dark theme support */
body.theme-dark .daily-message-counter {
  background-color: #2a2a2a;
  color: #aaa;
}

body.theme-dark .limit-reached-banner {
  background-color: #2a2a2a;
}

body.theme-dark .limit-reached-content p {
  color: #aaa;
}

body.theme-dark .reset-btn {
  color: #aaa;
  border-color: #444;
}

body.theme-dark .reset-btn:hover {
  background-color: #333;
  border-color: #555;
}

body.theme-dark .past-conversation-indicator {
  background-color: rgba(255, 255, 255, 0.05);
}

/* Hide old conversation UI elements */
.conversations-container,
.conversations-title,
.conversations-list,
.conversation-item:not(.past-conversation-item) {
  display: none !important;
}

/* Update the New Chat button text */
.new-chat {
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
}

.new-chat::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.new-chat:hover::before {
  opacity: 1;
}

.new-chat:hover {
  background-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
}

.new-chat:active {
  transform: translateY(0);
}

.new-chat-icon {
  margin-right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}

.new-chat-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  transition: transform 0.3s ease;
}

.new-chat:hover .new-chat-icon svg {
  transform: rotate(90deg);
}

/* Enhance past conversations section */
.past-conversations-section {
  margin: 0 0 20px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 15px;
}

.past-conversations-section h3 {
  margin-top: 0;
}

/* Always enable Today's Conversation button */
.new-chat {
  opacity: 1 !important;
  cursor: pointer !important;
  background-color: rgba(255, 255, 255, 0.05);
}

.new-chat:hover {
  background-color: var(--primary-light) !important;
  transform: translateY(-1px) !important;
}

/* Override any disabled styles */
.new-chat.disabled {
  opacity: 1 !important;
  cursor: pointer !important;
  background-color: rgba(255, 255, 255, 0.05);
}

.new-chat.disabled:hover {
  background-color: var(--primary-light) !important;
  transform: translateY(-1px) !important;
}

.delete-past-conversation {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 18px;
  line-height: 1;
  padding: 2px 6px;
  cursor: pointer;
  border-radius: 50%;
  transition: all 0.2s ease;
  opacity: 0;
}

.past-conversation-item:hover .delete-past-conversation {
  opacity: 1;
}

.delete-past-conversation:hover {
  background-color: rgba(255, 0, 0, 0.2);
  color: rgba(255, 255, 255, 0.9);
}

.past-conversation-item {
  position: relative;
}

/* Loading indicator for past conversations */
.conversations-loading {
  padding: 8px 12px;
  text-align: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  margin: 8px;
}

/* Sentinel element for intersection observer */
.scroll-sentinel {
  height: 20px;
  width: 100%;
  visibility: hidden;
}

/* Fade-in animation for new conversations */
.past-conversation-item {
  animation: fadeIn 0.3s ease-out;
}

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


/* Today's Conversation Button */
.todays-conversation-btn {
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
}

.todays-conversation-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.todays-conversation-btn:hover::before {
  opacity: 1;
}

.todays-conversation-btn:hover {
  background-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
}

.todays-conversation-btn.active {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.2), rgba(212, 175, 55, 0.1));
  border-color: var(--secondary);
  box-shadow: 0 0 16px rgba(212, 175, 55, 0.4), 0 2px 8px rgba(0, 0, 0, 0.2);
}

.todays-conversation-btn.active::after {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 60%;
  background: var(--secondary);
  border-radius: 0 4px 4px 0;
}

.todays-conversation-icon {
  margin-right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: var(--secondary);
  transition: transform 0.3s ease;
}

.todays-conversation-icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.todays-conversation-btn:hover .todays-conversation-icon {
  transform: scale(1.15);
}

.todays-conversation-text {
  font-weight: 500;
  color: white;
  font-size: 14px;
}

/* Highlighting for important insights, Quran, and Hadith - ALL THE SAME */
.bot .formatted-content mark,
.bot .formatted-content .quran-highlight,
.bot .formatted-content .hadith-highlight,
.bot .formatted-content .insight-highlight {
  background-color: #e8f5e8;
  color: #2a6041;
  border-left: 3px solid var(--primary);
  padding: 8px 12px;
  border-radius: 6px;
  font-weight: 500;
  display: inline-block;
  line-height: 1.6;
  margin: 4px 0;
  font-style: italic;
}

/* Dark mode overrides for highlights */
body.theme-dark .bot .formatted-content mark,
body.theme-dark .bot .formatted-content .quran-highlight,
body.theme-dark .bot .formatted-content .hadith-highlight,
body.theme-dark .bot .formatted-content .insight-highlight {
  background: #3D3520;
  color: #FFE8A3;
  border-left: 3px solid #FFD966;
  font-weight: 600;
}

/* Add this CSS to your styles.css for better logout button styling */

#logout-btn {
  background: transparent;
  border: none;
  color: white;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
}

#logout-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
  transform: scale(1.05);
}

#logout-btn svg {
  width: 18px;
  height: 18px;
}

/* For mobile - make it slightly larger */
@media (max-width: 768px) {
  #logout-btn {
    width: 28px;
    height: 28px;
  }
  
  #logout-btn svg {
    width: 16px;
    height: 16px;
  }
}

/* Sidebar logout styling */
#logout-nav-btn {
  color: rgba(255, 255, 255, 0.9);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 10px;
  padding-top: 15px;
}

#logout-nav-btn:hover {
  background-color: rgba(255, 0, 0, 0.1);
  color: #ffcccc;
}

/* ===== DISCLAIMER MODAL STYLES ===== */

/* Disclaimer Modal */
.disclaimer-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  backdrop-filter: blur(3px);
}

.disclaimer-modal.show {
  opacity: 1;
  visibility: visible;
}

.disclaimer-modal-content {
  background-color: white;
  border-radius: 16px;
  width: 90%;
  max-width: 550px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
  transform: translateY(30px) scale(0.95);
  transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1);
  position: relative;
}

.disclaimer-modal.show .disclaimer-modal-content {
  transform: translateY(0) scale(1);
}

/* Decorative Islamic pattern overlay */
.disclaimer-modal-content::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100px;
  height: 100px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 80' width='80' height='80'%3E%3Cpath fill='none' stroke='%232A6041' stroke-width='1' opacity='0.15' d='M30 10L15 30 30 50 15 70M50 10L65 30 50 50 65 70M30 10L50 10M15 30L65 30M30 50L50 50M15 70L65 70'/%3E%3C/svg%3E");
  opacity: 0.4;
  pointer-events: none;
}

.disclaimer-modal-header {
  background: linear-gradient(135deg, var(--primary) 0%, #1a3f2a 100%);
  color: white;
  padding: 25px 30px;
  position: relative;
  text-align: center;
}

.disclaimer-modal-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--secondary) 0%, rgba(212, 175, 55, 0.6) 100%);
}

.disclaimer-modal-header h3 {
  margin: 0;
  font-weight: 500;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Add warning icon before the title */
.disclaimer-modal-header h3::before {
  content: '⚖️';
  margin-right: 12px;
  font-size: 1.2em;
}

.disclaimer-modal-body {
  padding: 30px;
}

.disclaimer-content {
  margin-bottom: 25px;
}

.disclaimer-content > p {
  margin: 0 0 20px 0;
  font-size: 15px;
  color: var(--neutral-text);
  text-align: center;
}

.disclaimer-points {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin: 25px 0;
}

.disclaimer-point {
  display: flex;
  align-items: flex-start;
  padding: 16px;
  background-color: #f8f9fa;
  border-radius: 12px;
  border-left: 4px solid var(--primary);
  transition: all 0.2s ease;
}

.disclaimer-point:hover {
  background-color: rgba(42, 96, 65, 0.05);
  transform: translateX(3px);
}

.point-icon {
  font-size: 20px;
  margin-right: 15px;
  margin-top: 2px;
  flex-shrink: 0;
}

.point-text {
  flex: 1;
  line-height: 1.5;
}

.point-text strong {
  color: var(--primary);
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
}

.disclaimer-footer {
  background-color: rgba(42, 96, 65, 0.05);
  padding: 16px;
  border-radius: 10px;
  margin-top: 20px;
  border: 1px solid rgba(42, 96, 65, 0.1);
}

.disclaimer-footer p {
  margin: 0;
  font-size: 14px;
  color: var(--primary);
  text-align: center;
  font-weight: 500;
  line-height: 1.4;
}

.disclaimer-acknowledge-btn {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 16px 32px;
  width: 100%;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(42, 96, 65, 0.2);
  position: relative;
  overflow: hidden;
}

.disclaimer-acknowledge-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(42, 96, 65, 0.3);
}

.disclaimer-acknowledge-btn:active {
  transform: translateY(0);
}

/* Shimmer effect on button */
.disclaimer-acknowledge-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: 0.6s;
}

.disclaimer-acknowledge-btn:hover::before {
  left: 100%;
}

/* Dark theme support */
body.theme-dark .disclaimer-modal-content {
  background-color: #2C2C2C;
}

body.theme-dark .disclaimer-content > p {
  color: #E0E0E0;
}

body.theme-dark .disclaimer-point {
  background-color: #333;
  border-left-color: var(--primary-light);
}

body.theme-dark .disclaimer-point:hover {
  background-color: rgba(42, 96, 65, 0.15);
}

body.theme-dark .point-text strong {
  color: var(--primary-light);
}

body.theme-dark .disclaimer-footer {
  background-color: rgba(42, 96, 65, 0.15);
  border-color: rgba(42, 96, 65, 0.2);
}

body.theme-dark .disclaimer-footer p {
  color: var(--primary-light);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .disclaimer-modal-content {
    width: 95%;
    margin: 10px;
  }
  
  .disclaimer-modal-header {
    padding: 20px 25px;
  }
  
  .disclaimer-modal-header h3 {
    font-size: 1.2rem;
  }
  
  .disclaimer-modal-body {
    padding: 25px 20px;
  }
  
  .disclaimer-point {
    padding: 14px;
  }
  
  .point-icon {
    font-size: 18px;
    margin-right: 12px;
  }
  
  .disclaimer-acknowledge-btn {
    padding: 14px 24px;
    font-size: 15px;
  }
}

@media (max-width: 480px) {
  .disclaimer-modal-header h3::before {
    margin-right: 8px;
  }
  
  .disclaimer-points {
    gap: 15px;
  }
  
  .disclaimer-point {
    padding: 12px;
  }
  
  .point-text strong {
    font-size: 14px;
  }
}

/* ===== INSTALL PROMPT MODAL STYLES ===== */

/* Install Prompt Modal */
.install-prompt-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2500;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  backdrop-filter: blur(3px);
}

.install-prompt-modal.show {
  opacity: 1;
  visibility: visible;
}

.install-prompt-modal-content {
  background-color: white;
  border-radius: 16px;
  width: 90%;
  max-width: 450px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
  transform: translateY(30px) scale(0.95);
  transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1);
  position: relative;
}

.install-prompt-modal.show .install-prompt-modal-content {
  transform: translateY(0) scale(1);
}

/* Decorative pattern overlay */
.install-prompt-modal-content::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 80px;
  height: 80px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 80' width='80' height='80'%3E%3Cpath fill='none' stroke='%232A6041' stroke-width='1' opacity='0.1' d='M30 10L15 30 30 50 15 70M50 10L65 30 50 50 65 70M30 10L50 10M15 30L65 30M30 50L50 50M15 70L65 70'/%3E%3C/svg%3E");
  opacity: 0.3;
  pointer-events: none;
}

.install-prompt-modal-header {
  background: linear-gradient(135deg, var(--primary) 0%, #1a3f2a 100%);
  color: white;
  padding: 20px 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

.install-prompt-modal-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--secondary) 0%, rgba(212, 175, 55, 0.6) 100%);
}

.install-prompt-modal-header h3 {
  margin: 0;
  font-weight: 500;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
}

.install-prompt-modal-header h3::before {
  content: '📱';
  margin-right: 10px;
  font-size: 1.2em;
}

.install-prompt-modal-body {
  padding: 30px;
}

/* Install description */
.install-description {
  text-align: center;
  color: #666;
  font-size: 14px;
  margin: 0 0 20px 0;
  line-height: 1.5;
}

/* Platform-specific Instructions */
.install-instructions {
  margin-bottom: 16px;
  background: #f8faf8;
  border-radius: 10px;
  padding: 14px 16px;
  border: 1px solid #e8f0e8;
}

.install-platform-label {
  font-weight: 700;
  font-size: 13px;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.install-steps p {
  margin: 0 0 6px 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--neutral-text);
}

.install-steps p:last-child {
  margin-bottom: 0;
}

.install-icon-inline {
  display: inline-block;
  vertical-align: middle;
  margin: 0 2px;
  color: var(--primary);
}

body.theme-dark .install-description {
  color: #999;
}

body.theme-dark .install-instructions {
  background: #2a2a2a;
  border-color: #333;
}

body.theme-dark .install-platform-label {
  color: #a8d4b8;
}

body.theme-dark .install-steps p {
  color: #ccc;
}

.install-instructions p {
  margin: 0 0 15px 0;
  line-height: 1.6;
  font-size: 15px;
  color: var(--neutral-text);
}

.install-instructions p:last-child {
  margin-bottom: 0;
}

.install-instructions strong {
  color: var(--primary);
  font-weight: 600;
}

.install-instructions svg {
  display: inline-block;
  vertical-align: middle;
  margin: 0 4px;
}

/* Android Install Button */
.install-button {
  width: 100%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 14px 20px;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(42, 96, 65, 0.2);
  margin-bottom: 15px;
}

.install-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(42, 96, 65, 0.3);
}

.install-button:active {
  transform: translateY(0);
}

.install-help-text {
  font-size: 13px;
  color: #666;
  text-align: center;
  margin: 0;
  line-height: 1.4;
}

/* Maybe Later Button */
.maybe-later-btn {
  width: 100%;
  background-color: transparent;
  color: #666;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 12px 20px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.maybe-later-btn:hover {
  background-color: #f5f5f5;
  border-color: #ccc;
}

/* Dark theme support */
body.theme-dark .install-prompt-modal-content {
  background-color: #2C2C2C;
}

body.theme-dark .install-benefits li {
  border-bottom-color: #444;
}

body.theme-dark .install-instructions {
  background-color: #333;
}

body.theme-dark .install-instructions li {
  border-bottom-color: #444;
}

body.theme-dark .install-help-text {
  color: #aaa;
}

body.theme-dark .maybe-later-btn {
  color: #aaa;
  border-color: #444;
}

body.theme-dark .maybe-later-btn:hover {
  background-color: #3a3a3a;
  border-color: #555;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .install-prompt-modal-content {
    width: 95%;
    margin: 10px;
  }
  
  .install-prompt-modal-header {
    padding: 18px 20px;
  }
  
  .install-prompt-modal-header h3 {
    font-size: 1.1rem;
  }
  
  .install-prompt-modal-body {
    padding: 20px;
  }
  
  .install-app-icon img {
    width: 70px;
    height: 70px;
  }
  
  .install-benefits h4 {
    font-size: 1rem;
  }
  
  .benefit-icon {
    font-size: 18px;
    margin-right: 10px;
  }
  
  .install-instructions {
    padding: 15px;
  }
  
  .step-text {
    font-size: 13px;
  }
  
  .install-button {
    padding: 12px 16px;
    font-size: 15px;
  }
}

@media (max-width: 480px) {
  .install-prompt-modal-header h3::before {
    margin-right: 8px;
  }
  
  .install-benefits li {
    padding: 8px 0;
  }
  
  .step-number {
    width: 22px;
    height: 22px;
    font-size: 12px;
  }
}

/* ===== PRIVACY & ENCRYPTION UI STYLES ===== */

/* Encryption indicator in header */
.encryption-status {
  display: inline-flex;
  align-items: center;
  background-color: rgba(0, 255, 0, 0.1);
  color: #00aa00;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  margin-left: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.encryption-status:hover {
  background-color: rgba(0, 255, 0, 0.2);
  transform: scale(1.05);
}

.encryption-status.encrypting {
  background-color: rgba(255, 165, 0, 0.1);
  color: #ff8c00;
}

.encryption-status.error {
  background-color: rgba(255, 0, 0, 0.1);
  color: #cc0000;
}

/* Privacy notice banner */
.privacy-notice {
  background: linear-gradient(135deg, #e8f5e8 0%, #f0f8f0 100%);
  border-left: 4px solid var(--primary);
  padding: 12px 16px;
  margin: 10px 20px;
  border-radius: 8px;
  font-size: 13px;
  color: #2a6041;
  display: flex;
  align-items: center;
  animation: slideIn 0.5s ease;
}

.privacy-notice .privacy-icon {
  margin-right: 10px;
  font-size: 16px;
}

.privacy-notice .privacy-text {
  flex: 1;
  line-height: 1.4;
}

.privacy-notice .learn-more {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  margin-left: 8px;
}

.privacy-notice .learn-more:hover {
  text-decoration: underline;
}

/* Privacy modal */
.privacy-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.privacy-modal.show {
  opacity: 1;
  visibility: visible;
}

.privacy-modal-content {
  background-color: white;
  border-radius: 16px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.privacy-modal.show .privacy-modal-content {
  transform: translateY(0);
}

.privacy-modal-header {
  background: linear-gradient(135deg, var(--primary) 0%, #1a3f2a 100%);
  color: white;
  padding: 20px 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.privacy-modal-header h3 {
  margin: 0;
  display: flex;
  align-items: center;
}

.privacy-modal-header h3::before {
  content: none;
}

.privacy-modal-body {
  padding: 25px;
}

.privacy-section {
  margin-bottom: 20px;
}

.privacy-section h4 {
  color: var(--primary);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
}

.privacy-section h4::before {
  content: none;
}

.privacy-section p {
  margin-bottom: 10px;
  line-height: 1.5;
  color: #555;
}

.privacy-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.privacy-list li {
  padding: 6px 0 6px 20px;
  position: relative;
  color: #555;
  line-height: 1.5;
}

.privacy-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  width: 8px;
  height: 8px;
  background-color: var(--primary);
  border-radius: 50%;
}

/* Dark theme support */
body.theme-dark .privacy-notice {
  background: linear-gradient(135deg, rgba(42, 96, 65, 0.2) 0%, rgba(42, 96, 65, 0.1) 100%);
  color: #8abb9c;
}

body.theme-dark .privacy-modal-content {
  background-color: #2C2C2C;
}

body.theme-dark .privacy-section p {
  color: #aaa;
}

body.theme-dark .privacy-list li {
  color: #aaa;
}

body.theme-dark .encryption-status {
  background-color: rgba(0, 255, 0, 0.15);
  color: #66cc66;
}

/* Animation keyframes */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(-20px);
  }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .privacy-modal-content {
    width: 95%;
    margin: 20px;
  }
  
  .privacy-features {
    grid-template-columns: 1fr;
  }
  
  .privacy-notice {
    margin: 10px;
    padding: 10px 12px;
  }
}

/* ===== CONVERSATION CHOICE STYLES ===== */

/* Conversation choice container */
.conversation-choice-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
  padding: 0;
}

/* Choice button styling */
.conversation-choice-btn {
  display: flex;
  align-items: center;
  padding: 14px 18px;
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  border: 2px solid var(--neutral-border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.conversation-choice-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent, rgba(42, 96, 65, 0.05), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.conversation-choice-btn:hover::before {
  opacity: 1;
}

.conversation-choice-btn:hover {
  border-color: var(--primary);
  background: linear-gradient(135deg, rgba(42, 96, 65, 0.05) 0%, #ffffff 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(42, 96, 65, 0.15);
}

.conversation-choice-btn:active {
  transform: translateY(0);
}

/* Choice icon */
.choice-icon {
  font-size: 24px;
  margin-right: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background-color: rgba(42, 96, 65, 0.1);
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.conversation-choice-btn:hover .choice-icon {
  background-color: rgba(42, 96, 65, 0.2);
  transform: scale(1.1);
}

/* Choice text */
.choice-text {
  flex: 1;
  text-align: left;
}

.choice-title {
  font-weight: 600;
  font-size: 15px;
  color: var(--primary);
  margin-bottom: 4px;
  display: block;
}

.choice-description {
  font-size: 13px;
  color: #666;
  line-height: 1.4;
  display: block;
}

/* Choice arrow indicator */
.choice-arrow {
  color: var(--primary);
  opacity: 0;
  transform: translateX(-10px);
  transition: all 0.3s ease;
  font-size: 18px;
}

.conversation-choice-btn:hover .choice-arrow {
  opacity: 1;
  transform: translateX(0);
}

/* Welcome message with choice styling */
.welcome-with-choice {
  max-width: 100%;
}

.welcome-with-choice .welcome-greeting {
  font-size: 16px;
  margin-bottom: 8px;
  line-height: 1.5;
}

.welcome-with-choice .welcome-question {
  font-weight: 500;
  color: var(--primary);
  margin-bottom: 12px;
}

/* Animate choice buttons on appear */
.conversation-choice-container {
  animation: slideUpFadeIn 0.5s ease-out;
  animation-delay: 0.3s;
  animation-fill-mode: backwards;
}

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

/* Stagger animation for each button */
.conversation-choice-btn:nth-child(1) {
  animation: slideUpFadeIn 0.4s ease-out;
  animation-delay: 0.4s;
  animation-fill-mode: backwards;
}

.conversation-choice-btn:nth-child(2) {
  animation: slideUpFadeIn 0.4s ease-out;
  animation-delay: 0.55s;
  animation-fill-mode: backwards;
}

/* Dark theme support */
body.theme-dark .conversation-choice-btn {
  background: linear-gradient(135deg, #333 0%, #2a2a2a 100%);
  border-color: #444;
}

body.theme-dark .conversation-choice-btn:hover {
  border-color: var(--primary-light);
  background: linear-gradient(135deg, rgba(42, 96, 65, 0.2) 0%, #2a2a2a 100%);
}

body.theme-dark .choice-icon {
  background-color: rgba(42, 96, 65, 0.2);
}

body.theme-dark .conversation-choice-btn:hover .choice-icon {
  background-color: rgba(42, 96, 65, 0.3);
}

body.theme-dark .choice-title {
  color: var(--primary-light);
}

body.theme-dark .choice-description {
  color: #aaa;
}

body.theme-dark .choice-arrow {
  color: var(--primary-light);
}

/* Mobile responsive */
@media (max-width: 768px) {
  .conversation-choice-container {
    gap: 10px;
  }
  
  .conversation-choice-btn {
    padding: 12px 14px;
  }
  
  .choice-icon {
    font-size: 20px;
    width: 36px;
    height: 36px;
    margin-right: 12px;
  }
  
  .choice-title {
    font-size: 14px;
  }
  
  .choice-description {
    font-size: 12px;
  }
  
  .choice-arrow {
    display: none;
  }
}

@media (max-width: 480px) {
  .conversation-choice-btn {
    padding: 10px 12px;
  }
  
  .choice-icon {
    width: 32px;
    height: 32px;
    font-size: 18px;
    margin-right: 10px;
  }
}

/* Settings panel - conversation focus section */
.settings-conversation-focus {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--neutral-border);
}

.settings-conversation-focus h4 {
  margin: 0 0 12px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
}

.settings-conversation-focus p {
  margin: 0 0 15px 0;
  font-size: 13px;
  color: #666;
  line-height: 1.5;
}

.restart-conversation-btn {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.restart-conversation-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(42, 96, 65, 0.2);
}

.restart-conversation-btn svg {
  width: 16px;
  height: 16px;
}

body.theme-dark .settings-conversation-focus p {
  color: #aaa;
}

body.theme-dark .settings-conversation-focus {
  border-top-color: #444;
}
