:root {
  --primary-bg-color: #fff; /*  Example primary color */
  --secondary-bg-color: #EEEEEE; /* Example secondary color */
  --tertiary-bg-color: #F5F5F5;
  --primary-text-color: #0d0d0d;/* Example success color */
  --secondary-text-color: #5d5d5d; /* Example danger color */
  --teritiary-text-color: #8f8f8f; /* Example tertiary color */
  --blood-orange: #f44336; /* Example blood orange color */
  --link-color: #1E90FF; /* Example link color */
  --visited-link-color: #9F7AEA; /* Example visited link color */
  --teal: #20C997;
  --dark-grey: #212121;
  --blue: #2979FF;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary-bg-color: #212121; /*  Example primary color */
    --secondary-bg-color: #2E2E2E; /* Example secondary color */
    --tertiary-bg-color: #2F2F2F;
    --primary-text-color: #fff;/* Example success color */
    --secondary-text-color: #f3f3f3; /* Example danger color */
    --teritiary-text-color: #afafaf; /* Example tertiary color */
    --link-color: #63B3ED; /* Example link color */
    --visited-link-color: #B794F4; /* Example visited link color */
    --teal: #20C997;
    --dark-grey: #E0E0E0;
    --blue: #5393FF;
  }
}

body {
  margin: 0;
  font-family: 'Inter var', sans-serif;
  display: flex;
  align-items: flex-start;
  height: 100vh;
  overflow-x: hidden;
  background-color: var(--primary-bg-color);
  color: var(--primary-text-color);
}

/* Sidebar Styles */
.sidebar {
  position: fixed;
  top: 0;
  left: -340px;
  width: 300px;
  height: 100%;
  background-color: var(--secondary-bg-color);
  color: var(--primary-text-color);
  padding: 20px;
  transition: left 0.3s ease;
  z-index: 1000;
  font-family: 'Inter var', sans-serif;
  overflow-y: auto;
}

.sidebar.open {
  left: 0;
  box-shadow: 2px 0 10px rgba(0, 150, 136, 0.4); /* teal glow */
}

.sidebar h1 {
  font-size: 1.5rem;
  margin-bottom: 30px;
  font-family: 'Inter var', sans-serif;
  text-align: center;
}

/* Accordion Details */
.sidebar details {
  background-color: var(--primary-bg-color);
  border: 1px solid var(--teritiary-bg-color);
  border-radius: 10px;
  margin-bottom: 15px;
  padding: 10px 15px;
  font-size: 1rem;
  font-family: 'Inter var', sans-serif;
  line-height: 1.6;
  box-shadow: 0 2px 3px rgba(0, 150, 136, 0.4); /* teal glow */
}

.sidebar details:hover {
  transform: translateY(-1px); /* subtle lift */
}

/* Remove the native marker */
.sidebar summary::-webkit-details-marker {
  display: none;
}
.sidebar summary::marker {
  content: none;
}

/* Layout */
.sidebar summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-weight: 500;
  font-family: 'Inter var', sans-serif;
  font-size: 0.9rem;
  padding: 0.2rem 0.2rem;
}

/* Chevron on the right */
.sidebar summary::after {
  content: '';
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg); /* chevron pointing right */
  transition: transform 0.25s ease;
  margin-left: 0.5rem;
}

/* Rotate chevron when open */
.sidebar details[open] > summary::after {
  transform: rotate(135deg); /* chevron pointing down */
}

.sidebar p {
  margin: 10px 0 0;
  font-size: 0.9rem;
  font-family: 'Inter var', sans-serif;
}

.sidebar a {
  color: var(--link-color);
}

.sidebar img {
  align-items: center;
}

.sidebar img:hover {
  cursor: pointer;
}

/* Toggle Button */
.toggle-btn {
  position: fixed;
  top: 20px;
  left: 20px;
  font-size: 2rem;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1100;
  color: var(--primary-text-color);
}

.toggle-btn:hover {
  transform: translateY(-1px); /* subtle lift */
}

/* Main Container */
.container {
  margin: 80px auto;
  padding: 0 20px;
  width: 100%;           /* default: full width for mobile */
  max-width: 1200px; 
  flex-grow: 1;
  color: var(--primary-text-color);
  word-wrap: break-word;   /* older syntax */
  overflow-wrap: break-word;
  box-sizing: border-box;
}

.container h1 {
  font-size: 2.5rem;
  font-weight: bold;
  margin: 10px 0 1px;
  text-align: center;
}

.blue {
  color: var(--blue);
}

.teal {
  color: var(--teal);
}

.dark-grey {
  color: var(--dark-grey);
}

.subtitle {
  font-size: 1rem;
  color: var(--secondary-text-color);
  margin-bottom: 30px;
  margin-top: 1px;
  text-align: center;
}

.search-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.search-box textarea {
  width: 98%;
  padding: 10px;
  font-size: 1rem;
  font-family: 'Inter var', sans-serif;
  border-radius: 5px;
  border: none;
  resize: vertical; /* allows vertical resize only */
  background-color: var(--secondary-bg-color);
  color: var(--primary-text-color);
  box-shadow: inset 0 1px 2px #20C997;
  min-height: 75px;
  line-height: 1.5;
}

.search-box textarea::placeholder {
  color: var(--secondary-text-color);
}

.search-box textarea:focus {
  outline: none;
  border: 1px solid #20C997;
  box-shadow: 0 0 6px rgba(32, 201, 151, 0.5);
}

.search-box button {
  background: linear-gradient(to right, #20C997, #00BFA6); /* darker teal gradient */
  color: white;                /* keep text readable */
  font-size: 1rem;
  padding: 7px 15px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  transition: all 0.2s ease-in-out; /* smooth hover effect */
}

/* Hover state */
.search-box button:hover {
  background: linear-gradient(to right, #24D1A1, #19C4A0);
  transform: translateY(-1px); /* subtle lift */
}

.search-box button .icon {
  font-size: 1.2rem;
}

.response-body {
  display: flex;
  flex-direction: column;
  text-align: left;
  word-wrap: break-word;   /* older syntax */
  overflow-wrap: break-word;
  gap: 12px;
}

.response-body button {
  background-color: var(--primary-bg-color);
  color: var(--primary-text-color);
  font-size: 0.7rem;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  align-items: start;
  gap: 8px;
  font-weight: 500;
}

.material-symbols-rounded {
  font-variation-settings:
  'FILL' 0,
  'wght' 400,
  'GRAD' 0,
  'opsz' 24
}

.material-symbols-rounded-fill {
  font-variation-settings:
  'FILL' 1,
  'wght' 400,
  'GRAD' 0,
  'opsz' 24
}

.hidden {
    display: none;
}

.visible {
    display: flex;
    align-items: start;
}

/* Response Container with its own border */
#response-wrapper {
  border: 1px solid var(--teritiary-text-color);
  border-radius: 15px;
  padding: 20px;
  margin-top: 20px;
  background-color: var(--primary-bg-color);
  box-shadow: 0 2px 3px #20C997;
  display: none; /* optional: hide until content is injected */
  font-family: 'Inter var', sans-serif;
}

#response-wrapper.show {
  display: block;
}

/* Markdown inside response */
.markdown-body h3,
.markdown-body h2 {
  margin-top: 0;
  font-size: 1.5rem;
  color: var(--primary-text-color);
}

.markdown-body p, li {
  line-height: 1.5 !important;
  color: var(--secondary-text-color) !important; 
}

.markdown-body a:link {
  color: var(--link-color)
}

.markdown-body a:visited {
  color: var(--visited-link-color);
}

.markdown-body table {
  border-collapse: collapse; /* Ensures borders are collapsed for a clean look */
  color: var(--secondary-text-color) !important; 
}

.markdown-body th, td {
  border: 1px solid var(--secondary-text-color); /* Adds a 1px solid light gray border to cells */
  padding: 8px; /* Adds padding inside cells for readability */
  text-align: left; /* Optional: Aligns text to the left */
}

.markdown-body th {
  background-color: var(--secondary-bg-color); /* Optional: Different background for headers */
  color: var(--primary-text-color) !important;
}

@media (max-width: 750px) {
  .icon-btn::after {
    content: attr(title);
    display: block;
    font-size: 0.50rem;
    color: var(--teritiary-text-color);
    margin-top: 3px;
    text-align: center;
  }

  table, thead, tbody, th, td, tr {
    display: block;
    width: auto;
  }
   
  tr {
    margin-bottom: 1rem;
  }
  
  td {
    display: flex;
    justify-content: space-between;
  }
}

small .material-symbols-rounded {
  font-size: 1.25em;   /* makes it scale with <small> */
  vertical-align: middle; /* optional: align with text */
}

.icon-btn {
  background: none;       /* remove default button background */
  border: none;           /* remove default border */
  cursor: pointer;        /* show hand cursor on hover */
}

/* Hover state */
.icon-btn:hover {
  transform: translateY(-1px); /* subtle lift */
}

.footer {
  flex-shrink: 0; /* Prevent the footer from shrinking */
  padding: 20px;
  text-align: center;
  display: none;
  font-size: x-small;
}

.footer.show {
  display: block;
}

.footer img:hover {
  cursor: pointer;
  transform: translateY(-1px); /* subtle lift */
}

#loader {
      display: flex;
      align-items: center;
      justify-content: left;
      gap: 8px; /* space between spinner and text */
      font-family: 'Inter var', sans-serif;
      font-size: 1rem;
      color: var(--secondary-text-color);
    }

.spinner {
      width: 1em;   /* scale with text size */
      height: 1em;  /* ensure circle */
      border: 0.2em solid var(--secondary-bg-color);
      border-top: 0.2em solid #20C997;
      border-radius: 50%;
      box-sizing: border-box; /* keeps proportions consistent */
      animation: spin 1s linear infinite;
      flex-shrink: 0; /* don’t let flexbox distort it */
    }

    @keyframes spin {
      0% { transform: rotate(0deg); }
      100% { transform: rotate(360deg); }
    }