/* Base styles */
body {
    font-family: 'Noto Sans', sans-serif;
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
    line-height: 1.3;
    background-color: #F1F5F8;
    /* cee0ee9c */
}

/* Layout */
.chat-wrapper {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.chat-container {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
    scrollbar-color: #17407EF0 #F1F5F8;
    scrollbar-width: thin;
}

.chat-box {
    width: 60%;
    max-width: 750px;
    min-width: 600px;
    margin: 0 auto;
    padding-bottom: 90px;
    padding-top: 20px;
    box-sizing: border-box;
}

:root {
  --top-bar-height: 40px;
  --left-bar-width: 0px;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    top: var(--top-bar-height);
    left: var(--left-bar-width);
    width: calc(100% - var(--left-bar-width));
    height: calc(100% - var(--top-bar-height));
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.1);
}

.modal-content {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow-y: auto;
    scrollbar-color: #17407EF0 #F1F5F8;
    scrollbar-width: thin;
    background-color: #ffffff;
    margin: 2vh auto;
    padding: 40px;
    border-radius: 7px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    width: 58%;
    height: 80vh;
    transition: all 0.3s ease;
    transform: scale(1);
    transform-origin: center center;
    opacity: 1;
    max-width: 800px;
}

.modal.closing .modal-content {
    transform: scale(0.4);
    opacity: 0;
}

.modal h2 {
    color: #0D3066;
    font-size: 36px;
    margin-bottom: 10px;
    font-family: noto sans;
    font-weight: 700;
    line-height: 1.25;
    margin-top: 5px;
}

.modal p {
    font-size: 16px;
    line-height: 1.5;
    font-family: noto sans;
}

.modal-button {
    background-color: #CA1F7B;
    color: #fff;
    border: none;
    font-weight: 600;
    padding: 14px 24px;
    font-size: 18px;
    border-radius: 360px;
    width: 100%;
    min-height: 52px;  
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s;
    margin: 18px 0 0;
    display: block;
}

.modal-button:hover {
    background-color: #b51c6d;
}

.modal-button:active {
    transform: scale(0.98);
}

.modal-close-button {
    position: absolute;
    top: 15px;
    right: 15px;
    color: #999;
    font-size: 27px;
    font-weight: 300;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0 5px;
    line-height: 1;
    transition: background-color 0.2s;
}

.modal-close-button:hover {
    color: #17407EF0;
}

.modal-back-button {
    position: absolute;
    top: 15px;
    left: 15px;
    font-size: 23px;
    font-weight: 300;
    cursor: pointer;
    color: #999;
    background: none;
    border: none;
    padding: 0 5px;
    line-height: 1;
    transition: background-color 0.2s;
}

.modal-back-button:hover {
    color: #17407EF0;
}

#diagnosis-modal h2 {
    margin-top: 10px;
    margin-bottom: 12px;
}

#feedback-modal h2 {
    margin-top: 10px;
    margin-bottom: 12px;
}

#disclaimer-modal h2 {
    margin-top: 10px;
}

.error-message {
    color: #d32f2f;
    font-size: 0.75em;
    display: none;
    padding: 4px 8px;
    position: sticky;
    top: 100%;
}

#server-error.error-message {
    position: absolute;
    bottom: 0;
    top: unset;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    max-width: 400px;
    text-align: center;
    margin-bottom: 8px;
    z-index: 10;
}

.hidden {
  display: none;
}

.modal-content ul {
  list-style-type: none;
  padding-left: 0;
  margin-top: 5%;
  font-size: 16px;
  font-family: noto sans;
}

.modal-content li {
  position: relative;
  padding-left: 40px;
  margin-top: 2%;
  line-height: 1.4;
  width: 90%;
}

.modal-content li::before {
  content: '•';
  color: #0D3066;
  font-size: 1.6em;
  position: absolute;
  left: 10px;
  top: 0;
}

.modal-content li strong {
  color: #0D3066;
}

.language-selector {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1000;
}

.language-selector select {
    padding: 7px;
    border-radius: 14px;
    border: 1px solid #E5E5E5;
    background-color: #F7F7F7;
    font-size: 17px;
    font-weight: bold;
}

/* Progress Bar */
#progress-bar-container {
  position: fixed;
  top: 55px;
  transform: translateX(-50%);
  width: 55%;
  min-width: 620px;
  max-width: 820px;
  height: 10px;
  background-color: white;
  z-index: 1000;
  border-radius: 6px;
  padding: 3px;
  border: 1px solid #01162f30;
  box-shadow: 0px 4px 8px 0px #6E6E6E21;
}

#progress-bar {
  width: 0;
  height: 100%;
  background-color: #CA1F7B;
  transition: width 0.3s ease-in-out;
  border-radius: 5px;
  margin-left: 5px;
  margin-right: 5px;
}

/* User input - Default Centered Position */
.user-input {
    width: 55%;
    min-width: 620px;
    max-width: 800px;
    position: absolute;
    top: 60%;
    left: 49.55%;
    transform: translate(-50%, -50%);
    background-color: white;
    box-sizing: border-box;
    border-radius: 20px;
    display: flex;
    align-items: center; /* Changed from flex-start to center the send button */
    min-height: 80px; /* Reduced from 76px */
    max-height: 120px; /* Reduced from 150px */
    padding: 8px 15px; /* Reduced from 12px 15px */
    border: 1px solid #01162f30;
    transition: all 0.5s ease-in-out;
    z-index: 100;
    box-shadow: 0px 4px 8px 0px #6E6E6E21;
}

/* ADD a specific rule for the textarea when input is centered (NOT .at-bottom) */
/* This rule will override the global textarea { max-height: none; } due to higher specificity */
.user-input:not(.at-bottom) textarea {
    max-height: 100px; /* Example: Max height for the textarea itself.
                           Adjust this value. It should be less than the .user-input's max-height
                           to account for padding and the send button.
                           The global 'overflow-y: auto;' on textarea will make it scroll. */
}

/* Class to move user input to the bottom */
.user-input.at-bottom {
    position: fixed;
    top: auto;
    bottom: 10px;
    transform: translateX(-50%);
    border-radius: 20px;
    border: 1px solid #01162f30;
    padding: 8px 15px; /* Reduced from 12px 15px */
    min-height: 56px; /* Reduced from 76px */
    max-height: 200px; /* Reduced from 250px */
}

/* (Optional but recommended) Ensure textarea at bottom reverts to global max-height behavior if needed */
/* This ensures that when .at-bottom is applied, the :not(.at-bottom) rule doesn't interfere */
/* and the global 'max-height: none' for textarea is effectively active for auto-resize logic */
.user-input.at-bottom textarea {
    max-height: none; /* Explicitly allow it to grow based on JS logic for bottom state */
}

textarea {
    flex: 1;
    /* padding: 5px 15px 15px; */ /* Padding is now on .user-input for textarea container */
    padding: 5px 0 0 0; /* Minimal padding for textarea itself */
    border: none;
    outline: none;
    resize: none;
    max-height: none; /* Default: allows textarea to grow. Will be overridden by more specific rules. */
    overflow-y: auto; /* Default: allows scroll if height is constrained and content overflows. */
    background-color: transparent;
    font-size: 16px;
    line-height: 1.4;
    font-family: inherit;
}

textarea:focus {
    outline: none;
    box-shadow: none;
}

textarea::placeholder {
  color: rgba(0, 0, 0, 0.4); /* Black with 50% opacity */
  opacity: 1; /* Ensures consistency across browsers */
}

/* For Internet Explorer */
textarea:-ms-input-placeholder {
  color: rgba(0, 0, 0, 0.4);
}

/* For Edge */
textarea::-ms-input-placeholder {
  color: rgba(0, 0, 0, 0.4);
}

#send-button {
    background-color: #CA1F7B;
    color: white;
    border: none;
    border-radius: 30%; /* Make it perfectly round */
    width: 37px; /* Reduced from 37px */
    height: 37px; /* Reduced from 37px */
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.3s ease;
    flex-shrink: 0;
}

/* Message styles */
.message-header {
    display: flex;
    align-items: flex-end;
    padding-bottom: 10px;
    margin-left: 0;
}

.avatar-name {
    font-weight: bold;
    user-select: none;
}

.user-avatar,
.chatbot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-top: -10px;
    margin-right: 8px;
    user-select: none;
    flex-shrink: 0;
}

.chatbot-avatar {
    float: left;
}

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

.disable-animation {
    animation: none !important;
}

.message-text {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 15px;
    display: inline-block;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.user-message,
.chatbot-message {
    text-align: left;
}

.user-message {
    animation: slideInUp 0.4s ease-out;
}

.chatbot-message {
    position: relative;
}

.chatbot-message:not(.streaming) {
    animation: slideInUp 0.4s ease-out;
}

.chatbot-message .message-text,
.user-message .message-text {
    display: flex;
    align-items: flex-start;
    padding: 22px 10px 20px;
}

.chatbot-message .message-text {
    background-color: #cee0ee9c;
    display: block;
    border: 1px solid #4a90e214;
}

.user-message .message-text {
    background-color: #f0f0f0;
    display: inline-flex;
    min-width: 20%;
    padding-right: 20px;
    padding-top: 20px;
    padding-bottom: 13px;
    max-width: calc(100% - 30px);
    border: 1px solid #0d1a281a;
}

.message-content {
    flex-grow: 1;
    word-wrap: break-word;
    overflow-wrap: break-word;
    overflow: hidden;
    padding-bottom: 5px;
}

.message-text form {
    margin-top: 10px;
}

.message-text input,
.message-text select {
    margin: 5px 0;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

/* Question mark container */
.question-mark-container {
    position: absolute;
    bottom: -14px;
    right: 7px;
    display: flex;
    min-width: fit-content;
}

.question-mark-action {
    font-size: 12px;
    color: #3E6AAB;
    background-color: #E9EFF9;
    border-radius: 8px;
    padding: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    transition: background-color 0.3s ease;
    border: 1px solid #D1E0F6;
    white-space: nowrap;
}

.question-mark-action:hover {
    background-color: #cee0ee;
}

.question-mark-action svg {
    flex-shrink: 0;
    margin-right: 4px;
    width: 14px;
    height: 14px;
}

/* Explanation Modal */
.explanation-modal {
    display: flex;
    position: fixed;
    z-index: 1000;
    top: var(--top-bar-height);
    left: var(--left-bar-width);
    width: calc(100% - var(--left-bar-width));
    height: calc(100% - var(--top-bar-height));
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.3s ease-out;
    pointer-events: none;
}

.explanation-modal.show {
    opacity: 1;
    pointer-events: auto;
}

.explanation-modal .modal-content {
    background-color: #ffffff;
    margin: auto;
    padding: 2.5rem;
    border-radius: 12px;
    width: 88%;
    max-width: 500px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    position: relative;
    transition: all 0.3s ease;
    transform: scale(0.7);
    opacity: 0;
    height: unset;
}

.explanation-modal.show .modal-content {
    transform: scale(1);
    opacity: 1;
}

.explanation-modal.closing .modal-content {
    transform: scale(0.7);
    opacity: 0;
}

.explanation-header {
    display: flex;
    justify-content: center;
    align-items: center; /* Add this for vertical centering too */
    margin-bottom: 15px;
    text-align: center; /* Add this to ensure centering */
}

.question-icon {
    width: 32px;
    height: 32px;
    opacity: 0.7;
}

.explanation-modal .modal-content {
    text-align: center;
    padding: 20px;
}

.explanation-modal p {
    margin: 0;
    line-height: 1.5;
}

/* Initial form styles */
#initial-form-modal {
    justify-content: flex-start;
}

.disclaimer {
    font-size: 12px !important;
    color: #6c757d;
    padding: 5px;
}

.form-row {
    display: flex;
    margin-bottom: 25px;
    margin-left: auto;
    margin-right: auto;
    flex-direction: column;
}

.form-group {
    width: 100%;
    display: flex;
    flex-direction: column;
}

#user-details-form label {
    font-weight: 400;
    display: block;
    margin-bottom: 12px;
    font-size: 16px;
}

#user-details-form input[type="number"] {
    width: 100%;
    min-height: 48px;
    border-radius: 360px;            
    border: 1px solid #E5E5E5;
    background-color: #F7F7F7;  
    padding: 16px;
    box-sizing: border-box;
    font-size: 16px;
}

#user-details-form input[type="number"]:focus {
    border-color: #17407EF0;
    outline: none;
    box-shadow: 0 0 0 1px #17407e3b;
}

.age-hint {
    display: block;
    font-size: 11px;
    color: #6c757d;
    text-align: left;
    margin-top: -4px;
}

.gender-options {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.radio-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;                 /* Ensures a minimum height */
  padding: 5px 25px 4px 25px;      /* Top, Right, Bottom, Left */
  border: 1px solid #E5E5E5;         /* Light gray border */
  border-radius: 360px;             /* Fully rounded, pill shape */
  background-color: #F7F7F7;         /* Surface-gray-lighter background */
  gap: 12px;                        /* Gap between icon and text */
  font-family: 'Noto Sans', sans-serif;
  font-size: 16px;                  /* Adjust if needed */
  color: #000;                      /* Base text color */
  cursor: pointer;
  min-width: 90px;
  text-align: center; 
}

.radio-label input[type="radio"] {
    display: none;
}

.radio-label input[type="radio"]:checked + .gender-icon,
.radio-label input[type="radio"]:checked + .gender-icon + .gender-text {
    color: #17407EF0;
}

#initial-form-modal .radio-label:has(input[type="radio"]:checked) {
    background-color: #F1F5F8;  /* your desired selected background */
    border-color: #17407EF0;      /* update border for selected state */
  }

.gender-icon {
    font-size: 30px;
    margin-bottom: 10px;
    color: #6c757d;
}

.gender-text {
    font-size: 16px;
    color: #495057;
}

.custom-radio {
    width: 20px;
    height: 20px;
    border: 2px solid #17407EF0;
    border-radius: 50%;
    margin-right: 10px;
    position: relative;
}

.custom-radio::after {
    content: '';
    width: 10px;
    height: 10px;
    background-color: #17407EF0;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
}

.radio-label input[type="radio"]:checked + .custom-radio::after {
    transform: translate(-50%, -50%) scale(1);
}

.gender-options {
    display: flex;
}

.gender-options label {
    margin-right: 10px;
    font-weight: normal;
}

input[type="number"] {
    padding: 8px;
    margin-bottom: 10px;
    -moz-appearance: textfield;
    appearance: textfield;
}

input[type="number"]::-webkit-inner-spin-button, 
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#start-chat-button {
    margin-left: auto;
    margin-right: auto;
}

#start-chat-button:active {
    transform: scale(0.98);
}

.form-instructions {
    margin: 0 auto 8%;
    text-align: center;
    font-size: 18px;
    line-height: 1.5;
}

.intro {
    margin: 0 auto 4%;
    font-size: 18px;
    line-height: 1.5;
    font-weight: 400;
}

/* Welcome message */
.welcome-screen {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    height: 90%;
    position: absolute;
    top: 0;
    left: var(--left-bar-width);
    right: 0;
    bottom: 0;
    background-color: #F1F5F8;
    transition: opacity 0.3s ease-out;
}

.welcome-logo {
    width: 80px;
    height: 80px;
    padding-right: 10px;
}

.welcome-text {
    font-size: 30px;
    font-weight: unset;
    color: #0D3066;
    text-align: center;
    max-width: 80%;
}

/* Typing Indicator */
.typing-indicator {
    animation: slideInUp 0.4s ease-out;
}

.typing-indicator .message-text {
    /* background-color: #E9EFF9; */
    padding-top: 26px;
    padding-bottom: 28px;
    width: 25%;
    background-color: #cee0ee9c;
    border: 1px solid #4a90e214;
}

.typing-indicator .dots {
    display: flex;
    padding-left: 4px;
}

.typing-indicator .dot {
    width: 8px;
    height: 8px;
    background-color: #888;
    border-radius: 50%;
    margin-right: 4px;
    opacity: 0;
    animation: fadeDot 1.8s infinite;}

.typing-indicator .typing-avatar {
    margin-top: -15px;
}

.typing-indicator .dot:nth-child(2) { animation-delay: 0.3s; }
.typing-indicator .dot:nth-child(3) { animation-delay: 0.6s; }

@keyframes fadeDot {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

/* Disclaimer Modal */
.disclaimer-modal .modal-content {
    background-color: #ffffff;
    transition: all 0.3s ease;
    transform: scale(0.7);
    opacity: 0;
}
.disclaimer-modal.show .modal-content {
    transform: scale(1);
    opacity: 1;
}

#disclaimer-modal p {
    margin-top: 0;
}

#iunderstand-button {
    margin-left: auto;
    margin-right: auto;
    width: 40%;
}

#new-errordiagnosis-button {
  margin-left: auto;
  margin-right: auto;
  display: block; /* ensures the auto margins will work */
}


/* Diagnosis Modal */
.accordion {
    margin-top: 5%;
}

.accordion-item {
    margin-bottom: 2%;
    border: 1px solid #b3b1b1;
    border-radius: 8px;
    overflow: hidden;
}

.accordion-button {
    background-color: #f8f9fa;
    color: #333;
    cursor: pointer;
    padding: 16px 20px;
    width: 100%;
    text-align: left;
    border: none;
    outline: none;
    transition: all 0.3s ease;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-left: 0px;
}

.accordion-button:hover {
    background-color: #e9ecef;
}

.accordion-button:focus {
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.3);
}

.accordion-content {
    display: none;
    padding: 20px;
    background-color: #fff;
    border-top: 1px solid #e0e0e0;
}

.accordion-content p {
    font-size: 16px;
    line-height: 1.6;
    color: #495057;
    margin-bottom: 15px;
}

.accordion-button::after {
    content: '+';
    font-size: 20px;
    color: #0D3066;
    transition: transform 0.3s ease;
}

.accordion-button.active::after {
    content: '−';
}

.accordion-content.active {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

#continue-button {
    margin-left: auto;
    margin-right: auto;
    background-color: #F7F7F7;
    color: #333;
    border: 1px solid #e0e0e0;
}

#continue-button:hover {
    background-color: #e9ecef;
}

#new-diagnosis-button {
    margin-left: auto;
    margin-right: auto;
    background-color: #F7F7F7;
    color: #333;
    border: 1px solid #e0e0e0;
}

#new-diagnosis-button:hover {
    background-color: #e9ecef;
}

.header-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.header-row h2 {
  margin: 0;
}

#show-report-button {
    margin-bottom: 15px;
    padding: 10px 12px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Feedback Modal */
#feedback-modal .form-group {
    margin-top: 10px;
    width: 97%;
    padding-left: 0%;
}

#feedback-modal .form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 16px;
    color: #333;
    font-family: 'Noto Sans', sans-serif;
}

#feedback-modal .form-group input[type="email"],
#feedback-modal .form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: clamp(14px, 2vw, 16px);
}

#feedback-modal .form-group input[type="email"]:focus,
#feedback-modal .form-group textarea:focus {
  outline: none;
  /* Optional: add a custom focus style */
  border-color: #17407EF0; /* Or any color you prefer */
}

#feedback-modal textarea {
    resize: vertical;
    min-height: 30px;
}

#submit-feedback-button {
    margin-bottom: 15px;
    padding: 10px 12px;
}

#submit-feedback-button:disabled {
    background-color: #bdc3c7;
    color: #666666;
    cursor: not-allowed;
    opacity: 0.7;
}

#feedback-modal #thank-you-message {
    /* font-size: 18px; */
    /* color: #0D3066; */
    text-align: center;
    margin-top: 20px;
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#feedback-modal #thank-you-message p{
    font-size: 28px;
    color: #0D3066;
}

#feedback-modal #thank-you-message.show {
    opacity: 1;
    transform: translateY(0);
}

.nps-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  margin-bottom: 2%;
  font-size: clamp(12px, 1.5vw, 15px);
  color: #17407EF0;
}
.nps-scale {
  display: flex;
  flex-direction: column-reverse;
  width: 90%;
}

.nps-options {
    display: flex;
    justify-content: space-between;
}

.nps-button-wrapper {
    flex: 1 1 9%;
    margin: 2px;
}
.nps-button {
  display: inline-block;
  cursor: pointer;
  padding: 5px 15px;
  border: 1.5px solid #17407EF0;
  border-radius: 5px;
  transition: background-color 0.1s, color 0.1s, border-color 0.1s;
  background-color: #f8f9fa;
  font-size: 16px;
  color: #17407EF0;
  font-weight: normal;
}
.nps-radio {
  display: none;
}
.nps-radio:checked + .nps-button,
.nps-button:hover {
    background-color: #3E6AAB;
    color: #fff;
    border-color: #3E6AAB;
}

.nps-field p {
    margin-bottom: 5px;
    margin-top: 5px;
}

#score-error.error-message {
    width: 70%;
    top: 0%;
    margin-top: 0;
}

#email-error.error-message {
    width: 100%;
}

/* Report modal */
.report-modal {
    display: flex;
    position: fixed;
    z-index: 1000;
    top: var(--top-bar-height);
    left: var(--left-bar-width);
    width: calc(100% - var(--left-bar-width));
    height: calc(100% - var(--top-bar-height));
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.3s ease-out;
    pointer-events: none;
}

.report-modal.show {
    opacity: 1;
    pointer-events: auto;
}

.report-modal .modal-content {
    position: relative;
    transition: all 0.3s ease;
    transform: scale(0.7);
    opacity: 0;
}

.report-modal.show .modal-content {
    transform: scale(1);
    opacity: 1;
}

.report-modal.closing .modal-content {
    transform: scale(0.7);
    opacity: 0;
}

.report-modal p {
    margin-top: 5px;
    margin-bottom: 5px;
}

.report-modal h3 {
    margin-top: 15px;
    margin-bottom: 5px;
}

.report-modal ul {
    margin-top: 15px;
    margin-bottom: 5px;
    font-size: initial;
}

.report-modal li::before {
    top: -7px;
    color: unset;
}

.report-modal li strong {
    color: unset;
    font-weight: normal;
}

.report-modal .modal-button {
    margin-left: 15px;
    padding: 10px 12px;
    margin-bottom: 0px;
    margin-top: 0px;
}

/* Responsive styles */
@media (max-width: 1350px) {
    #initial-form-modal .modal-content {
        width: 80%;
        padding: 30px;
    }

    #initial-form-modal .form-instructions {
        max-width: 100%;
        padding: 10px;
        margin-bottom: 10px;
    }

    #initial-form-modal .form-group {
        margin-top: 5px;
    }

    #user-details-form input[type="number"] {
        min-width: 120px;
    }

    #initial-form-modal .error-message {
        width: auto;
        position: relative; /* or simply omit the position property */
    }

    #feedback-modal .modal-content {
        width: 72%;
        padding: 20px;
    }

}

@media (max-width: 768px) {
    .chat-container {
        padding: 10px;
        /* Add safe area padding for mobile browsers */
        padding-top: max(10px, env(safe-area-inset-top));
        padding-bottom: max(10px, env(safe-area-inset-bottom));
    }

    .chat-box {
        width: 100% !important;
        max-width: 100%;
        min-width: 0;
        /* Increase top padding to prevent message hiding */
        padding-top: 50px;
        /* Increase bottom padding for better spacing when input is at bottom */
        padding-bottom: 120px;
    }
}

/* Firefox mobile specific fix - needs less bottom padding */
@media (max-width: 768px) {
    @supports (-moz-appearance: none) {
        .chat-box {
            padding-top: 70px !important;
            padding-bottom: 50px !important;
        }
    }

    .user-input {
        width: 98%;
        min-width: 0;
        left: 50%;
    }

    #progress-bar-container {
        width: 100%;
        min-width: 0;
        border-radius: 0;
    }

    .welcome-text{
        font-size: 25px;
        max-width: 65%;
    }
    
    .modal-content {
        width: 90%;
        padding: 30px;
    }

    .modal h2 {
        font-size: 30px;
    }

    .modal p {
        font-size: 16px;
    }

    .modal-button {
        font-size: 18px;
        padding: 12px 20px;
    }

    .form-instructions {
        max-width: 100%;
        font-size: 14px;
        padding: 10px;
        margin-bottom: 20px;
    }

    .intro {
        font-size: 16px;
        padding-top: 10px;
        margin-bottom: 6%;
    }

    .form-group {
        width: 100%;
        margin-bottom: 5px;
    }

    #iunderstand-button {
        width: 60%;
    }

    #feedback-modal .modal-content {
        width: 90%;
        padding: 20px;
    }
    #diagnosis-modal .modal-content {
        width: 90%;
        padding: 20px;
    }
    #disclaimer-modal .modal-content {
        width: 90%;
        padding: 20px;
    }
    .report-modal .modal-content {
        width: 90%;
        padding: 20px;
    }

    .error-message {
        font-size: 0.75em;
        padding: 0px 5px;
        width: 60%;
    }

    .nps-button-wrapper {
        flex-basis: 18%;
    }

    .modal-content li {
        margin-top: 5%;
        width: 85%;
    }

    .modal-content ul {
        font-size: 15px;
        margin-top: 5%;
    }

    #disclaimer-modal h2 {
        margin-bottom: 15px;
    }

    #initial-form-modal .modal-content {
        width: 90%;
        height: 84vh;
        padding: 20px;
        border-radius: 0;    /* Remove rounded corners for full-screen effect */
        box-shadow: none;    /* Remove shadow if you want a flush look */
        overflow-y: auto;    /* Allow scrolling if content overflows */
      }
    
      #initial-form-modal .modal-content h2 {
        font-size: 32px;
        margin-top: 5px;
      }
}

@-moz-document url-prefix() {
    @media (max-width: 768px) {
      .chat-box {
        padding-bottom: 120px;
      }
    }
  }
  

@media (max-width: 560px) {
    .nps-scale {
        width: 100%;
    }
}

@media (max-width: 500px) {
    .nps-button {
        padding: 4px 10px;
    }
}

@media (max-width: 480px) {
    .chat-container {
        padding: 5px;
    }

    .modal-content {
        width: 90%;
        padding: 15px;
    }
    
    .language-selector select {
        padding: 5px;
        font-size: 13px;
    }

    .header-row {
        display: initial;
        margin-bottom: 1rem;
    }

    #initial-form-modal .modal-content h2 {
        font-size: 24px;
        margin-top: 5px;
      }
}

@media (min-width: 480px) {
  #start-chat-button {
    width: 60%;
    margin-left: 0;
    margin-right: auto;
  }
  
  #user-details-form input[type="number"] {
    width: 60%;
    margin-left: 0;
  }

  .disclaimer {
    width: 60%;
}
}

@media (min-width: 660px) {
    #start-chat-button {
      width: 46%;
    }
    
    #user-details-form input[type="number"] {
      width: 46%;
    }

    .disclaimer {
        width: 46%;
    }
  }


/* Universal small screen fix - affects all screens 480px and below */
@media (max-width: 480px) {
    /* Ensure no horizontal overflow */
    body {
        overflow-x: hidden;
        /* Better mobile viewport handling */
        height: 100dvh; /* Dynamic viewport height when supported */
        height: 100vh; /* Fallback */
    }
    
    .chat-wrapper {
        height: 100dvh; /* Dynamic viewport height when supported */
        height: 100vh; /* Fallback */
    }
    
    .chat-container {
        padding: 8px;
        padding-top: max(15px, env(safe-area-inset-top) + 8px);
        padding-bottom: max(15px, env(safe-area-inset-bottom) + 8px);
        overflow-x: hidden;
    }

    .chat-box {
        width: 100% !important;
        max-width: 100%;
        min-width: 0;
        padding-left: 1px;
        padding-right: 1px;
        /* Increased padding to prevent message cutoff */
        padding-top: 25px;
        padding-bottom: 140px;
        box-sizing: border-box;
    }
}

/* Firefox mobile specific fix for smaller screens */
@media (max-width: 480px) {
    @supports (-moz-appearance: none) {
        .chat-box {
            padding-top: 45px !important;
            padding-bottom: 70px !important;
        }
    }

    .user-input {
        width: 97% !important;
        min-width: 0 !important;
        left: 50%;
        padding: 8px 12px;
        box-sizing: border-box;
    }

    #progress-bar-container {
        width: 100%;
        min-width: 0 !important;
        left: 50%;
    }

    .modal-content-inline {
        padding: 16px;
        margin: 3px 0;
        box-sizing: border-box;
    }

    .modal-content-inline h2 {
        font-size: 24px;
        line-height: 1.2;
    }

    .modal-content-inline .modal-button {
        padding: 12px 16px;
        font-size: 18px;
    }

    .action-buttons-content {
        box-sizing: border-box;
        padding: 0 5px;
    }

    .action-buttons-content .button-row {
        gap: 10px;
    }

    .action-buttons-content .modal-button {
        padding: 10px 12px;
        font-size: 18px;
    }

    .accordion-button {
        padding: 12px 15px;
        font-size: 16px;
    }

    .accordion-content {
        padding: 15px;
    }

    .user-message .message-text {
        max-width: calc(100% - 15px);
        padding-right: 20px;
        box-sizing: border-box;
    }

    .message-content {
        font-size: 15px;
        overflow-wrap: break-word;
        word-wrap: break-word;
    }

    textarea {
        font-size: 15px;
    }

    #send-button {
        width: 34px;
        height: 34px;
        flex-shrink: 0;
    }

    .modal-content li {
        padding-left: 25px;
        width: 88%;
        box-sizing: border-box;
    }

    .modal-content li::before {
        left: 5px;
    }

    /* NPS buttons for smaller screens */
    .nps-button {
        padding: 2px 6px;
        font-size: 14px;
    }

    .nps-button-wrapper {
        margin: 1px;
    }
}

/* Extra adjustments for very small screens (iPhone SE, etc.) */
@media (max-width: 375px) {
    .chat-container {
        padding: 5px;
        padding-top: max(20px, env(safe-area-inset-top) + 5px);
        padding-bottom: max(20px, env(safe-area-inset-bottom) + 5px);
    }

    .chat-box {
        padding-left: 2px;
        padding-right: 2px;
        /* Extra padding for smallest screens */
        padding-top: 30px;
        padding-bottom: 150px;
    }
}

/* Firefox mobile specific fix for very small screens */
@media (max-width: 375px) {
    @supports (-moz-appearance: none) {
        .chat-box {
            padding-top: 50px !important;
            padding-bottom: 80px !important;
        }
    }

    .user-input {
        width: 92% !important;
        padding: 6px 10px;
    }

    .modal-content-inline {
        padding: 12px;
    }

    .modal-content-inline h2 {
        font-size: 22px;
    }

    .action-buttons-content {
        padding: 0 2px;
    }

    .action-buttons-content .modal-button {
        padding: 8px 10px;
        font-size: 18px;
    }

    .nps-button {
        padding: 1px 4px;
        font-size: 13px;
    }

    #send-button {
        width: 32px;
        height: 32px;
    }

    textarea {
        font-size: 14px;
    }
}

@media (max-height: 916px) {
    #user-details-form input[type="number"] {
        font-size: 16px;
    }

    .gender-icon {
        font-size: 28px;
        margin-bottom: 3px;
    }

    .gender-text {
        font-size: 16px;
    }

    .age-hint {
        font-size: 12px;
        margin-top: -2px;
    }
}

@media (max-height: 750px) {
    #initial-form-modal .form-group {
        margin-bottom: 2%;
    }

    #initial-form-modal .modal-button {
        margin-bottom: 2%;
        margin-top: 2%;
    }

    #initial-form-modal .disclaimer {
        margin-bottom: 1%;
        margin-top: 2%;
    }
    
    .modal h2 {
        font-size: 30px;
        margin-bottom: 0;
        margin-top: 0px;
    }

    .modal p {
        font-size: 15px;
        line-height: 1.3;
    }

    .message-content {
        font-size: 15px;
    }

    .explanation-modal .modal-content {
        font-size: 15px;
    }

    textarea {
        font-size: 15px;
    }

    .accordion-content {
        font-size: 15px;
    }

    #user-details-form input[type="number"] {
        font-size: 15px;
    }

    #user-details-form label {
        font-size: 15px;
        margin-bottom: 8px;
    }

    #user-details-form .radio-label {
        padding: 5px 20px 2px 20px;
    }

    .gender-icon {
        font-size: 26px;
    }

    .gender-text {
        font-size: 15px;
    }

    #feedback-modal .form-group label {
        font-size: 15px;
    }
}

/******************************************/
/* Consent Modal Specific Overrides       */
/******************************************/
/* Base modal styling */
#consent-modal .modal-content {
    width: 70%;
    max-width: 900px;
    height: 85vh;
    padding: 32px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background-color: #ffffff;
}

#consent-modal .modal-body {
    overflow-y: initial;
    margin-bottom: 24px;
    padding-right: 16px;
}

/* Typography */
#consent-modal h1 {
    font-size: 32px;
    margin-bottom: 24px;
    color: #0D3066;
    font-family: "Noto Serif", serif;
    line-height: 1.3;
}

#consent-modal h2 {
    font-size: 22px;
    color: #0D3066;
    margin-top: 28px;
    margin-bottom: 16px;
    line-height: 1.3;
}

/* Uniform text styling */
#consent-modal p,
#consent-modal li,
#consent-modal label,
#consent-modal input[type="text"]::placeholder {
    font-size: 15px;
    line-height: 1.4;
    color: #2c3e50;
}

#consent-modal p {
    margin-bottom: 16px;
}

/* List styling */
#consent-modal ul,
#consent-modal ol {
    margin: 0 0 10px 0;
    padding-left: 24px;
}

#consent-modal li {
    margin-bottom: 8px;
    padding-left: 4px;
    margin-top: 1%;
}

#consent-modal ul {
    list-style-type: disc;
}

#consent-modal li::before {
	content: unset;
}

/* Form elements */
#consent-modal input[type="text"] {
    border: 1px solid #ced4da;
    border-radius: 6px;
    padding: 6px 10px;
    margin: 4px 8px 4px 0;
    outline: none;
    transition: all 0.2s ease;
    background-color: #f8f9fa;
    width: 180px;
}

#consent-modal input[type="text"]:focus {
    border-color: #17407EF0;
    box-shadow: 0 0 0 2px #17407e1a;
    background-color: #ffffff;
}

#consent-modal input[type="text"]::placeholder {
    color: #96a3b5;
    font-size: 15px;
}

/* Checkbox styling */
#consent-modal .checkbox-row {
    display: flex;
    align-items: flex-start;
    margin: 35px 0;
    gap: 12px;
}

#consent-modal input[type="checkbox"] {
    width: 30px;
    height: 30px;
    cursor: pointer;
    border: 2px solid #17407EF0;
    border-radius: 4px;
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    background-color: white;
    transition: background-color 0.2s ease;
    margin-top: -5px;
}

#consent-modal input[type="checkbox"]:checked {
    background-color: #17407EF0;
}

#consent-modal input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 20px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

#consent-modal .checkbox-row label {
    flex: 1;
    cursor: pointer;
}

/* Date display */
#consent-modal #consent-date {
    font-weight: 500;
    margin-left: 8px;
    color: #2c3e50;
}

/* Consent modal error styles */
#consent-modal .error-message {
    display: none;              /* Hidden by default (will be shown by JS) */
    position: static !important;/* Override global 'sticky' */
    top: unset !important;      /* Override top positioning */
    width: 25%;     /* Let it size naturally */
    margin-bottom: 0;
    color: #d32f2f;
    font-size: 0.8rem;
    background-color: #fdeaea;
    padding: 6px 10px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

/* Button styling */
#consent-modal .button-row {
    margin-top: 0px;
    display: flex;
    justify-content: center;
    padding-top: 16px;
    border-top: 1px solid #edf2f7;
}

#consent-modal #consent-accept-button {
    background-color: #17407EF0;
    color: #ffffff;
    border: none;
    padding: 12px 28px;
    font-size: 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

#consent-modal #consent-accept-button:hover {
    background-color: #306fd5;
    transform: translateY(-1px);
}

#consent-modal #consent-accept-button:active {
    transform: translateY(0);
}

/* Responsive design */
@media (max-width: 768px) {
    #consent-modal .modal-content {
        width: 92%;
        height: 85vh;
        padding: 20px 16px;
    }

    #consent-modal .modal-body {
        padding-right: 12px;
    }

    #consent-modal h1 {
        font-size: 24px;
        margin-bottom: 20px;
    }

    #consent-modal h2 {
        font-size: 18px;
        margin-top: 24px;
        margin-bottom: 12px;
    }

    #consent-modal input[type="text"] {
        width: 100%;
        margin: 4px 0 12px 0;
    }

    #consent-modal .checkbox-row {
        margin: 20px 0;
    }

    #consent-modal .button-row {
        justify-content: center;
    }

    #consent-modal #consent-accept-button {
        width: 100%;
        padding: 14px 20px;
    }
}

#show-report-button:disabled {
    background-color: #bdc3c7;
    color: #666666;
    cursor: not-allowed;
    opacity: 0.7;
}

.spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-left: 10px;
  border: 2px solid #cee0ee9c;
  border-top: 2px solid #888;
  border-radius: 50%;
  animation: spin 1.8s linear infinite;
  vertical-align: middle;
}

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

.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 55px;
  background-color: #F1F5F8; /* original background */
  display: flex;
  align-items: center;
  justify-content: flex-start; /* logo on the left */
  padding: 0 20px;
  z-index: 10000;
  border-bottom: 1px solid #0d1a281a; /* same as message box border */
}

.medask-logo {
  height: 40px;
  width: auto;
  padding-top: 5px;
}

.top-bar-logo-link {
  text-decoration: none;
  display: inline-block;
}


.left-bar {
  position: fixed;
  top: 50px; /* starts below the top bar */
  left: 0;
  width: 250px;
  bottom: 0;
  background-color: #F1F5F8; /* same background */
  z-index: 9999;
  border-right: 1px solid #0d1a281a; /* border line */
}

.chat-wrapper {
  margin-top: var(--top-bar-height);    /* offset to clear the top bar */
  margin-left: var(--left-bar-width);      /* no left offset */
  height: calc(100vh - var(--top-bar-height));
  width: calc(100% - var(--left-bar-width));
  overflow: auto;
  display: flex;
  flex-direction: column;
  background-color: #F1F5F8; /* same as original */
}

#progress-bar-container {
  position: fixed;
  left: 49.6%;
  transform: translateX(-50%);
  z-index: 1000;
}

/* Diagnosis indicator flash animation */
.diagnosis-flash .message-text {
  animation: fadeFlash 2.3s ease-in-out infinite;
}

@keyframes fadeFlash {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Diagnosis Details Styling */
.diagnosis-section {
    margin-bottom: 25px;
}

.diagnosis-section:last-child {
    margin-bottom: 10px;
}

.section-title {
    color: #0D3066;
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 8px;
    border-bottom: 2px solid #E9EFF9;
    padding-bottom: 4px;
}

.section-content {
    background-color: #fafbfc;
    padding: 10px 14px;
    margin: 6px 0;
    border-radius: 6px;
    color: #495057;
    font-size: 15px;
    line-height: 1.4;
    margin-bottom: 15px;
}

.reasoning-item {
    background-color: #fafbfc;
    padding: 10px 14px;
    margin: 6px 0;
    border-radius: 6px;
    border-left: 3px solid #17407EF0;
}

.reasoning-item ul {
    margin: 0;
    padding-left: 0;
    list-style: none;
}

.reasoning-item li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 6px;
    color: #495057;
    font-size: 14px;
    line-height: 1.4;
}

.reasoning-item li::before {
    content: '•';
    position: absolute;
    left: 6px;
    top: -6px;
    color: #6c757d;
    font-weight: bold;
}

.reasoning-label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 15px;
    margin-bottom: 5px;
    margin-top: 12px;
    display: flex;
    align-items: center;
}

.reasoning-text {
    color: #495057;
    font-size: 15px;
    line-height: 1.4;
}

.recommendation-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-top: 10px;
}

.rec-card {
    background-color: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.rec-card.help-clinician {
    border-left: 4px solid #CA1F7B;
}

.rec-card.self-care {
    border-left: 4px solid #17407EF0;
}

.rec-card.signs-better {
    border-left: 4px solid #17407EF0;
}

.rec-card.signs-worse {
    border-left: 4px solid #CA1F7B;
}

.rec-title {
    font-weight: 600;
    color: #2c3e50;
    font-size: 15px;
    margin-bottom: 8px;
    display: flex;
}

.rec-icon {
    margin-right: 8px;
    font-size: 16px;
}

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

.rec-list li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 6px;
    color: #495057;
    font-size: 15px;
    line-height: 1.4;
}

.rec-list li::before {
    content: '•';
    position: absolute;
    left: 6px;
    top: -6px;
    color: #6c757d;
    font-weight: bold;
}

.observe-period {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    padding: 12px;
    margin-top: 15px;
    margin-bottom: 15px;
}

.observe-title {
    font-weight: 600;
    color: #856404;
    font-size: 15px;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.observe-text {
    color: #856404;
    font-size: 15px;
    margin: 0;
}

.prevalence-period {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    padding: 12px;
    margin-top: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.prevalence-title {
    font-weight: 600;
    color: #856404;
    font-size: 15px;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.prevalence-text {
    color: #856404;
    font-size: 15px;
    margin: 0;
}

.reasoning-item.missing-symptoms {
    border-left: 3px solid #CA1F7B;
}

/* Responsive adjustments */
@media (min-width: 768px) {
    .recommendation-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 767px) {
    .rec-card {
        padding: 12px;
    }
    
    .section-title {
        font-size: 15px;
    }
    
    .rec-title {
        font-size: 15px;
    }
}

/* Simplified Nested Accordion Styles */
.nested-accordion-item {
    margin-top: 15px;
    margin-bottom: 15px;
    border: none;
    border-radius: 6px;
    overflow: hidden;
    background-color: #fdfdfd;
}

.nested-accordion-button {
    background: linear-gradient(90deg, #f8f9fa 0%, #e9ecef 100%); /* Subtle gradient */
    color: #0D3066;
    font-size: 17px;           /* Slightly smaller than parent */
    font-weight: 500;          /* Less bold than parent */
    font-style: italic;        /* Italicized for distinction */
    cursor: pointer;
    padding: 10px 16px;        /* Less padding than parent */
    width: 100%;
    text-align: left;
    border: none;
    border-left: 3px solid #17407EF0; /* Colored left border accent */
    outline: none;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    transform: translateX(8px); /* Slight indent to show hierarchy */
}

.nested-accordion-button:hover {
    background: linear-gradient(90deg, #e9ecef 0%, #dee2e6 100%);
}

.nested-accordion-button .nested-accordion-icon::before {
    content: '▶'; /* Different triangle style */
    font-size: 14px; /* Smaller icon */
    color: #17407EF0; /* Different color */
    transition: all 0.3s ease;
    display: inline-block;
    margin-right: 4px;
}

.nested-accordion-button.active {
    background-color: #17407EF0;
}

.nested-accordion-button.active .nested-accordion-icon::before {
    content: '▼'; /* Different down arrow */
    color: #17407EF0; /* Keep the same color as non-active */
    transform: rotate(0deg); /* Ensure it's not rotated */
}

.nested-accordion-content {
    display: none;
    padding: 12px 5px;
    background-color: #ffffff;
    border: none;
    border-radius: 0;
    margin-left: 8px; /* Indent content to match button */
}

.nested-accordion-content.active {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

/* Remove left border and background from nested accordion content */
.nested-accordion-content .section-content {
    background-color: transparent;
    border-left: none;
    padding: 0;
    margin: 8px 0;
}

.nested-accordion-content .reasoning-item {
    background-color: transparent;
    border-left: none;
    padding: 0;
    margin: 8px 0;
}

.nested-accordion-content .rec-card.help-clinician,
.nested-accordion-content .rec-card.self-care,
.nested-accordion-content .rec-card.signs-better,
.nested-accordion-content .rec-card.signs-worse {
    border-left: none;
}

/* Inline modal content styles for chat messages */
.modal-content-inline {
    background-color: #ffffff;
    padding: 30px;
    border-radius: 15px;
    margin: 10px 0;
}

.modal-content-inline .modal-body {
    margin-bottom: 20px;
}

.modal-content-inline h2 {
    color: #0D3066;
    font-size: 30px;
    margin-bottom: 10px;
    font-family: 'Noto Sans', sans-serif;
    font-weight: 700;
    line-height: 1.25;
    margin-top: 5px;
}

.modal-content-inline p {
    font-size: 16px;
    line-height: 1.5;
    font-family: noto sans;
}

.modal-content-inline ul {
    padding-left: 24px;
    margin: 16px 0;
    font-size: 16px;
    line-height: 1.5;
    font-family: noto sans;
    list-style: none;
}

.modal-content-inline li {
    color: #333;
    margin-bottom: 18px;
    padding-left: 8px;
    position: relative;
}

.modal-content-inline li::before {
    content: "•";
    position: absolute;
    left: -16px;
    color: #0D3066;
    font-weight: bold;
    font-size: 1.6em;
}

.modal-content-inline li strong {
    color: #0D3066;
    font-weight: 600;
}

.modal-content-inline .modal-button {
    background-color: #CA1F7B;
    color: #fff;
    border: none;
    font-weight: 600;
    padding: 14px 24px;
    font-size: 18px;
    border-radius: 360px;
    width: 100%;
    min-height: 52px;  
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s;
    margin: 35px 0 0;
    display: block;
}

.modal-content-inline .modal-button:hover {
    background-color: #b51c6d;
}

.modal-content-inline .modal-button:active {
    transform: scale(0.98);
}

.modal-content-inline .modal-button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    color: #666666;
}

.modal-content-inline .modal-button:disabled:hover {
    background-color: #cccccc;
}

/* Override pink color for disabled first-child button (like "Generating report") */
.modal-content-inline .button-row .modal-button:first-child:disabled {
    background-color: #F7F7F7 !important;
    color: #333 !important;
    border: 1px solid #e0e0e0 !important;
    cursor: not-allowed;
}

.modal-content-inline .button-row .modal-button:first-child:disabled:hover {
    background-color: #F7F7F7 !important;
}

.modal-content-inline .button-row {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 35px;
}

.modal-content-inline .button-row .modal-button {
    flex: none;
    margin: 0;
    width: 100%;
}

.modal-content-inline .button-row .modal-button:first-child {
    background-color: #CA1F7B;
    color: #fff;
}

.modal-content-inline .button-row .modal-button:first-child:hover {
    background-color: #b51c6d;
}

/* Ensure accordion styles work within chat messages */
.modal-content-inline .accordion {
    margin: 20px 0;
}

.modal-content-inline .accordion-item {
    margin-bottom: 2%;
    border-radius: 8px;
    overflow: hidden;
}

.modal-content-inline .accordion-button {
    width: 100%;
    padding: 16px 20px;
    background-color: #f8f9fa;
    border: none;
    border-radius: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    outline: none;
}

.modal-content-inline .accordion-button::after {
    content: '+';
    font-size: 20px;
    color: #0D3066;
    transition: transform 0.3s ease;
}

.modal-content-inline .accordion-button.active {
    background-color: #f8f9fa;
    color: #333;
}

.modal-content-inline .accordion-button.active::after {
    content: '−';
}

.modal-content-inline .accordion-button:hover {
    background-color: #e9ecef;
}

.modal-content-inline .accordion-button:focus {
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.3);
}

.modal-content-inline .accordion-content {
    display: none;
    padding: 20px;
    background-color: #fff;
    border-top: 1px solid #e0e0e0;
}

.modal-content-inline .accordion-content.active {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

.modal-content-inline .accordion-content p {
    font-size: 16px;
    line-height: 1.6;
    color: #495057;
    margin-bottom: 15px;
}

/* Responsive styles for mobile */
@media (max-width: 768px) {
    .modal-content-inline {
        padding: 20px;
        margin: 5px 0;
    }
    
    .modal-content-inline h2 {
        font-size: 28px;
    }
    
    .modal-content-inline .button-row {
        flex-direction: column;
        gap: 10px;
    }
}

/* Disclaimer and diagnosis content styles (not in message bubbles) */
.disclaimer-content,
.diagnosis-content {
    width: 100%;
    max-width: 800px;
    margin: 0px auto;
}

.disclaimer-content .modal-content-inline,
.diagnosis-content .modal-content-inline {
    margin: 0;
}

/* Add spacing between consecutive content blocks */
.disclaimer-content + .diagnosis-content {
    margin-top: 30px;
}

.disclaimer-content {
    scroll-margin-top: 75px;
}

.diagnosis-content {
    scroll-margin-top: 75px;
}

/* Action buttons content styles (appears after diagnosis) */
.action-buttons-content {
    width: 100%;
    max-width: 800px;
    margin: 20px auto 0;
    /* No background - blends with chat background */
}

.action-buttons-content .button-row {
    display: flex;
    flex-direction: row;
    gap: 20px;
    margin-top: 35px;
}

/* Use original modal button styling for action buttons */
.action-buttons-content .modal-button {
    flex: 1;
    margin: 0;
    background-color: white;
    color: #333;
    border: 1px solid #e0e0e0;
}

.action-buttons-content .modal-button:hover {
    background-color: #e9ecef;
}

/* Add spacing between diagnosis and action buttons */
.diagnosis-content + .action-buttons-content {
    margin-top: 20px;
}

.diagnosis-content + .final-message {
    margin-top: 30px;
}

/* Mobile responsive styles for action buttons */
@media (max-width: 768px) {
    .action-buttons-content .button-row {
        flex-direction: column;
        gap: 15px;
    }
}
