/* Light Theme (Default) */
:root {
    --bg-color: rgb(167, 204, 241);
    --card-bg: rgb(165, 161, 235);
    --text-color: rgb(16, 18, 21);
    --accent-color: rgb(211, 161, 234);
    --shadow: 0 4px 6px rgba(171, 21, 21, 0.1);
}

/* Dark Theme */
[data-theme="dark"] {
    --bg-color: rgb(5, 9, 18);
    --card-bg: rgb(18, 42, 66);
    --text-color: rgb(250, 250, 250);
    --accent-color: #72b4e0;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

body {
    
    background: linear-gradient(135deg, var(--bg-color), rgb(63, 85, 113));
    margin: 20px;
    padding: 20px;
    min-height: 80vh;
    transition: all 0.3s ease;
}

h1 {
    font: 'Georgia', serif;
    font-size: 2.5em;
    color: var(--text-color);
    text-align: center;
    margin-bottom: 0px;
    font-weight: 600;
}

h2 {
    font: 'Arial', sans-serif;
    font-size: 2em;
    color: var(--text-color);
    text-align: center;
    margin-bottom: 5px;
}

h3 {
    font: 'times new roman', serif;
    font-size: 1.5em;
    color: var(--text-color);
    text-align: center;
    margin-bottom: 15px;
}

h4 {
    font: 'Arial', sans-serif;
    font-size: 1.5em;
    color: var(--text-color);
    text-align: left;
    margin-bottom: 5px;
}
/* Container for alignment */
.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 90%;
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
}

  .ribbon {
    position: relative;  
    margin-top: 5px;   /* Push it up above bottom */
    margin-bottom: 15%;
    font-size: 16px;
    text-align: center;
  }


/* Common styles for all boxes */
#description, #diagnose, #response-output, #learn {
  width: 100%;
  max-width: 800px;
  margin-bottom: 0.5rem;
  box-sizing: border-box;
  padding: 1rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
}

/* Description box (textarea) */
#description {
  height: 80px;
  resize: vertical;
}

/* Diagnose and Learn buttons */
#diagnose, #learn {
  cursor: pointer;
  background-color: rgb(180, 122, 224);
  color: rgb(0, 0, 0);
  font-size: 1rem;
  padding: 0.65rem 1.5rem;
  border: none;
  border-radius: 4px;
  width: 100%;
  max-width: 600px;
}

/* Response output box */
#response-output {
  min-height: 100px;
  max-height: 500px;

  overflow-y: scroll;
  overflow-x: hidden;
  white-space: normal;
  word-wrap: break-word;

  max-width: 65%;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.diagnosis {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  width: 100%;
  margin: 20px auto;
  padding: 15px;
  background-color: rgb(122, 201, 223);
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);

  /* ✅ Auto-expand vertically */
  height: auto;
  max-height: none;

  /* ✅ Prevent horizontal overflow */
  overflow-x: hidden;
  overflow-y: visible;

  /* ✅ Wrap long text properly */
  white-space: pre-wrap;
  word-wrap: break-word;
  word-break: break-word;
  box-sizing: border-box;
}

/* Special handling for code or preformatted text */
.diagnosis pre,
.diagnosis code {
  white-space: pre-wrap !important;
  word-break: break-word;
}

.advanced_diagnosis {
    font-family: Arial, sans-serif;
  line-height: 1.6;
  max-width: 800px;
  margin: 20px auto;
  padding: 15px;
  background-color: rgb(122, 201, 223);
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  overflow-x: auto;
  overflow-y: scroll;
  white-space: normal;
  
}

/* formatting the ai generated response */
.response {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  max-width: 800px;
  margin: 20px auto;
  padding: 15px;
  background-color: rgb(179, 227, 241);
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  overflow-y: auto;
  overflow-x: hidden;
  white-space: normal;
}
.response p {
  margin: 10px 0;
}
.response ol, .response ul {
  margin: 10px 0 10px 20px;
  display:block
}
.response li {
  margin-bottom: 5px;
  display: block;
}

.response br + .numbered{
  display: block;
  margin-top: 12px;
}

/* Response container styling */
.response-container {
  background-color: #f9f9f9;
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.response-container p {
  margin: 0.5rem 0;
  line-height: 1.6;
  color: #333;
  font-size: 1.1rem;
}

/* Video list styling */
.video-list {
  list-style-type: none;
  padding: 0;
}

.video-list li {
  margin: 0.5rem 0;
}

.video-list a {
  color: #007bff;
  text-decoration: none;
  font-size: 1rem;
}

.video-list a:hover {
  text-decoration: underline;
}

/* Common styles for login/register inputs */
input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
  width: 100%;
  max-width: 600px;
  margin-bottom: 1rem;
  padding: 0.75rem;
  border: 2px solid #007bff;
  border-radius: 8px;
  font-size: 1.1rem;
  background-color: #fff;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23007bff' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  cursor: pointer;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

select:hover,
select:focus {
  border-color: #0056b3;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
  outline: none;
}

/* Mobile-specific adjustments */
@media screen and (max-width: 600px) {

  
  /* Make fonts larger for better readability */
  input, textarea, button, .content {
    font-size: 10px;   /* Adjust as needed */
  }

  /* Ensure AI output stays inside content area */
  .content {
    max-width: 100%; 
    overflow-wrap: break-word;  /* Prevent text overflow */
    word-break: break-word;
    padding: 10px;
    margin-left: auto;
    margin-right: auto;
  }

  /* Footer visible above bottom margin */
  .ribbon {
    position: relative;  
    margin-top: 5px;   /* Push it up above bottom */
    margin-bottom: 30%;
    font-size: 16px;
    text-align: center;
  }

  body {
    font-size: 0.7rem; /* Smaller font size for mobile */
  }
  
  h1, h2{
    font-size: 0.9rem; /* Smaller font size for mobile */
  }

  h3, h4 {
    font-size: 0.9rem; /* Smaller font size for mobile */
  }


  .container {
    width: 95%;

    padding: 0.5rem;
  }
    
.layout {
     height: 90vh; /* smaller height than 90vh */
}

  #description, #diagnose, #response-output, #learn,
  input[type="text"],
  input[type="email"],
  input[type="password"],
  textarea,
  select {
    max-width: 100%;
    font-size: 0.9rem;
  }

  #description {
    height: 120px;
  }

  #diagnose, #learn {
    padding: 0.75rem;
  }

  #response-output {
    max-height: auto;
    max-width: 65%;
  }

  select {
    font-size: 1rem;
    padding: 0.65rem;
  }

}

/* Touch-friendly tweaks */
button, input, textarea, select {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

form {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 15px;
    box-shadow: var(--shadow);
    max-width: 600px;
    margin: 0 auto;
}

input, textarea {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border: 2px solid var(--accent-color);
    border-radius: 8px;
    font-size: 1em;
    background: rgba(255, 255, 255, 0.9);
    transition: border-color 0.3s;
}

input:focus, textarea:focus {
    border-color: var(--accent-color);
    outline: none;
}

button {
    background: var(--accent-color);
    color: var(--card-bg);
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    cursor: pointer;
    transition: background 0.3s;
}

button:hover {
    background: var(--accent-color);
    opacity: 0.9;
}

pre {
    background: rgba(0, 0, 0, 0.05);
    padding: 15px;
    border-radius: 8px;
    font-size: 1em;
    color: var(--text-color);
}

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--card-bg);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: var(--shadow);
}

.theme-toggle:hover {
    opacity: 0.9;
}

.feedback-item {
  background-color: #f9f9f9;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.feedback-item p {
  margin: 0.5rem 0;
  font-size: 1.1rem;
  color: #333;
}

.feedback-item small {
  color: #666;
  font-size: 0.9rem;
}

nav {
    background: linear-gradient(180deg, rgb(62, 89, 126), var(--bg-color)); /* theme-matching */

}

.info-advanced-diagnosis {
    background: rgb(148, 196, 245); 
    border: 1px solid #e5e7eb; 
    border-radius: 12px;
    padding: 20px;
    max-width: 700px;
    margin: 20px auto;
    font-family: "Segoe UI", sans-serif;
    color: #333;
    line-height: 1.6;
    box-shadow: 0px 4px 10px rgba(0,0,0,0.05);
  }

  .info-advanced-diagnosis p {
    margin-bottom: 12px;
    font-size: 16px;
  }

  .info-advanced-diagnosis p:first-child {
    font-weight: 600;
    font-size: 17px;
    color: #1d4ed8; /* accent blue */
  }

  .info-advanced-diagnosis p:last-child {
    font-style: italic;
    font-size: 14px;
    color: #dc2626; /* red for caution */
  }

/* Responsive adjustments for recommended products*/
/* Reset */
body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: rgb(139, 178, 235);
    color: #333;
}

/* Sidebar */
.sidebar {
    position: relative;
    top: 0;
    left: 0;
    width: 260px;
    height: 50%;
    background: #b3c7e3;
    padding: 20px;
    box-shadow: 2px 0 6px rgba(0,0,0,0.1);
    overflow-y: auto;
}

.sidebar h2 {
    margin-bottom: 15px;
    font-size: 20px;
    color: #222;
}

.sidebar label {
    display: block;
    margin: 12px 0 6px;
    font-size: 14px;
    font-weight: 600;
    color: #444;
}

.sidebar input,
.sidebar select {
    width: 100%;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 14px;
    margin-bottom: 10px;
}

.sidebar button {
    width: 100%;
    padding: 10px;
    background: #ff9900;
    color: #fff;
    font-size: 15px;
    font-weight: bold;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
}

.sidebar button:hover {
    background: #e68a00;
}

/* Products container */
.products-container {
    margin-left: 150px; /* push content away from sidebar */
    padding: 20px;
    margin-right: 100px;
}

.products-container h2 {
    margin: 30px 0 15px;
    font-size: 22px;
    color: #333;
    border-bottom: 2px solid #eeeeee;
    padding-bottom: 5px;
}

/* Grid layout */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

/* Product cards */
.product-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    padding: 15px;
    text-align: center;
    transition: transform 0.2s ease-in-out;
}

.product-card:hover {
    transform: translateY(-5px);
}

.product-card img {
    max-width: 100%;
    height: 160px;
    object-fit: contain;
    margin-bottom: 12px;
}

.product-card h3 {
    font-size: 16px;
    margin: 10px 0;
    color: #222;
}

.product-card p {
    font-size: 14px;
    margin: 5px 0 12px;
    color: #555;
}

/* Amazon Buy button */
.buy-btn {
    display: inline-block;
    padding: 10px 16px;
    background: #ff9900;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: bold;
    transition: background 0.3s;
}

.buy-btn:hover {
    background: #e68a00;
}

.info-recommended-products {
    background: rgb(148, 196, 245); /* light gray background */
    border: 1px solid #e5e7eb; 
    border-radius: 12px;
    padding: 20px;
    max-width: 700px;
    margin: 20px auto;
    font-family: "Segoe UI", sans-serif;
    color: #333;
    line-height: 1.6;
    box-shadow: 0px 4px 10px rgba(0,0,0,0.05);
  }

  .info-recommended-products p {
    margin-bottom: 12px;
    font-size: 16px;
    font-weight: 600;
    font-size: 17px;
    color: #181e2e;
  }

@media (max-width: 768px) {
  /* Adjustments for recommended products page in mobile*/
  .info-recommended-products p {
    font-size: 10px;
  }

  .sidebar {
    position: relative;
    top: 0;
    left: 0;
    width: 200px;
    height: 100%;
    background: #b3c7e3;
    padding: 10px;
    box-shadow: 2px 0 6px rgba(0,0,0,0.1);
    overflow-y: auto;
}

.sidebar h2 {
    margin-top: 1px;  
    margin-bottom: 10px;
    font-size: 14px;
    color: #222;
}

.sidebar label {
    display: block;
    margin: 6px 0 6px;
    font-size: 10px;
    font-weight: 600;
    color: #444;
}

.sidebar input,
.sidebar select {
    width: 100%;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 10px;
    margin-bottom: 5px;
    margin-top: 1px;
}

/* Products container */
.products-container {
    margin-left: 150px; /* push content away from sidebar */
    padding: 20px;
    margin-right: 100px;
}

.products-container h2 {
    font-size: 15px;
    color: #333;
    border-bottom: 2px solid #eeeeee;
    padding-bottom: 5px;
    margin-right: 50px;
}

/* Grid layout */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
    margin-right: 50px;
}

/* Product cards */
.product-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    padding: 15px;
    text-align: center;
    transition: transform 0.2s ease-in-out;
  
}

.product-card:hover {
    transform: translateY(-5px);
}

.product-card img {
    max-width: 100%;
    height: 100px;
    object-fit: contain;
    margin-bottom: 12px;
}

.product-card h3 {
    font-size: 10px;
    margin: 10px 0;
    color: #222;
}

.product-card p {
    font-size: 12px;
    margin: 5px 0 12px;
    color: #555;
}

/* Amazon Buy button */
.buy-btn {
    display: inline-block;
    padding: 10px 16px;
    background: #ff9900;
    color: #071248;
    text-decoration: none;
    border-radius: 6px;
    font-weight: bold;
    transition: background 0.3s;
}

/*adjusments of Advanced dignosis page in mobile*/

  .info-advanced-diagnosis p {
    margin-bottom: 12px;
    font-size: 10px;
  }

  .info-advanced-diagnosis p:first-child {
    font-weight: 600;
    font-size: 13px;
    color: #1d4ed8; /* accent blue */
  }

  .info-advanced-diagnosis p:last-child {
    font-style: italic;
    font-size: 10px;
    color: #dc2626; /* red for caution */
  }
}










