/* === Base Styles === */
body {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  background-color: rgb(252, 252, 252);
  margin: 0;
  padding: 0;
}

/* === Chat Layout === */
.chat-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-width: 800px;
  margin: 0 auto;
  margin-left: 220px; /* Room for sidebar */
  position: relative;
}

.chat-box, #chat-box {
  flex: 1 1 auto;
  height: auto;
  overflow-y: auto;
  padding: 20px;
  margin-left: 40px;
  transition: margin-left 0.3s ease;
}

.chat-box::-webkit-scrollbar {
  width: 8px;
}

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

.chat-container {
  max-width: 350px;
  width: 100%;
  margin: 0 auto;
  padding: 20px;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

/* === Messages === */
.chat-message {
  padding: 10px;
  margin-bottom: 10px;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
  word-wrap: break-word;
  max-width: 80%;
  display: block;
}

.user-message {
  background-color: cadetblue;
  color: #fff;
  font-size: 21px;
  text-align: right;
  border-radius: 15px 15px 15px 0 !important;
  margin-left: 40%;
  margin-right: 0;
}

.bot-message {
  background-color: #484848;
  color: #fff;
  font-size: 20px;
  text-align: left;
  border-radius: 15px 15px 0 15px !important;
  margin-right: 40%;
  margin-left: 0;
}

.message-text {
  display: inline-block;
  white-space: pre-wrap;
}

/* === Icons === */
.user-icon {
  display: none;
}

.bot-icon {
  font-size: 20px;
  margin-right: 10px;
  border-radius: 50%;
  width: 50px;
  height: 50px;
}

/* === Buttons === */
.btn-secondary {
  background-color: #6c757d;
  color: white;
  padding: 10px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}

.btn-secondary:hover {
  background-color: #5a6268;
}

.service-btn {
  margin-right: 20px;
  margin-bottom: 20px;
  background-color: #23609F;
  border: none;
  color: white;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
}

.service-btn:hover {
  background-color: #b0c4de;
}

.service-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

#send-btn, #new-search-btn {
  padding: 10px 16px;
  font-size: 14px;
  border: none;
  border-radius: 6px;
  color: white;
}

#send-btn.hidden, #new-search-btn.hidden {
  display: none !important;
}

#send-btn {
  background-color: #4682b4;
}

#new-search-btn {
  background-color: #dc3545;
}

#toggle-more-btn {
  background-color: transparent;
  border: none;
  color: var(--text-color);
  cursor: pointer;
  text-align: left;
  margin-top: 8px;
}

.google-login-button {
  background-color: #4285F4;
  color: white;
  padding: 12px 20px;
  border-radius: 4px;
  text-decoration: none;
  font-weight: bold;
  display: inline-block;
}

.google-login-button:hover {
  background-color: #357AE8;
}

/* === Input Area === */
#message-input-area {
  padding: 10px;
  background-color: inherit;
}

#message-input-area.hidden {
  display: none !important;
}

#message-input {
  flex: 1;
  resize: none;
  padding: 10px;
  font-size: 16px;
  border-radius: 6px;
  border: 1px solid #ccc;
  width: 100%;
}

/* === Sidebar === */
#sidebar, .sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 220px;
  height: 100vh;
  padding: 20px;
  background-color: #f4f4f4;
  border-right: 1px solid #ccc;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow-y: auto;
  z-index: 900;
  transition: transform 0.3s ease, background-color 0.3s, color 0.3s;
}

.sidebar.closed {
  transform: translateX(-100%);
}

/* User Authentication Section */
.user-auth {
  margin-bottom: 15px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.user-auth span {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
}

.user-auth a {
  color: #4682b4;
  text-decoration: none;
  margin-right: 10px;
}

.user-auth a:hover {
  text-decoration: underline;
}

.sidebar-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

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

.sidebar-section h4 {
  margin-bottom: 10px;
  font-size: 1.2rem;
}

.sidebar-toggle, #sidebar-toggle {
  position: fixed;
  top: 10px;
  left: 10px;
  font-size: 26px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1100;
}

.sidebar-btn {
  display: block;
  width: 100%;
  margin: 6px 0;
  padding: 10px;
  background-color: #4682b4;
  color: white;
  border: none;
  border-radius: 6px;
  text-align: left;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.2s ease-in-out;
}

.sidebar-btn:hover {
  background-color: #5a9bd6;
}

.sidebar-btn.active {
  background-color: var(--btn-active-bg, #e0e0e0);
}

.sidebar-btn.new-chat {
  background-color: #38a169;
}

.sidebar-btn.new-chat:hover {
  background-color: #2f855a;
}

.sidebar-panel {
  display: none;
  margin-top: 5px;
  margin-bottom: 10px;
  padding: 12px 16px;
  background-color: var(--panel-bg, #f9f9f9);
  border-left: 3px solid var(--accent-color, #007bff);
  border-radius: 4px;
  font-size: 14px;
}

.sidebar-panel.active {
  display: block;
}

/* === Toggle Switches === */
.switch, .toggle-label {
  position: relative;
  display: inline-block;
}

.switch {
  width: 46px;
  height: 24px;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  margin-top: 10px;
}

.switch input, .toggle-label input {
  display: none;
}

.slider, .toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--toggle-off-bg, #ccc);
  border-radius: 24px;
  transition: 0.4s;
}

.toggle-slider {
  position: relative;
  width: 40px;
  height: 20px;
  border-radius: 20px;
  transition: background-color 0.3s;
}

.slider:before, .toggle-slider::before {
  position: absolute;
  content: "";
  background-color: white;
  border-radius: 50%;
  transition: 0.4s;
}

.slider:before {
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
}

.toggle-slider::before {
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  transition: transform 0.3s;
}

input:checked + .slider {
  background-color: var(--toggle-on-bg, #007bff);
}

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

#theme-toggle:checked + .toggle-slider {
  background-color: #4682b4;
}

#theme-toggle:checked + .toggle-slider::before {
  transform: translateX(20px);
}

.theme-icon {
  font-size: 18px;
  transition: transform 0.3s ease;
}

/* === Modal === */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.5);
}

.modal.show {
  display: block !important;
}

.modal.hidden {
  display: none !important;
}

/* Dark mode modal overlay - slightly more transparent */
.dark-mode .modal {
  background-color: rgba(0,0,0,0.7);  /* Darker overlay for better contrast */
}

.modal-content {
  background-color: #fff;
  margin: 10% auto;
  padding: 30px;
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.modal-content h4 {
  margin-bottom: 20px;
  color: #333;
}

.modal-content p {
  margin-bottom: 25px;
  line-height: 1.6;
  color: #555;
}

.age-confirmation {
  margin: 20px 0;
  padding: 15px;
  background-color: #f8f9fa;
  border-radius: 5px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  margin-right: 10px;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.checkbox-label span {
  font-size: 15px;
  color: #333;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.modal-actions .btn {
  flex: 1;
}

#cancel-modal {
  background-color: #6c757d;
  color: white;
  border: none;
}

#cancel-modal:hover {
  background-color: #5a6268;
}

/* === Utility Classes === */
.hidden {
  display: none !important;
}

h2 {
  color: #E3E7EC;
  padding: 20px 0px;
  margin: 5px 0px;
  font-size: 1.5em;
  font-weight: 700;
}

.col-md-8 {
  margin: 20px;
}

.heady {
  padding: 16px;
  width: 80%;
  max-width: 300px;
}

.my-custom-class {
  padding: 5px;
  font-size: 1.2em;
  background-color: #484848;
  border-radius: 8px;
}

.loading i.fa-spinner {
  color: white;
}

#service-buttons {
  margin-left: 30px;
  margin-top: 0;
  padding-top: 0;
}

.chat-box + #service-buttons {
  margin-top: -10px;
}

/* === Mode Toggle Container === */
#mode-toggle-container {
  position: fixed;
  top: 15px;
  left: 15px;
  z-index: 999;
  display: flex;
  align-items: center;
}

#mode-label {
  margin-left: 8px;
}

#mode-toggle-button {
  position: fixed;
  top: .7rem;
  right: .7rem;
  padding: 0.3rem 1rem;
  font-size: .7rem;
  cursor: pointer;
  background-color: #000;
  color: #fff;
  border: none;
  border-radius: 8px;
}

/* === Logo Visibility === */
.logo-light {
  display: block;
}

.logo-dark {
  display: none;
}

/* === Light Mode === */
body.light-mode {
  background-color: rgb(251, 251, 251);
  color: black;
  --toggle-on-bg: #007bff;
  --toggle-off-bg: #ddd;
}

.light-mode .bot-message {
  background-color: #f0f0f0;
  color: #000000;
}

.light-mode .user-message {
  background-color: cadetblue;
  color: #000000;
}

.light-mode .bot-message p,
.light-mode .user-message p,
.light-mode body {
  color: #000000;
}

.light-mode .loading i.fa-spinner {
  color: black;
}

.light-mode .my-custom-class {
  background-color: #f0f0f0;
}

.light-mode h2 {
  color: black;
}

.light-mode .modal-content {
  background-color: #fff;
  color: #000;
}

/* === Dark Mode === */
body.dark-mode {
  background-color: black;
  color: white;
  --toggle-on-bg: #66d9ef;
  --toggle-off-bg: #444;
}

.dark-mode .bot-message {
  background-color: #484848;
}

.dark-mode .service-btn {
  background-color: #4682B4;
}

.dark-mode .bot-message p,
.dark-mode .user-message p,
.dark-mode body {
  color: #ffffff;
}

.dark-mode .logo-light {
  display: none;
}

.dark-mode .logo-dark {
  display: block;
}

.dark-mode .modal-content {
  background-color: #2d3748;  /* Changed from #1e1e1e - more contrast */
  color: #eee;
  border: 1px solid #4a5568;  /* Added subtle border */
}

.dark-mode .modal-content h4 {
  color: #f7fafc;  /* Brighter white for heading */
}

.dark-mode .modal-content p {
  color: #e2e8f0;  /* Lighter gray for better readability */
}

.dark-mode .age-confirmation {
  background-color: #1a202c;  /* Darker than modal bg for contrast */
  border: 1px solid #4a5568;
}

.dark-mode .checkbox-label span {
  color: #f0f0f0;
}

.dark-mode #cancel-modal {
  background-color: #4a5568;  /* Lighter gray for button */
  border: 1px solid #718096;
}

.dark-mode #cancel-modal:hover {
  background-color: #718096;  /* Even lighter on hover */
}

.dark-mode #sidebar,
.dark-mode .sidebar {
  background-color: #1e1e1e;
  color: white;
  border-right: 1px solid #444;
}

.dark-mode .sidebar-btn {
  background-color: #3a3a3a;
  color: #fff;
}

.dark-mode .sidebar-btn:hover {
  background-color: #575757;
}

.dark-mode .sidebar-btn.new-chat {
  background-color: #2f855a;
}

.dark-mode .sidebar-btn.new-chat:hover {
  background-color: #38a169;
}

.dark-mode .sidebar-panel {
  background-color: #3a3a3a;
  color: #fff;
}

.dark-mode .toggle-slider {
  background-color: #555;
}

.dark-mode #theme-toggle:checked + .toggle-slider {
  background-color: #66d9ef;
}

.dark-mode .sidebar-toggle,
.dark-mode .theme-icon {
  color: #f0f0f0;
}

.dark-mode .user-auth {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.dark-mode .user-auth a {
  color: #66d9ef;
}

/* === Responsive === */
@media (max-width: 768px) {
  .sidebar {
    width: 80%;
    max-width: 300px;
  }
  
  .sidebar-toggle {
    display: block;
  }
  
  body.sidebar-open .sidebar {
    transform: translateX(0);
  }
  
  #chat-box {
    margin-left: 0;
  }
  
  body.sidebar-open #chat-box {
    pointer-events: none;
    filter: blur(2px);
  }
}
/* === Service Customization Modal === */
.customize-modal {
  max-width: 500px;  /* Reduced from 600px */
  max-height: 75vh;  /* Slightly smaller */
  overflow-y: auto;
}

.services-selection {
  padding: 5px 0;
}

/* Category containers */
.service-category {
  margin-bottom: 18px;  /* Reduced from 30px */
  padding-bottom: 12px;  /* Reduced from 20px */
  border-bottom: 1px solid #e0e0e0;
}

.service-category:last-child {
  border-bottom: none;
  margin-bottom: 10px;
}

/* Category titles - more compact */
.service-category h5 {
  margin: 0 0 10px 0;  /* Reduced from 15px */
  padding: 5px 10px;   /* Reduced from 8px 12px */
  background-color: #f8f9fa;
  border-left: 3px solid #4682b4;  /* Thinner border */
  font-size: 14px;  /* Reduced from 16px */
  font-weight: 600;
  color: #333;
  border-radius: 0 3px 3px 0;
}

/* Checkbox container */
.service-checkboxes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));  /* Smaller min width */
  gap: 8px;  /* Reduced from 15px */
  padding: 0 5px;
}

/* Individual checkbox labels - more compact */
.service-checkbox {
  display: flex;
  align-items: center;
  padding: 6px 8px;  /* Reduced from 10px 12px */
  background-color: #fafafa;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 13px;  /* Slightly smaller */
}

.service-checkbox:hover {
  background-color: #f0f8ff;
  border-color: #4682b4;
  transform: translateY(-1px);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.service-checkbox input[type="checkbox"] {
  margin-right: 6px;  /* Reduced from 10px */
  width: 16px;  /* Reduced from 18px */
  height: 16px;
  cursor: pointer;
  flex-shrink: 0;
}

.service-checkbox span {
  font-size: 13px;  /* Reduced from 14px */
  color: #333;
  line-height: 1.2;
}

/* Checked state */
.service-checkbox:has(input:checked) {
  background-color: #e3f2fd;
  border-color: #4682b4;
  font-weight: 500;
}

/* Selected count section - more compact */
.selected-count {
  margin: 12px 0;  /* Reduced from 20px */
  padding: 10px;   /* Reduced from 15px */
  background-color: #f0f8ff;
  border-radius: 4px;
  text-align: center;
  font-size: 13px;
  color: #555;
}

.selected-count #selected-count {
  font-weight: bold;
  color: #4682b4;
  font-size: 14px;  /* Reduced from 16px */
}

/* === Mobile Responsive Design === */
@media (max-width: 600px) {
  .customize-modal {
    max-width: 95%;  /* Use most of screen width */
    max-height: 85vh;  /* More height on mobile */
    margin: 5% auto;  /* Less margin */
  }
  
  .modal-content {
    padding: 20px 15px;  /* Less padding on mobile */
  }
  
  /* 2 columns on mobile for better space usage */
  .service-checkboxes {
    grid-template-columns: repeat(2, 1fr);  /* Fixed 2 columns */
    gap: 6px;
  }
  
  .service-checkbox {
    padding: 8px 6px;  /* Slightly more padding for touch */
  }
  
  .service-checkbox span {
    font-size: 12px;  /* Smaller text on mobile */
  }
  
  .service-category h5 {
    font-size: 13px;
    padding: 4px 8px;
  }
}

/* Small phones */
@media (max-width: 380px) {
  /* Single column for very small screens */
  .service-checkboxes {
    grid-template-columns: 1fr;
    gap: 5px;
  }
  
  .service-checkbox {
    padding: 10px 8px;  /* More padding for easier tapping */
  }
}

/* === Dark Mode Overrides for Service Modal === */
.dark-mode .service-category {
  border-bottom-color: #4a5568;
}

.dark-mode .service-category h5 {
  background-color: #2d3748;
  color: #f7fafc;
  border-left-color: #66d9ef;
}

.dark-mode .service-checkbox {
  background-color: #2d3748;
  border-color: #4a5568;
  color: #e2e8f0;
}

.dark-mode .service-checkbox:hover {
  background-color: #374151;
  border-color: #66d9ef;
}

.dark-mode .service-checkbox span {
  color: #e2e8f0;
}

.dark-mode .service-checkbox:has(input:checked) {
  background-color: #1a365d;
  border-color: #66d9ef;
}

.dark-mode .selected-count {
  background-color: #2d3748;
  color: #e2e8f0;
}

.dark-mode .selected-count #selected-count {
  color: #66d9ef;
}

/* Scrollbar styling for the modal - thinner */
.customize-modal::-webkit-scrollbar {
  width: 6px;  /* Reduced from 8px */
}

.customize-modal::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.customize-modal::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 3px;
}

.customize-modal::-webkit-scrollbar-thumb:hover {
  background: #555;
}

.dark-mode .customize-modal::-webkit-scrollbar-track {
  background: #2d3748;
}

.dark-mode .customize-modal::-webkit-scrollbar-thumb {
  background: #4a5568;
}

.dark-mode .customize-modal::-webkit-scrollbar-thumb:hover {
  background: #718096;
}
/* === Sidebar Services Display (for logged-in users) === */
.sidebar-services-container {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 8px 0;
  max-height: 150px;
  overflow-y: auto;
  padding: 5px 0;
}

.sidebar-service-badge {
  display: inline-block;
  padding: 3px 8px;
  background-color: rgba(70, 130, 180, 0.1);
  border: 1px solid rgba(70, 130, 180, 0.3);
  border-radius: 12px;
  font-size: 11px;
  color: #4682b4;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.sidebar-service-badge:hover {
  background-color: rgba(70, 130, 180, 0.2);
  border-color: #4682b4;
  transform: translateY(-1px);
}

/* Dark mode styles for sidebar services */
.dark-mode .sidebar-service-badge {
  background-color: rgba(102, 217, 239, 0.1);
  border-color: rgba(102, 217, 239, 0.3);
  color: #66d9ef;
}

.dark-mode .sidebar-service-badge:hover {
  background-color: rgba(102, 217, 239, 0.2);
  border-color: #66d9ef;
}

/* Scrollbar for services container */
.sidebar-services-container::-webkit-scrollbar {
  width: 4px;
}

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

.sidebar-services-container::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.3);
  border-radius: 2px;
}

.dark-mode .sidebar-services-container::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.1);
}

.dark-mode .sidebar-services-container::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.3);
}

.btn-dashboard {
  display:inline-flex; align-items:center; gap:.5rem;
  padding:.5rem .9rem; border:1px solid var(--border,#e5e7eb);
  border-radius:999px; font-weight:600; text-decoration:none;
  background:linear-gradient(180deg, #fff, #f8fafc);
  box-shadow:0 1px 2px rgba(0,0,0,.04);
}
.btn-dashboard:hover { transform:translateY(-1px); }
.btn-dashboard:focus { outline:2px solid #2563eb; outline-offset:2px; }

.message h1,h2,h3 { margin: .6em 0 .3em; }
.message p, .message ul, .message ol { margin: .4em 0; }
.message li { margin: .2em 0; }
.message hr { border: 0; border-top: 1px solid #eee; margin: 1em 0; }
.message code { padding: .15em .3em; background:#f6f8fa; border-radius:4px; }
.message pre  { padding: .6em; background:#f6f8fa; border-radius:6px; overflow:auto; }
.message pre { max-height: 420px; }
.message img { max-width: 100%; height: auto; display: block; margin: .4rem 0; }
.action-bar { display:flex; justify-content:space-between; align-items:center; gap:.5rem; margin:.5rem 0 0; }
.action-bar .btn { margin-right:.4rem; }
.action-bar .upsell { color:#888; font-size:.9em; }
.action-bar .subscribe { display:flex; align-items:center; gap:.4rem; }
.action-bar select { padding:.25rem .4rem; }
/* Base bar */
.action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
  margin: .5rem 0 0;
  padding: .5rem .6rem;
  border: 1px solid #eee;
  border-radius: 10px;
  background: #fafafa;
}
.action-bar .btn {
  background: #fff;
  border: 1px solid #ddd;
  color: #111;
  padding: .35rem .6rem;
  border-radius: 8px;
  cursor: pointer;
}
.action-bar .btn:hover { background: #f3f4f6; }
.action-bar .btn-primary { background: #2563eb; border-color: #1d4ed8; color: #fff; }
.action-bar .btn-secondary { background: #4b5563; border-color: #374151; color: #fff; }
.action-bar .upsell { color: #666; font-size: .9em; }
.action-bar .subscribe { display: flex; align-items: center; gap: .4rem; }
.action-bar select { padding: .25rem .4rem; border-radius: 6px; border: 1px solid #ddd; }

.action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;              /* more space between left/right clusters */
  margin: .75rem 0 0;
  padding: .6rem .7rem;
  border: 1px solid #eee;
  border-radius: 10px;
  background: #fafafa;
  flex-wrap: wrap;          /* wrap nicely on narrow screens */
}

.action-bar .actions-left,
.action-bar .actions-right {
  display: flex;
  align-items: center;
  gap: .5rem;               /* spacing between buttons within each side */
  flex-wrap: wrap;
}

.action-bar .btn {
  padding: .45rem .75rem;   /* slightly larger click target */
  border-radius: 8px;
  border: 1px solid #ddd;
  background: #fff;
  color: #111;
}

/* Dark mode variants */
.dark-mode .action-bar {
  background: #0f172a;            /* slate-900 */
  border-color: #1f2937;          /* gray-800 */
}
.dark-mode .action-bar .btn {
  background: #111827;            /* gray-900 */
  border-color: #374151;          /* gray-700 */
  color: #e5e7eb;                 /* gray-200 */
}
.dark-mode .action-bar .btn:hover { background: #1f2937; }
.dark-mode .action-bar .btn-primary {
  background: #2563eb; border-color: #1d4ed8; color: #fff;
}
.dark-mode .action-bar .btn-secondary {
  background: #4b5563; border-color: #374151; color: #fff;
}
.dark-mode .action-bar .upsell { color: #9ca3af; }
.dark-mode .action-bar select {
  background: #0b1220; color: #e5e7eb; border-color: #374151;
}

/* Light print theme applied only to cloned content during PDF export */
.print-theme {
  background: #ffffff !important;
  color: #111827 !important; /* gray-900 */
}
.print-theme a { color: #0645ad !important; }
.print-theme pre { background: #f6f8fa !important; color: #111827 !important; }
.print-theme code { background: #f6f8fa !important; }

.dashboard .dash-header { display:flex; justify-content:space-between; align-items:center; padding:16px; }
.dashboard .dash-main { display:grid; gap:24px; padding:16px; }
.saved-list { display:grid; gap:12px; }
.saved-card { display:flex; justify-content:space-between; align-items:center; padding:12px 16px; border:1px solid #ddd; border-radius:12px; }
.saved-title { font-weight:600; }
.saved-source { font-size:12px; opacity:.7; }
.save-to-dashboard { margin-left:12px; }

/* Save to Dashboard — NO BORDER */
.save-to-dashboard{
  display:inline-flex; align-items:center; gap:.45rem;
  padding:.42rem .85rem;
  font-weight:600; font-size:.875rem; line-height:1;
  border:none;                    /* ← no border */
  border-radius:999px;
  background:linear-gradient(180deg, #ffffff, #f8fafc);
  color:#111827;
  box-shadow:0 1px 2px rgba(0,0,0,.06);
  transition:transform .12s ease, box-shadow .12s ease, background-color .12s ease;
  cursor:pointer;
}

.dark-mode .save-to-dashboard{
  background:linear-gradient(180deg, #0f172a, #0b1220);
  color:#e5e7eb;
  box-shadow:0 1px 2px rgba(0,0,0,.45);
}

/* Hover/active (subtle lift, still no border) */
.save-to-dashboard:hover{ transform:translateY(-1px); }
.save-to-dashboard:active{ transform:translateY(0); }

/* Visible focus ring via outer glow, not a border */
.save-to-dashboard:focus{
  outline:none;
  box-shadow:
    0 1px 2px rgba(0,0,0,.08),
    0 0 0 4px rgba(37, 99, 235, .25); /* default blue glow */
}
.dark-mode .save-to-dashboard:focus{
  box-shadow:
    0 1px 2px rgba(0,0,0,.55),
    0 0 0 4px rgba(59,130,246,.35);
}

/* Disabled after save */
.save-to-dashboard:disabled{
  opacity:.55; cursor:default; transform:none;
  box-shadow:none;
}

/* Optional: per-type accents (no border; uses glow + slight bg tint) */
.save-to-dashboard[data-type="scholarship"]{ --accent:#10b981; } /* emerald */
.save-to-dashboard[data-type="internship"] { --accent:#3b82f6; } /* blue    */
.save-to-dashboard[data-type="course"]     { --accent:#f59e0b; } /* amber   */

/* Light mode accent hover/focus */
.save-to-dashboard[data-type]:hover{
  box-shadow:
    0 1px 2px rgba(0,0,0,.08),
    0 0 0 6px color-mix(in srgb, var(--accent, #111827) 18%, transparent);
}
.save-to-dashboard[data-type]:focus{
  box-shadow:
    0 1px 2px rgba(0,0,0,.08),
    0 0 0 6px color-mix(in srgb, var(--accent, #2563eb) 28%, transparent);
}

/* Dark mode accent hover/focus */
.dark-mode .save-to-dashboard[data-type]:hover{
  box-shadow:
    0 1px 2px rgba(0,0,0,.55),
    0 0 0 6px color-mix(in srgb, var(--accent, #e5e7eb) 28%, transparent);
}
.dark-mode .save-to-dashboard[data-type]:focus{
  box-shadow:
    0 1px 2px rgba(0,0,0,.55),
    0 0 0 6px color-mix(in srgb, var(--accent, #93c5fd) 38%, transparent);
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce){
  .save-to-dashboard{ transition:none }
  .save-to-dashboard:hover{ transform:none }
}

@media (max-width: 480px) {
  .chat-layout {
    max-width: 100%;
    border-radius: 0;
  }
}
/* === ADD THIS TO YOUR EXISTING style.css === */
/* === Mobile Enhancements - Don't replace, just add these === */

/* Mobile viewport adjustments */
@media (max-width: 768px) {
  /* Fix the main layout for mobile */
  .chat-layout {
    margin-left: 0;
    padding: 0;
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height */
  }
  
  /* Make header mobile-friendly */
  .heady {
    width: 100%;
    max-width: 100%;
    padding: 12px;
    text-align: center;
  }
  
  .heady .logo {
    height: 32px;
    width: auto;
  }
  
  /* Adjust chat box for mobile */
  #chat-box, .chat-box {
    margin-left: 0;
    padding: 16px;
    padding-bottom: 120px; /* Space for input area */
  }
  
  /* Make messages more mobile-friendly */
  .user-message {
    max-width: 85%;
    font-size: 16px;
    padding: 12px 16px;
    margin-left: auto;
    margin-right: 0;
  }
  
  .bot-message {
    max-width: 85%;
    font-size: 16px;
    padding: 12px 16px;
    margin-right: auto;
    margin-left: 0;
  }
  
  .bot-icon {
    width: 36px;
    height: 36px;
    margin-right: 8px;
    margin-bottom: 0;
  }
  
  /* Fix input area for mobile */
  #message-input-area {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px;
    background-color: var(--input-bg, #fff);
    border-top: 1px solid #e0e0e0;
    z-index: 100;
  }
  
  #message-input {
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 12px;
    width: 100%;
    border-radius: 20px;
  }
  
  /* Fix button container */
  #btn-container {
    position: fixed;
    bottom: 80px;
    left: 0;
    right: 0;
    padding: 0 12px;
    background-color: transparent;
    z-index: 101;
  }
  
  #send-btn, #new-search-btn {
    min-height: 44px; /* Touch target size */
    padding: 12px 24px;
    border-radius: 22px;
    font-size: 16px;
  }
  
  /* Service buttons grid for mobile */
  .service-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 8px 0;
  }
  
  .service-btn {
    padding: 14px 10px;
    font-size: 14px;
    min-height: 48px;
    border-radius: 12px;
  }
  
  /* Mobile sidebar as overlay */
  #sidebar, .sidebar {
    transform: translateX(-100%);
    width: 80%;
    max-width: 300px;
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  /* Show sidebar toggle on mobile */
  #sidebar-toggle {
    display: block;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1001;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #ddd;
    padding: 8px;
    border-radius: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  /* Modal improvements for mobile */
  .modal-content {
    margin: 5% auto;
    width: 95%;
    max-width: 95%;
    padding: 20px;
    max-height: 90vh;
    overflow-y: auto;
  }
  
  /* Action bar for mobile */
  .action-bar {
    flex-direction: column;
    gap: 10px;
    padding: 10px;
  }
  
  .action-bar .actions-left,
  .action-bar .actions-right {
    width: 100%;
    flex-direction: column;
    gap: 8px;
  }
  
  .action-bar .btn {
    width: 100%;
    padding: 12px;
  }
  
  /* Loading spinner position */
  .loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 200;
  }
  
  /* Customize modal for mobile */
  .customize-modal {
    max-height: 85vh;
    overflow-y: auto;
  }
  
  .service-checkboxes {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  
  /* More services toggle */
  #more-services {
    grid-column: 1 / -1;
  }
  
  #toggle-more-btn {
    grid-column: 1 / -1;
    width: 100%;
    margin-top: 8px;
  }
}

/* Smaller phones */
@media (max-width: 380px) {
  /* Single column for service buttons on very small screens */
  .service-buttons {
    grid-template-columns: 1fr;
  }
  
  .service-checkboxes {
    grid-template-columns: 1fr;
  }
  
  .user-message,
  .bot-message {
    font-size: 15px;
    padding: 10px 14px;
    max-width: 90%;
  }
}

/* Dark mode mobile adjustments */
@media (max-width: 768px) {
  .dark-mode #message-input-area {
    background-color: #1e1e1e;
    border-top-color: #444;
  }
  
  .dark-mode #sidebar-toggle {
    background: rgba(30, 30, 30, 0.9);
    border-color: #444;
    color: #fff;
  }
  
  .dark-mode #btn-container {
    background-color: rgba(30, 30, 30, 0.95);
  }
}

/* Smooth scrolling for iOS */
@supports (-webkit-overflow-scrolling: touch) {
  .chat-box {
    -webkit-overflow-scrolling: touch;
  }
}

/* Handle safe areas (iPhone notch, etc.) */
@supports (padding: env(safe-area-inset-bottom)) {
  #message-input-area {
    padding-bottom: env(safe-area-inset-bottom, 12px);
  }
  
  #btn-container {
    bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  }
  
  .sidebar {
    padding-bottom: env(safe-area-inset-bottom, 20px);
  }
}

/* Touch state improvements */
@media (hover: none) {
  .btn:active {
    transform: scale(0.98);
  }
  
  .service-btn:active {
    transform: scale(0.98);
    opacity: 0.9;
  }
}

/* Prevent horizontal scroll */
body {
  overflow-x: hidden;
}

/* Fix message input area visibility */
#message-input-area.hidden {
  display: none !important;
}

/* Ensure proper z-index stacking */
.heady {
  position: relative;
  z-index: 50;
}

#chat-box {
  position: relative;
  z-index: 10;
}

/* Additional mobile typography improvements */
@media (max-width: 768px) {
  h2 {
    font-size: 1.3em;
  }
  
  p {
    line-height: 1.5;
  }
}
/* === FIX FOR MOBILE SIDEBAR === */
/* Add this to your style.css after the existing mobile styles */

@media (max-width: 768px) {
  /* Reset sidebar positioning for mobile */
  #sidebar, .sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    height: 100vh !important;
    width: 80% !important;
    max-width: 300px !important;
    transform: translateX(-100%) !important; /* Start off-screen */
    transition: transform 0.3s ease !important;
    z-index: 1002 !important; /* Above the blur overlay */
    background-color: #f4f4f4 !important; /* Ensure it has a background */
  }
  
  /* When sidebar has 'open' class on mobile */
  #sidebar.open, .sidebar.open {
    transform: translateX(0) !important; /* Slide in */
  }
  
  /* Remove the desktop 'closed' class behavior on mobile */
  #sidebar.closed, .sidebar.closed {
    transform: translateX(-100%) !important; /* Keep it off-screen */
  }
  
  /* Blur overlay when sidebar is open */
  body.sidebar-open::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 1001;
  }
  
  /* Dark mode sidebar on mobile */
  .dark-mode #sidebar,
  .dark-mode .sidebar {
    background-color: #1e1e1e !important;
  }
  
  /* Make sure toggle button is visible and above everything */
  #sidebar-toggle {
    position: fixed !important;
    top: 15px !important;
    left: 15px !important;
    z-index: 1003 !important; /* Above sidebar */
    background: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid #ddd !important;
    padding: 8px !important;
    border-radius: 8px !important;
    width: 44px !important;
    height: 44px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 24px !important;
  }
  
  .dark-mode #sidebar-toggle {
    background: rgba(30, 30, 30, 0.95) !important;
    border-color: #444 !important;
    color: #fff !important;
  }
}

/* === FIXES FOR THREE ISSUES === */
/* Add this to your style.css */

/* === FIX 1: Logo/Header Position === */
@media (max-width: 768px) {
  .heady {
    padding-left: 70px !important; /* Make room for hamburger */
    padding-right: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  
  /* Alternative: Move hamburger down instead (uncomment if preferred) */
  /* #sidebar-toggle {
    top: 60px !important;
  } */
}

/* === FIX 2: Send & New Chat Button Layout === */
#btn-container {
  position: relative; /* Changed from fixed */
  padding: 12px;
  display: flex;
  gap: 12px;
  background: transparent;
  margin-top: 10px;
}

/* When message input is visible, position buttons properly */
#message-input-area:not(.hidden) ~ #btn-container {
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  margin-bottom: 10px;
  padding: 0 12px;
}

@media (max-width: 768px) {
  /* Fix button styling on mobile */
  #send-btn, #new-search-btn {
    min-height: 44px;
    padding: 12px 20px;
    font-size: 15px;
    border-radius: 22px;
    flex: 1;
    white-space: nowrap;
  }
  
  /* When input area is visible */
  #message-input-area:not(.hidden) {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    background: white;
    border-top: 1px solid #e0e0e0;
    z-index: 100;
  }
  
  .dark-mode #message-input-area:not(.hidden) {
    background: #1e1e1e;
    border-top-color: #444;
  }
}

/* === FIX 3: Auto-scroll & Chat Box Padding === */
/* Ensure chat messages aren't hidden behind input area */
#chat-box, .chat-box {
  padding-bottom: 180px !important; /* Space for input + buttons */
  scroll-behavior: smooth;
}

@media (max-width: 768px) {
  #chat-box, .chat-box {
    padding-bottom: 200px !important; /* Extra space on mobile */
  }
}

/* Ensure proper scrolling after new messages */
.bot-message:last-child,
.user-message:last-child {
  margin-bottom: 20px; /* Add extra space at bottom */
}

/* === Additional Button Container Fix === */
@media (max-width: 768px) {
  /* When buttons are shown but input is hidden (initial state) */
  #message-input-area.hidden ~ #btn-container {
    position: relative;
    padding: 12px;
    margin-top: 10px;
  }
  
  /* When both input and buttons are visible */
  #message-input-area:not(.hidden) ~ #btn-container {
    position: fixed;
    bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    left: 12px;
    right: 12px;
    padding: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 99;
  }
  
  .dark-mode #message-input-area:not(.hidden) ~ #btn-container {
    background: #2a2a2a;
  }
}