/* ========== components.css ========== */

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-left: auto;             /* push actions to the right */
}

.header-actions ul {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.header-actions li {
  display: flex;
  align-items: center;
}

.header-actions a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  font-size: 1.1rem;
  transition: color 0.18s;
  letter-spacing: 0.02em;
}

.header-actions a:hover,
.header-actions a:focus {
  color: none;
}

.header-actions .theme-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  color: #fff;
}

.header-actions .theme-toggle input[type="checkbox"] {
  accent-color: #ffe386;
  width: 1rem;
  height: 1rem;
}

.header-actions a,
.header-actions .theme-toggle {
  font-family: 'Poppins', Arial, sans-serif !important;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.hero {
  justify-content: center;
}

.hero-tagline {
  font-size: 1rem;
  text-align: center;
  margin-top: 4rem;
  margin-bottom: 3rem;
  font-family: 'Poppins', Arial, sans-serif;
  font-weight: 500;
  letter-spacing: 0.01em;
  /* Color fallback if variables not defined */
  letter-spacing: .1rem;
  color: var(--hero-tagline-color, #564E62);
  display: flex;
  flex-direction: column;
  align-items: center;
  width:100%;
}

.hero-tagline .highlight {
  font-weight: 700;
  text-shadow: 0 2px 6px rgba(0,0,0,0.07);
}

.results-logo-top {
  width:30%
}

/* --- Buttons --- */
.button {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 4px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
}
.button.primary {
  background-color: #dd1bcd;
  color: white;
}
.button.primary:hover { background-color: #6ced39; }
.button.secondary {
  background-color: #00a480;
  color: white;
}
.button.secondary:hover { background-color: #bdd10c; }
.button:focus {
  outline: 3px solid #f1aeae;
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(57, 160, 237, 0.3);
}
.button-large {
  padding: 12px 24px;
  font-size: 1.2rem;
  letter-spacing: 0.5px;
}

/* --- Cards (Assistant Cards) --- */
.assistant-card {
  background-color: var(--color-card-bg);
  color: var(--color-card-text);
  border-radius: 12px;
  padding: 23px 32px 29px 32px;
  text-align: left;
  align-items: flex-start;
  transition: transform 0.3s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  min-height: 160px;
  transform: scale(0.9);
  transform-origin: center;
}
.assistant-card:hover { transform: translateY(-5px); }
.assistant-card .icon { margin-bottom: 16px; display: flex; align-items: center; }
.icon-img { width: 22px; height: 22px; display: block; object-fit: contain; }
.assistant-card h3 {
  font-size: 1.1rem;
  font-family: 'Poppins', Arial, sans-serif;
  font-weight: 600;
  color: var(--color-card-header);
  margin: 0 0 10px 0;
}
.assistant-card p {
  color: var(--color-card-desc);
  font-size: 0.8rem;
  font-family: 'Inter', Arial, sans-serif;
  font-weight: 400;
  line-height: 1.45;
  max-width: 250px;
  margin: 0;
}



/* --- Chat Section and Components --- */
.chat-container {
  border-radius: 12px;
  margin-top: 30px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}
.chat-messages {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  font-family: "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}
.message {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 12px;
  position: relative;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* User and AI message bubbles */
.user-message {
  align-self: flex-end;
  background-color: var(--user-message-bg) !important;
  color: var(--user-message-color) !important;
  border-bottom-right-radius: 4px;
  max-width: 80%;
  margin-left: auto;
  margin-right: 0;
  display: flex;
}
.ai-message {
  align-self: flex-start;
  background-color: transparent !important;
  color: var(--ai-message-color) !important;
  border-bottom-left-radius: 4px;
  max-width: 100%;
  margin-left: 0;
  margin-right: auto;
  display: flex;
  animation: fadeIn 0.5s;
  line-height: 2rem;
}
.ai-message .message-content,
.user-message .message-content {
  border-radius: 0.7em;
  padding: .4em .5em;
  font-size: .95em;
  font-family: "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background: transparent;
}
body.light-mode .user-message .message-content { color: #565451; }
body.light-mode .ai-message .message-content { color: #565451; }
body.dark-mode .ai-message .message-content { color: #f3f6fa; }

/* Chat input */
.chat-input-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 15px;
}
#user-input {
  flex: none;
  min-height: 38px;
  max-height: 180px;
  overflow-y: auto;
  width: 77%;
  border: none;
  padding: 1.5em 2em 3em 1.5em;
  border-radius: 20px;
  background-color: var(--chat-input-bg);
  color: var(--chat-input-text);
  resize: none;
  font-family: inherit;
  font-size: 0.95rem;
  box-shadow: none;
  outline: none;
  transition: background-color 0.2s;
  margin-right: 10px;
}
#user-input:focus { border: none; box-shadow: none; outline: none; }
#user-input::placeholder { color: #9999998f; opacity: 1; }

.send-button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f94a62;
  color: white;
  transition: background-color 0.2s;
}
body.dark-mode .send-button { background-color: #fff; color: #0F162F; }
.send-button i.fa-paper-plane { font-size: 1.1rem; margin-left: -3px; }
.send-button i.fa-stop { font-size: 1rem; }

.typing-indicator {
  display: flex;
  align-items: center;
  margin: 10px 0;
  padding: 12px;
  background: none;
  border-radius: 18px;
  width: fit-content;
}
.typing-indicator span {
  width: 8px;
  height: 8px;
  margin: 0 2px;
  background-color: #F16079;
  border-radius: 50%;
  display: inline-block;
  opacity: 0.6;
  animation: typing-jump 1s infinite;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing-jump {
  0%, 100% { transform: translateY(0); opacity: 0.6; }
  20% { transform: translateY(-6px); opacity: 1; }
  40% { transform: translateY(0); opacity: 0.6; }
}

/* --- Modal, Form, Utility --- */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  overflow: auto;
}
.modal-content {
  background-color: #FFFFFF;
  margin: 15% auto;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.2);
  width: 90%;
  max-width: 400px;
  position: relative;
}
.close-modal {
  position: absolute;
  top: 15px;
  right: 15px;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  color: #3D3D3D;
}
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 5px; color: var(--chat-label-color, #565451); font-weight: 500; }
.form-group input {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
}
.form-message {
  margin: 10px 0;
  padding: 10px;
  border-radius: 4px;
  display: none;
}
.form-message.error {
  background-color: rgba(225,27,34,0.1);
  color: #E11B22;
  display: block;
}
.form-message.success {
  background-color: rgba(40,167,69,0.1);
  color: #28a745;
  display: block;
}
.hidden { display: none !important; }

/* --- Error Message Component --- */
.error-message {
  background-color: #FEE;
  border:1px solid #E11B22;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  margin: 20px 0;
}
.error-message h2 { color: #E11B22; margin-bottom: 10px; }

/* --- Scroll to top button & Chat header --- */
.scroll-top-container {
  display: flex;
  justify-content: center;
  gap: 15px;
  padding: 15px;
  background-color: transparent;
  border-top: none !important;
  box-shadow: none !important;
}
#scroll-top-button,
#clear-chat-button {
  background: var(--scroll-btn-bg);
  color: var(--scroll-btn-text);
  border: 1px solid var(--scroll-btn-border);
  padding: 7px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: none;
  box-shadow: none;
}
#scroll-top-button i,
#clear-chat-button i { font-size: 1rem; color: inherit; }
#scroll-top-button:hover,
#clear-chat-button:hover {
  background: var(--scroll-btn-border);
  color: inherit;
  border-color: var(--scroll-btn-border);
}
.chat-header { display: none !important; }

/* --- Badges and assistant types --- */
.assistant-badge {
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 10px;
  background-color: rgba(255, 255, 255, 0.2);
  color: white;
  margin-right: 8px;
  display: inline-block;
}

.theme-toggle {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

/* Switch Styles */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.switch .slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: transparent;     /* <-- transparent background */
  border: 2px solid white;     /* <-- sets width, style, and color */
  border-radius: 24px;
  transition: background 0.2s;
}
.switch .slider:before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 1px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}
.switch input:checked + .slider {
  background: transparent;
}
.switch input:checked + .slider:before {
  transform: translateX(20px);
}
.switch input:focus + .slider {
  box-shadow: 0 0 1px #4a68f8;
}

/* Remove blue accessibility outline from links */
button:focus,
a:focus,
input:focus,
.switch input:focus + .slider,
.header-actions a:focus,
.desktop-nav a:focus {
  outline: none !important;
  box-shadow: none !important;
}

.chat-messages hr,
.message-content hr {
    border: none; /* Remove default border */
    border-top: 1.5px solid #766784;  
    margin: 2.5em 0;                  
    opacity: 0.6;                     
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.assistant-card.disabled {
    opacity: 0.5;                /* Make it look faded */
    cursor: not-allowed;         /* Show 'stop' cursor */
    filter: grayscale(60%);      /* Even more "disabled" look */
    position: relative;
}

/* Optional: Add an overlay "Under Construction" label */
.assistant-card.disabled::after {
    background: rgba(255,255,255,0.85);
    color: #333;
    font-size: 0.9rem;
    padding: 3px 9px;
    border-radius: 6px;
    font-weight: bold;
    pointer-events: none; /* Don't block clicks (your JS already blocks interaction) */
}
/* Mobile navigation styles */
.mobile-menu-toggle {
    background: none;
    border: none;
    font-size: 2rem;
    color: #fff;
    cursor: pointer;
    padding: 0.2em 0.5em;
    margin-left: 0.2em;
    z-index: 102;
    transition: color 0.2s;
}

.mobile-nav {
    position: fixed;
    top: 1.1em;
    right: 1.1em;
    width: auto;
    min-width: 180px;
    max-width: 90vw;
    background: var(--color-bg, #fff);
    box-shadow: 0 4px 24px 0 rgba(44, 30, 58, 0.18);
    z-index: 101;
    transform: translateX(100%);
    transition: transform 0.2s cubic-bezier(0.4,0,0.2,1);
    display: flex;
    flex-direction: column;
    padding: 1.2em 1.5em 1.2em 1.5em;
    border-radius: 1.1em;
    align-items: flex-end;
    gap: 0.5em;
}

.mobile-nav.open {
    transform: translateX(0);
}

.mobile-menu-close {
    background: none;
    border: none;
    color: #6c4e7c;
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    margin-bottom: 0.2em;
    margin-left: auto;
    margin-right: -0.2em;
    padding: 0 0.2em;
    transition: color 0.2s;
}

body.dark-mode .mobile-menu-close {
    color: #fff;
}

.mobile-nav ul {
    list-style: none;
    padding: 0;
    margin: 0 0 1.2em 0;
    display: flex;
    flex-direction: column;
    gap: 1.2em;
    align-items: flex-start;
}

.mobile-nav ul li a {
    font-family: "Poppins", Arial, sans-serif;
    font-size: 1.18rem;
    color: #6c4e7c;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.18s;
    padding: 0.2em 0;
    display: block;
}

.mobile-nav ul li a.active,
.mobile-nav ul li a:hover {
    color: #c3a7cc;
}

body.dark-mode .mobile-nav {
    background: var(--color-bg, #18192a);
}

@media (min-width: 900px) {
    .mobile-menu-toggle, .mobile-nav {
        display: none !important;
    }
    .desktop-nav {
        display: flex !important;
    }
    .theme-toggle #themeLabel {
        display: inline;
    }
}

@media (max-width: 899px) {
    .desktop-nav {
        display: none !important;
    }
    .header-actions {
        margin-left: auto;
        padding-right:0;
        gap:0.5rem;
    }
    .theme-toggle #themeLabel {
        display: none;
    }
    .results-logo {
      width:40%;
    }
    .results-logo-top {
      width:60%;
    }
}


