/* General Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

/* Hidden class to hide elements */
.hidden {
    display: none;
}

/* Spinner styles */
.spinner {
    border: 4px solid #f3f3f3;
    border-radius: 50%;
    border-top: 4px solid #3498db;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

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

/* Body styles */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--background-color);
    transition: background 0.3s, color 0.3s;
}

/* CSS variables for light and dark themes */
:root {
    --background-color: #ffffff;
    --text-color: #333;
    --primary-color: #007acc;
    --secondary-color: #fff;
    --input-bg: #fff;
    --input-border: #ccc;
    --input-focus-border: #007acc;
    --button-bg: #007acc;
    --button-hover-bg: #005f99;
    --button-text: #fff;
    --results-bg: #e6f7ff;
    --input-text: #333;
    --input-placeholder: #666;
}

[data-theme="dark"] {
    --background-color: #1d1d1d;
    --text-color: #fff;
    --primary-color: #007acc;
    --secondary-color: #2c2c2c;
    --input-bg: #333;
    --input-border: #555;
    --input-focus-border: #007acc;
    --button-bg: #007acc;
    --button-hover-bg: #005f99;
    --button-text: #fff;
    --results-bg: #1d1d1d;
    --input-text: #fff;
    --input-placeholder: #aaa;
    --calendar-icon-filter: invert(1);
}

/* Custom scrollbar styles */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--input-bg);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background-color: var(--primary-color);
    border-radius: 10px;
    border: 3px solid var(--input-bg);
}

::-webkit-scrollbar-thumb:hover {
    background-color: var(--button-hover-bg);
}

/* Login Popup Styles */
#login-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.3s ease;
}

#login-popup.show {
    opacity: 1;
    display: flex;
}

#login-popup .popup-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--secondary-color);
    padding: 2.5rem;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
    max-width: 400px;
    width: 90%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1001;
}

#login-popup.show .popup-content {
    transform: translate(-50%, -50%) scale(1);
}

#login-popup .popup-content p {
    margin-bottom: 2rem;
    font-size: 1.3rem;
    color: var(--text-color);
    line-height: 1.5;
    font-weight: 300;
}

#login-popup button {
    margin-top: 10px;
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

#login-popup button:hover {
    background-color: var(--button-hover-bg);
}

#login-popup button#redirect-login {
    padding: 1.3em 3em;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    font-weight: 500;
    color: #000;
    background-color: #bebebe;
    border: none;
    border-radius: 45px;
    box-shadow: 0px 8px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease 0s;
    cursor: pointer;
    outline: none;
    margin-top: 1rem;
}

#login-popup button#redirect-login:hover {
    background-color: #002e92;
    box-shadow: 0px 15px 20px rgba(1, 44, 138, 0.4);
    color: #fff;
    transform: translateY(-7px);
}

#login-popup button#redirect-login:active {
    transform: translateY(-1px);
}

/* Header styles */
header {
    color: #fff;
    padding: 0.4rem 1rem; /* Reduced padding */
    min-height: 55px; /* Reduced height */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: lighter;
}

.logo-img {
    width: 50px; /* Reduced from 80px */
    height: 50px; /* Reduced from 80px */
    object-fit: contain;
}

.logo span {
    color: rgb(31, 31, 31); /* Default color for light mode */
}

[data-theme="dark"] .logo span {
    color: white; /* Color for dark mode */
}

/* Hero section styles */
#hero {
    text-align: center;
    padding: 2rem;
    background: var(--secondary-color);
}

#hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

#hero form {
    margin-top: 1rem;
}

/* Input and select styles */
#hero input[type="text"],
#hero input[type="number"],
#hero input[type="date"],
#hero select {
    padding: 0.75rem;
    width: 80%;
    max-width: 500px;
    border: 1px solid var(--input-border);
    border-radius: 5px;
    margin-bottom: 1rem;
    font-size: 1rem;
    background: var(--input-bg);
    transition: border-color 0.3s, box-shadow 0.3s;
}

#hero input[type="text"]:focus,
#hero input[type="number"]:focus,
#hero input[type="date"]:focus,
#hero select:focus {
    border-color: var(--input-focus-border);
    box-shadow: 0 0 5px rgba(0, 122, 204, 0.5);
    outline: none;
}

/* Button styles */
#hero button {
    padding: 0.75rem 1.5rem;
    background: var(--button-bg);
    color: var(--button-text);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s, transform 0.3s;
}

#hero button:hover {
    background: var(--button-hover-bg);
    transform: translateY(-2px);
}

/* Results section styles */
#results {
    display: none;
    margin-top: 20px;
    padding: 20px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #f9f9f9;
}

#results.hidden {
    display: none;
}

#results h3 {
    margin-top: 0;
}

#results p {
    margin: 5px 0;
}

#results {
    padding: 2rem;
    display: none;
    background: var(--results-bg);
}

#results h2 {
    margin-bottom: 1rem;
}

/* Diagnosis information styles */
.diagnosis {
    margin-bottom: 1rem;
    padding: 1rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #002b643d;
}

.diagnosis p {
    margin: 0.5rem 0;
}

.diagnosis a {
    color: var(--primary-color);
    text-decoration: none;
}

.diagnosis a:hover {
    text-decoration: underline;
}

/* Updated Diagnosis Card Styles */
.diagnosis {
    background: linear-gradient(to bottom right, rgba(213, 238, 255, 0.9), rgba(201, 220, 245, 0.95));
    border-radius: 16px;
    padding: 1.8rem;
    margin-bottom: 1.8rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 122, 204, 0.1);
    max-width: 100%;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

[data-theme="dark"] .diagnosis {
    background: linear-gradient(to bottom right, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.7));
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.diagnosis.animate-in {
    animation: slideIn 0.5s ease-out;
}

.diagnosis-header {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid rgba(0, 122, 204, 0.1);
}

.diagnosis-name {
    font-size: 1.4rem;
    font-weight: 600;
    color: #2c3e50;
    flex: 1;
    min-width: 200px;
    letter-spacing: -0.02em;
}

[data-theme="dark"] .diagnosis-name {
    color: #e4e4e4;
}

.diagnosis-specialty {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    background: rgba(0, 122, 204, 0.1);
    border-radius: 25px;
    color: #0078d4;
    white-space: nowrap;
    font-weight: 500;
    letter-spacing: 0.02em;
}

[data-theme="dark"] .diagnosis-specialty {
    background: rgba(255, 255, 255, 0.1);
    color: #79c3ff;
}

/* Status badges */
.status-badge {
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.status-common {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid rgba(46, 125, 50, 0.1);
}

.status-red-flag {
    background: #ffebee;
    color: #c62828;
    border: 1px solid rgba(198, 40, 40, 0.1);
}

/* Recommendation sections */
.diagnosis-recommendation {
    padding: 1.5rem;
    border-radius: 12px;
    margin: 1.2rem 0;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.recommendation-severe {
    background: linear-gradient(135deg, #fff5f5, #ffe5e5);
    border: 1px solid #ffcdd2;
}

.recommendation-moderate {
    background: linear-gradient(135deg, #fff8e1, #fff3e0);
    border: 1px solid #ffe0b2;
}

.recommendation-mild {
    background: linear-gradient(135deg, #f1f8e9, #e8f5e9);
    border: 1px solid #c8e6c9;
}

[data-theme="dark"] .recommendation-severe {
    background: linear-gradient(135deg, rgba(198, 40, 40, 0.15), rgba(198, 40, 40, 0.1));
    border: 1px solid rgba(255, 82, 82, 0.2);
}

[data-theme="dark"] .recommendation-moderate {
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.15), rgba(255, 152, 0, 0.1));
    border: 1px solid rgba(255, 167, 38, 0.2);
}

[data-theme="dark"] .recommendation-mild {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.15), rgba(76, 175, 80, 0.1));
    border: 1px solid rgba(129, 199, 132, 0.2);
}

.recommendation-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.recommendation-text {
    font-size: 1rem;
    line-height: 1.6;
    color: #2c3e50;
}

[data-theme="dark"] .recommendation-text {
    color: #e4e4e4;
}

/* Links section */
.diagnosis-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.5rem;
}

.diagnosis-link {
    display: inline-flex;
    align-items: center;
    padding: 0.8rem 1.5rem;
    background: #0078d4;
    color: white !important;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    gap: 0.8rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.diagnosis-link:hover {
    background: #005a9e;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.wiki-link {
    background: #ffffff;
    color: #0078d4 !important;
    border: 1px solid rgba(0, 120, 212, 0.2);
}

.wiki-link:hover {
    background: #f8f9fa;
    border-color: #0078d4;
}

[data-theme="dark"] .wiki-link {
    background: rgba(255, 255, 255, 0.1);
    color: #79c3ff !important;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .wiki-link:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: #79c3ff;
}

/* Mobile optimizations for diagnosis cards */
@media (max-width: 768px) {
    .diagnosis {
        padding: 1.2rem;
        margin-bottom: 1rem;
    }

    .diagnosis-header {
        gap: 0.8rem;
        margin-bottom: 1rem;
    }

    .diagnosis-name {
        font-size: 1.2rem;
    }

    .diagnosis-specialty {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }

    .diagnosis-recommendation {
        padding: 1rem;
        margin: 1rem 0;
        gap: 0.8rem;
    }

    .recommendation-icon {
        font-size: 1.3rem;
    }

    .recommendation-text {
        font-size: 0.9rem;
    }

    .diagnosis-links {
        flex-direction: column;
    }

    .diagnosis-link {
        width: 100%;
        justify-content: center;
        padding: 0.7rem 1rem;
    }
}

/* Hover effects only on non-touch devices */
@media (hover: hover) {
    .diagnosis:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    }

    .diagnosis-link:hover {
        background: var(--button-hover-bg);
        transform: translateX(5px);
    }
}

/* Diagnosis Header */
.diagnosis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid rgba(0, 122, 204, 0.1);
}

.diagnosis-name {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--primary-color);
}

.diagnosis-specialty {
    font-size: 0.9rem;
    padding: 0.4rem 0.8rem;
    background: rgba(0, 122, 204, 0.1);
    border-radius: 20px;
    color: var(--primary-color);
}

/* Diagnosis Content */
.diagnosis-content {
    display: grid;
    gap: 1.2rem;
}

.diagnosis-explanation {
    line-height: 1.6;
    color: var(--text-color);
    background: rgba(0, 122, 204, 0.05);
    padding: 1rem;
    border-radius: 12px;
}

.diagnosis-description {
    font-size: 1.1rem;
    margin: 1rem 0;
    padding: 1rem;
    background: var(--background-color);
    color: var(--text-color);
    border-radius: 12px;
    border: 1px solid rgba(0, 122, 204, 0.1);
}

.diagnosis-percentage {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    background: rgba(0, 122, 204, 0.1);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    min-width: 70px;
    text-align: center;
}

[data-theme="dark"] .diagnosis-percentage {
    background: rgba(255, 255, 255, 0.1);
    color: #79c3ff;
}

/* More Info Link */
.diagnosis-link {
    display: inline-flex;
    align-items: center;
    padding: 0.6rem 1.2rem;
    background: var(--primary-color);
    color: white !important;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    margin: 1rem 0;
}

.diagnosis-link:hover {
    background: var(--button-hover-bg);
    transform: translateX(5px);
    text-decoration: none !important;
}

.diagnosis-link::after {
    margin-left: 0.5rem;
    transition: transform 0.3s ease;
}

.diagnosis-link:hover::after {
    transform: translateX(3px);
}

.diagnosis-link {
    display: inline-flex;
    align-items: center;
    margin-top: 10px;
    color: #007bff;
    text-decoration: none;
    transition: all 0.2s ease;
}

.diagnosis-link:hover {
    color: #0056b3;
}

.diagnosis-link .arrow {
    margin-left: 5px;
    transition: transform 0.2s ease;
}

.diagnosis-link:hover .arrow {
    transform: translateX(5px);
}

/* Recommendation Section */
.diagnosis-recommendation {
    margin-top: 1.5rem;
    padding: 1.2rem;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

.diagnosis-intro {
    background: #0a1f3a;
    border-radius: 8px;
    padding: 20px;
    margin: 15px 0;
}

.diagnosis-intro h3 {
    color: #006ac0;
    margin: 0 0 10px 0;
}

.diagnosis-intro p {
    margin: 8px 0;
    line-height: 1.4;
    color: white;
}

.restart-hint {
    color: #353535;
    font-style: italic;
    margin-top: 15px !important;
}

/* Recommendation variants */
.recommendation-severe {
    background: linear-gradient(135deg, #fff5f5, #ffe5e5);
    border: 1px solid #ffcdd2;
}

.recommendation-moderate {
    background: linear-gradient(135deg, #fff8e1, #fff3e0);
    border: 1px solid #ffe0b2;
}

.recommendation-mild {
    background: linear-gradient(135deg, #f1f8e9, #e8f5e9);
    border: 1px solid #c8e6c9;
}

[data-theme="dark"] .recommendation-severe {
    background: linear-gradient(135deg, rgba(198, 40, 40, 0.15), rgba(198, 40, 40, 0.1));
    border: 1px solid rgba(255, 82, 82, 0.2);
}

[data-theme="dark"] .recommendation-moderate {
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.15), rgba(255, 152, 0, 0.1));
    border: 1px solid rgba(255, 167, 38, 0.2);
}

[data-theme="dark"] .recommendation-mild {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.15), rgba(76, 175, 80, 0.1));
    border: 1px solid rgba(129, 199, 132, 0.2);
}

.recommendation-icon {
    font-size: 1.2rem;
    margin-right: 0.5rem;
}

.recommendation-text {
    font-weight: 500;
    color: var(--text-color);
}

/* Status Indicators */
.diagnosis-status {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
}

.status-badge {
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.status-common {
    background: rgba(76, 175, 80, 0.1);
    color: #4CAF50;
}

.status-red-flag {
    background: rgba(244, 67, 54, 0.1);
    color: #F44336;
}

.status-badge {
    display: inline-block;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    margin-right: 8px;
    background-color: #03338b;
}

.status-badge.status-red-flag {
    background-color: #ff4444;
    color: white;
}

.status-badge.status-common {
    background-color: #4CAF50;
    color: white;
}

.triage-result {
    padding: 1rem;
    background: var(--input-bg);
    border-radius: 12px;
    margin: 1rem 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.triage-slider {
    width: 100%;
    height: 8px;
    background: linear-gradient(to right, green 0%, green 26%, orange 26%, orange 56%, red 56%, red 100%);
    border-radius: 5px;
    outline: none;
}

.triage-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: white;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    cursor: default;
}

.triage-slider:disabled {
    opacity: 1;
}

[data-theme="dark"] .triage-result {
    background: var(--secondary-color);
}


/* Dot Spinner Animation */
.dot-spinner {
  --uib-size: 2.8rem;
  --uib-speed: .9s;
  --uib-color: #183153;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  height: var(--uib-size);
  width: var(--uib-size);
  margin: 20px auto;
}

[data-theme="dark"] .dot-spinner {
  --uib-color: #4a8eff;
}

.dot-spinner__dot {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  height: 100%;
  width: 100%;
}

.dot-spinner__dot::before {
  content: '';
  height: 20%;
  width: 20%;
  border-radius: 50%;
  background-color: var(--uib-color);
  transform: scale(0);
  opacity: 0.5;
  animation: pulse0112 calc(var(--uib-speed) * 1.111) ease-in-out infinite;
  box-shadow: 0 0 20px rgba(18, 31, 53, 0.3);
}

.dot-spinner__dot:nth-child(2) {
  transform: rotate(45deg);
}

.dot-spinner__dot:nth-child(2)::before {
  animation-delay: calc(var(--uib-speed) * -0.875);
}

.dot-spinner__dot:nth-child(3) {
  transform: rotate(90deg);
}

.dot-spinner__dot:nth-child(3)::before {
  animation-delay: calc(var(--uib-speed) * -0.75);
}

.dot-spinner__dot:nth-child(4) {
  transform: rotate(135deg);
}

.dot-spinner__dot:nth-child(4)::before {
  animation-delay: calc(var(--uib-speed) * -0.625);
}

.dot-spinner__dot:nth-child(5) {
  transform: rotate(180deg);
}

.dot-spinner__dot:nth-child(5)::before {
  animation-delay: calc(var(--uib-speed) * -0.5);
}

.dot-spinner__dot:nth-child(6) {
  transform: rotate(225deg);
}

.dot-spinner__dot:nth-child(6)::before {
  animation-delay: calc(var(--uib-speed) * -0.375);
}

.dot-spinner__dot:nth-child(7) {
  transform: rotate(270deg);
}

.dot-spinner__dot:nth-child(7)::before {
  animation-delay: calc(var(--uib-speed) * -0.25);
}

.dot-spinner__dot:nth-child(8) {
  transform: rotate(315deg);
}

.dot-spinner__dot:nth-child(8)::before {
  animation-delay: calc(var(--uib-speed) * -0.125);
}

.loading-message {
  text-align: center;
  margin: 10px 0;
  color: var(--text-color);
  font-weight: 500;
}

@keyframes pulse0112 {
  0%,
  100% {
    transform: scale(0);
    opacity: 0.5;
  }

  50% {
    transform: scale(1);
    opacity: 1;
  }
}

/* ...existing code continues... */
/* Chatbot section styles */
#chatbot {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem 2rem; /* Reduced top padding */
    background: transparent;
    height: 82vh; /* Reduced height */
    max-width: 1200px;
    margin: -0.5rem auto 0; /* Reduced negative margin */
}

#chatWindow {
    width: 100%;
    max-width: 800px;
    height: 70vh; /* Reduced height */
    border-radius: 10px;
    overflow-y: auto;
    padding: 1.5rem; /* Increased padding */
    margin-bottom: 0.5rem; /* Reduced margin */
    background: var(--input-bg);
    scroll-behavior: smooth;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.568); /* Added shadow for depth */
    margin-top: 0.5rem; /* Reduced top margin */
}

#chatOutput {
    display: flex;
    flex-direction: column;
    gap: 0.8rem; /* Increased from 0.5rem */
    padding: 1rem;
}

/* Chat Message Styles */
.message {
    opacity: 0;
    transform: translateY(20px);
    animation: messageAppear 0.3s ease forwards;
    margin-bottom: 1.2rem;
    padding: 1rem 1.5rem;
    border-radius: 18px;
    max-width: 85%;
    font-size: 1rem;
    line-height: 1.5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.418);
    transition: all 0.3s ease;
}

@keyframes messageAppear {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-message {
    background: linear-gradient(135deg, var(--primary-color), #0052a3);
    color: #fff;
    align-self: flex-end;
    margin-left: 20%;
    border-bottom-right-radius: 5px;
}

.bot-message {
    background: linear-gradient(135deg, #5dbedb, #3a89a1);
    color: var(--text-color);
    align-self: flex-start;
    margin-right: 20%;
    border-bottom-left-radius: 5px;
}

[data-theme="dark"] .bot-message {
    background: linear-gradient(135deg, #00607e, #003342);
    color: #e4e4e4;
}

.message:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Typing indicator animation */
.typing-indicator {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--input-bg);
    border-radius: 15px;
    width: fit-content;
    margin: 0.5rem 0;
    opacity: 0;
    transform: translateY(10px);
    animation: fadeIn 0.3s ease forwards;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: bounce 1.5s infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-4px); }
}

@keyframes fadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#chatInputContainer {
    display: flex;
    width: 100%;
    max-width: 800px; /* Increased from 600px */
    align-items: center;
    gap: 0.5rem; /* Added gap between elements */
    padding: 0 1rem;  /* Add padding on sides */
    position: relative;
}

#chatInput,
#dateInput {
    flex: 1;
    padding: 0.8rem;  /* Decreased from 1rem */
    border: 2px solid var(--input-border);
    border-radius: 25px;  /* More rounded edges */
    font-size: 1rem;  /* Decreased from 1.1rem */
    background: var(--input-bg);
    transition: all 0.3s ease;
    color: var(--input-text);
    height: 45px;  /* Fixed height for consistency */
}

#chatInput:focus,
#dateInput:focus {
    border-color: var(--input-focus-border);
    box-shadow: 0 0 5px rgba(0, 122, 204, 0.5);
    outline: none;
}

#chatInput::placeholder,
#dateInput::placeholder {
    color: var(--input-placeholder);
}

#dateInput::-webkit-calendar-picker-indicator {
    filter: var(--calendar-icon-filter);
}

#sendButton {
    padding: 1.3em 3em;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    font-weight: 500;
    color: #ffffff;
    background-color: #0067bb;
    border: none;
    border-radius: 45px;
    box-shadow: 0px 8px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease 0s;
    cursor: pointer;
    outline: none;
    background-color: #414141b7; /* Default disabled color */
    cursor: not-allowed;
}

#sendButton.active {
    background-color: #0067bb; /* Active color */
    cursor: pointer;
}

#sendButton.active:hover {
    background-color: #002d52;
    box-shadow: 0px 15px 20px rgba(0, 40, 73, 0.4);
    color: #fff;
}

#restartButton {
    padding: 0.5rem; /* Smaller padding */
    background: rgb(2, 64, 88); /* Different background color */
    color: #fff; /* White text color */
    border: none;
    border-radius: 25px;  /* Make it round */
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px; /* Fixed width */
    height: 45px;  /* Match other elements */
    margin-left: 0.5rem; /* Add spacing between buttons */
}

#restartButton span {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

#restartButton:hover {
    background: rgb(0, 57, 95); /* Different background color */
    transform: rotate(180deg); /* Rotate the button on hover */
}

/* Restart Button styles */
#chatControls {
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.restartButton {
    padding: 0.75rem 1.5rem;
    background: var(--button-bg);
    color: var(--button-text);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.restartButton span {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.restartButton:hover {
    background: var(--button-hover-bg);
    transform: translateY(-2px);
}

.restartButton:hover span {
    transform: rotate(180deg);
}

/* Add this media query for mobile devices */
@media (max-width: 768px) {
    .disclaimer {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background-color: rgba(0, 0, 0, 0.7); /* Optional: Add a background color for better visibility */
        color: white; /* Optional: Change text color for contrast */
        text-align: center;
        padding: 10px 0;
        z-index: 1000; /* Ensure it appears above other elements */
    }

    #chatInputContainer {
        margin-bottom: 50px; /* Add margin to prevent overlap with the disclaimer */
    }
}

/* Mobile optimization for Option Button */
@media (max-width: 768px) {
    .optionButton {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
        margin: 0.3rem;
        position: relative;
        z-index: 101; /* Ensure it stays above the input container */
        top: -70px; /* Move the button higher */
    }
}

.end-chat-message {
    background: var(--message-background);
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    border: 1px solid var(--border-color);
}

.end-chat-message p {
    margin: 10px 0;
    color: var(--text-color);
}

.end-chat-message .disclaimer {
    font-style: italic;
    font-size: 0.9em;
    color: var(--text-secondary);
    margin-top: 15px;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .end-chat-message {
        margin: 10px;
        padding: 15px;
        border-radius: 10px;
    }

    .end-chat-message p {
        font-size: 14px;
        margin: 10px 0;
    }

    .end-chat-message .disclaimer {
        font-size: 12px;
        padding: 8px;
        margin-top: 12px;
    }
    
    /* Ensure message doesn't conflict with input container */
    .end-chat-message:last-child {
        margin-bottom: 160px; /* Add space for fixed input container */
    }
}

/* Even smaller screens */
@media (max-width: 380px) {
    .end-chat-message {
        margin: 8px;
        padding: 12px;
    }

    .end-chat-message p {
        font-size: 13px;
    }

    .end-chat-message .disclaimer {
        font-size: 11px;
        padding: 6px;
    }
}

/* Dark Mode Toggle */
#themeToggle {
    position: absolute;
    top: 1rem;
    right: 2rem;
    cursor: pointer;
}

/* Dark Mode Switch */
.ui-switch {
    --switch-bg: rgb(135, 150, 165);
    --switch-width: 48px;
    --switch-height: 24px;
    --circle-diameter: 28px; /* Increased size */
    --circle-bg: rgb(0, 56, 146);
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
}

.ui-switch input {
    display: none;
}

.slider {
    width: var(--switch-width);
    height: var(--switch-height);
    background: var(--switch-bg);
    border-radius: 999px;
    position: relative;
    cursor: pointer;
}

.slider .circle {
    top: calc((var(--switch-height) - var(--circle-diameter)) / 2);
    left: 0;
    width: var(--circle-diameter);
    height: var(--circle-diameter);
    position: absolute;
    background: var(--circle-bg);
    border-radius: 50%;
    background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjAiIHdpZHRoPSIyMCIgdmlld0JveD0iMCAwIDIwIDIwIj4KICAgIDxwYXRoIGZpbGw9IiNmZmYiCiAgICAgICAgZD0iTTkuMzA1IDEuNjY3VjMuNzVoMS4zODlWMS42NjdoLTEuMzl6bS00LjcwNyAxLjk1bC0uOTgyLjk4Mkw1LjA5IDYuMDcybC45ODItLjk4Mi0xLjQ3My0xLjQ3M3ptMTAuODAyIDBMMTMuOTI3IDUuMDlsLjk4Mi45ODIgMS40NzMtMS40NzMtLjk4Mi0uOTgyek0xMCA1LjEzOWE0Ljg3MiA0Ljg3MiAwIDAwLTQuODYyIDQuODZBNC44NzIgNC44NzIgMCAwMDEwIDE0Ljg2MiA0Ljg3MiA0Ljg3MiAwIDAwMTQuODYgMTAgNC44NzIgNC44NzIgMCAwMDEwIDUuMTM5em0wIDEuMzg5QTMuNDYyIDMuNDYyIDAgMDExMy40NzEgMTBhMy40NjIgMy40NjIgMCAwMS0zLjQ3MyAzLjQ3MkEzLjQ2MiAzLjQ2MiAwIDAxNi41MjcgMTAgMy40NjIgMy40NjIgMCAwMTEwIDYuNTI4ek0xLjY2NSA5LjMwNXYxLjM5aDIuMDgzdi0xLjM5SDEuNjY2em0xNC41ODMgMHYxLjM5aDIuMDg0di0xLjM5aC0yLjA4NHpNNS4wOSAxMy45MjhMMy42MTYgMTUuNGwuOTgyLjk4MiAxLjQ3My0xLjQ3My0uOTgyLS45ODJ6bTkuODIgMGwtLjk4Mi45ODIgMS40NzMgMS40NzMuOTgyLS45ODItMS40NzMtMS40NzN6TTkuMzA1IDE2LjI1djIuMDgzaDEuMzg5VjE2LjI1aC0xLjM5eiIgLz4KPC9zdmc+");
    background-repeat: no-repeat;
    background-position: center center;
    transition: left 150ms cubic-bezier(0.4, 0, 0.2, 1), transform 150ms cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0px 2px 1px -1px rgba(0,0,0,0.2), 0px 1px 1px 0px rgba(0,0,0,0.14), 0px 1px 3px 0px rgba(0,0,0,0.12);
}

.slider .circle::before {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.75);
    border-radius: inherit;
    transition: all 500ms;
    opacity: 0;
}

.ui-switch input:checked + .slider .circle {
    left: calc(100% - var(--circle-diameter));
    background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjAiIHdpZHRoPSIyMCIgdmlld0JveD0iMCAwIDIwIDIwIj4KICAgIDxwYXRoIGZpbGw9IiNmZmYiCiAgICAgICAgZD0iTTQuMiAyLjVsLS43IDEuOC0xLjguNyAxLjguNy43IDEuOC42LTEuOEw2LjcgNWwtMS45LS43LS42LTEuOHptMTUgOC4zYTYuNyA2LjcgMCAxMS02LjYtNi42IDUuOCA1LjggMCAwMDYuNiA2LjZ6IiAvPgo8L3N2Zz4=");
}

.ui-switch input:active + .slider .circle::before {
    transition: 0s;
    opacity: 1;
    width: 0;
    height: 0;
}

/* Option Button styles */
.optionButton {
    padding: 0.75rem 1.5rem;
    background: var(--button-bg);
    color: var(--button-text);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    margin: 0.5rem;
    transition: background 0.3s, transform 0.3s;
}

.optionButton:hover {
    background: var(--button-hover-bg);
    transform: translateY(-2px);
}

/* Mobile optimization for Option Button */
@media (max-width: 768px) {
    .optionButton {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
        margin: 0.3rem;
        position: relative;
        z-index: 101; /* Ensure it stays above the input container */
    }
}

/* Theme Toggle styles */
.theme-toggle {
    display: flex;
    gap: 0.4rem; /* Reduced from 0.8rem */
    align-items: center;
    position: fixed; /* Changed from absolute to fixed */
    bottom: 3rem; /* Decreased from 4rem */
    right: 1rem; /* Decreased from 2rem to move closer to edge */
    background: rgba(54, 54, 54, 0.822);
    padding: 0.3rem; /* Reduced from 0.5rem */
    border-radius: 25px; /* Slightly increased roundness */
    backdrop-filter: blur(10px);
    transform: scale(0.85); /* Make entire toggle smaller */
    z-index: 1000; /* Ensure it stays on top */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2); /* Added shadow for better visibility */
}

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

.theme-toggle label {
    cursor: pointer;
    padding: 0.4rem; /* Reduced from 0.6rem */
    border-radius: 50%;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px; /* Reduced from 35px */
    height: 28px; /* Reduced from 35px */
    position: relative;
    overflow: hidden;
}

.theme-toggle label:hover {
    color: white;
    transform: translateY(-2px);
}

.theme-toggle input[type="radio"]:checked + label {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    transform: scale(1.1);
}

.theme-toggle label i {
    font-size: 0.9rem; /* Reduced from 1.1rem */
    transition: all 0.3s ease;
}

.theme-toggle label::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.theme-toggle label:hover::after {
    opacity: 1;
}

/* Adaptive styles for dark mode */
[data-theme="dark"] .theme-toggle {
    background: rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .theme-toggle label {
    color: rgba(255, 255, 255, 0.6);
}

[data-theme="dark"] .theme-toggle input[type="radio"]:checked + label {
    background: rgba(255, 255, 255, 0.1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .theme-toggle {
        transform: scale(0.75); /* Even smaller on mobile */
        bottom: 2rem; /* Decreased from 3rem for mobile */
        right: 0.5rem; /* Decreased from 1rem for mobile */
        padding: 0.25rem;
        gap: 0.3rem;
    }

    .theme-toggle label {
        padding: 0.3rem;
        width: 24px;
        height: 24px;
    }

    .theme-toggle label i {
        font-size: 0.8rem;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    header .nav-links {
        flex-direction: column;
        align-items: center;
    }

    #hero h1 {
        font-size: 2rem;
    }

    #hero input[type="text"],
    #hero input[type="number"],
    #hero input[type="date"],
    #hero select {
        width: 90%;
    }

    #chatbot {
        padding: 1rem;
        height: 78vh; /* Adjusted for mobile */
    }

    #chatWindow {
        height: 65vh; /* Adjusted for mobile */
        max-width: 100%;
    }

    .message {
        max-width: 90%;
        font-size: 1rem;
    }

    #chatInputContainer {
        flex-direction: column;
        padding: 0 0.5rem;
    }

    #chatInput,
    #dateInput {
        border-radius: 10px;
        margin-bottom: 0.5rem;
        padding: 0.7rem;
        font-size: 0.95rem;
    }

    #sendButton {
        border-radius: 10px;
        padding: 0.7rem 1rem;
    }
}

/* Add a spacer between chat and footer */
main {
    min-height: calc(96vh - 50px); /* Reduced minimum height */
    position: relative;
    padding-bottom: 1rem; /* Reduced padding */
}

/* Logout Button */
.Btn {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition-duration: .3s;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.548);
    background-color: rgb(0, 52, 112);
}

/* plus sign */
.sign {
    width: 100%;
    transition-duration: .3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sign svg {
    width: 17px;
}

.sign svg path {
    fill: white;
}

/* text */
.text {
    position: absolute;
    right: 0%;
    width: 0%;
    opacity: 0;
    color: white;
    font-size: 1.2em;
    font-weight: 600;
    transition-duration: .3s;
}

/* hover effect on button width */
.Btn:hover {
    width: 125px;
    border-radius: 40px;
    transition-duration: .3s;
}

.Btn:hover .sign {
    width: 30%;
    transition-duration: .3s;
    padding-left: 20px;
}

/* hover effect button's text */
.Btn:hover .text {
    opacity: 1;
    width: 70%;
    transition-duration: .3s;
    padding-right: 10px;
}

/* button click effect */
.Btn:active {
    transform: translate(2px ,2px);
}

/* Popup styles */
.popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.3s ease;
}

.popup.show {
    display: flex;
    opacity: 1;
}

.popup-content {
    background: var(--secondary-color);
    padding: 2.5rem;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    transform: scale(0.95);
    transition: transform 0.3s ease;
    max-width: 400px;
    width: 90%;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.popup.show .popup-content {
    transform: scale(1);
}

.popup-content p {
    margin-bottom: 2rem;
    font-size: 1.3rem;
    color: var(--text-color);
    line-height: 1.5;
    font-weight: 300;
}

.popup-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.popup-content button {
    padding: 1.3em 3em;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    font-weight: 500;
    color: #000;
    background-color: #fff;
    border: none;
    border-radius: 45px;
    box-shadow: 0px 8px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease 0s;
    cursor: pointer;
    outline: none;
    flex: 1;
    max-width: 150px;
}

.popup-content button#confirm-logout {
    background-color: #bebebe;
    color: #000;
}

.popup-content button#confirm-logout:hover {
    background-color: #002a69;
    box-shadow: 0px 15px 20px rgba(1, 17, 90, 0.4);
    color: #fff;
    transform: translateY(-7px);
}

.popup-content button#cancel-logout {
    background-color: #bebebe;
    color: #000;
}

.popup-content button#cancel-logout:hover {
    background-color: #920000;
    box-shadow: 0px 15px 20px rgba(117, 24, 24, 0.4);
    color: #fff;
    transform: translateY(-7px);
}

.popup-content button:active {
    transform: translateY(-1px);
}

@media (max-width: 480px) {
    .popup-content {
        padding: 2rem 1.5rem;
        width: 85%;
    }

    .popup-buttons {
        flex-direction: column;
    }

    .popup-content button {
        max-width: 100%;
    }
}

/* Mobile optimizations for chat interface */
@media (max-width: 768px) {
    #chatbot {
        padding: 0.5rem;
        height: calc(100vh - 120px); /* Account for header and footer */
        margin: 0;
    }

    #chatWindow {
        height: calc(100vh - 180px);
        border-radius: 8px;
        margin-bottom: 0.5rem;
    }

    #chatInputContainer {
        flex-direction: row;
        gap: 0.5rem;
        padding: 0.5rem;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--background-color);
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
        z-index: 100;
    }

    #chatInput,
    #dateInput {
        height: 40px;
        font-size: 16px; /* Prevent iOS zoom */
        padding: 0.5rem 1rem;
        border-radius: 20px;
        margin: 0;
    }

    #sendButton {
        width: 40px;
        height: 40px;
        padding: 0;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0;
    }

    #sendButton::before {
        content: '↑';
        font-size: 20px;
    }

    #restartButton {
        width: 40px;
        height: 40px;
        padding: 0;
        font-size: 20px;
    }

    #restartButton span {
        margin: 0;
    }

    .message {
        max-width: 85%;
        padding: 0.8rem 1rem;
        font-size: 0.95rem;
        margin-bottom: 0.8rem;
    }

    /* Adjust footer for fixed input container */
    footer {
        margin-bottom: 60px;
    }

    /* Ensure messages don't get hidden behind input container */
    #chatOutput {
        padding-bottom: 70px;
    }

    /* Adjust theme toggle position for mobile */
    .theme-toggle {
        transform: scale(0.75);
        bottom: 65px; /* Move up to avoid input container */
        right: 10px;
        padding: 0.25rem;
        gap: 0.3rem;
        z-index: 99; /* Below the input container */
    }

    /* Adjust disclaimer for mobile */
    .disclaimer {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        text-align: center;
        padding: 2px;
        font-size: 10px;
        background: var(--background-color);
        color: #666;
        transform: translateY(-100%);
        border-top: 1px solid rgba(0, 0, 0, 0.1);
        z-index: 99; /* Below the input container */
    }

    [data-theme="dark"] .disclaimer {
        background: var(--background-color);
        color: #999;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    /* Ensure chat container doesn't get hidden */
    #chatWindow {
        margin-bottom: 100px; /* Add space for fixed elements */
    }

    #chatOutput {
        padding-bottom: 100px;
    }

    /* Make input container highest z-index */
    #chatInputContainer {
        z-index: 100;
    }
}

/* iPhone SE and smaller devices */
@media (max-width: 380px) {
    #chatInputContainer {
        padding: 0.4rem;
        gap: 0.3rem;
    }

    #chatInput,
    #dateInput {
        font-size: 14px;
        padding: 0.4rem 0.8rem;
    }

    #sendButton,
    #restartButton {
        width: 36px;
        height: 36px;
    }

    .theme-toggle {
        bottom: 80px; /* Slightly adjust for smaller screens */
        right: 5px;
        transform: scale(0.7);
    }

    .disclaimer {
        font-size: 9px;
        padding: 1px;
    }
}

/* Disclaimer message */
.disclaimer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    text-align: center;
    padding: 5px;
    color: #666;
    font-size: 12px;
    z-index: 1000;
}

[data-theme="dark"] .disclaimer {
    background: rgba(0, 0, 0, 0);
    color: #999;
}

@media (max-width: 768px) {
    .disclaimer {
        padding: 3px;
        font-size: 10px;
    }
}

.export-pdf-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 15px; /* Reduced from 30px */
    margin-bottom: 15px; /* Added margin-bottom for spacing */
    padding: 12px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Update mobile styles to ensure proper spacing */
@media (max-width: 768px) {
    .export-pdf-button {
        margin-top: 10px; /* Even smaller margin on mobile */
        margin-bottom: 20px; /* Increased bottom margin on mobile */
    }
}

.export-pdf-button:hover {
    background: var(--button-hover-bg);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.export-pdf-button:active {
    transform: translateY(0);
}

.button-icon {
    font-size: 18px;
}

[data-theme="dark"] .export-pdf-button {
    background: var(--primary-color);
    color: white;
}

/* Add these new loading animation styles */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loading-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.loading-container {
    background: var(--secondary-color);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    text-align: center;
    animation: slideIn 0.5s ease-out;
}

.loading-spinner {
    display: inline-block;
    width: 60px;
    height: 60px;
    margin-bottom: 1rem;
}

.loading-spinner:after {
    content: " ";
    display: block;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 6px solid var(--primary-color);
    border-color: var(--primary-color) transparent var(--primary-color) transparent;
    animation: loading-spinner 1.2s linear infinite;
}

@keyframes loading-spinner {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: 1.2rem;
    color: var(--text-color);
    margin: 0;
}

.loading-subtext {
    font-size: 0.9rem;
    color: var(--text-color);
    opacity: 0.8;
    margin-top: 0.5rem;
}

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

/* Dark mode adjustments */
[data-theme="dark"] .loading-container {
    background: var(--secondary-color);
}

[data-theme="dark"] .loading-text,
[data-theme="dark"] .loading-subtext {
    color: var(--text-color);
}

/* Optimized mobile diagnosis styles */
@media (max-width: 768px) {
    .diagnosis {
        padding: 1rem;
        margin: 0.8rem 0;
        border-radius: 12px;
    }

    .diagnosis-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        margin-bottom: 0.8rem;
        padding-bottom: 0.8rem;
    }

    .diagnosis-name {
        font-size: 1.1rem;
        min-width: unset;
        width: 100%;
    }

    .diagnosis-specialty {
        font-size: 0.8rem;
        padding: 0.3rem 0.8rem;
        align-self: flex-start;
    }

    .status-badge {
        padding: 0.3rem 0.8rem;
        font-size: 0.75rem;
        margin-right: 0.5rem;
        margin-bottom: 0.3rem;
    }

    .diagnosis-recommendation {
        padding: 0.8rem;
        margin: 0.8rem 0;
        gap: 0.5rem;
    }

    .recommendation-icon {
        font-size: 1.1rem;
    }

    .recommendation-text {
        font-size: 0.9rem;
        line-height: 1.4;
    }

    .diagnosis-links {
        flex-direction: column;
        gap: 0.5rem;
        margin-top: 1rem;
    }

    .diagnosis-link {
        width: 100%;
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
        justify-content: center;
    }

    .diagnosis-description {
        font-size: 0.95rem;
        padding: 0.8rem;
        margin: 0.8rem 0;
    }

    .diagnosis-explanation {
        padding: 0.8rem;
        font-size: 0.9rem;
    }

    /* Improve touch targets */
    .diagnosis-link,
    .status-badge,
    .recommendation-icon {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
}

/* Even smaller screens optimization */
@media (max-width: 380px) {
    .diagnosis {
        padding: 0.8rem;
        margin: 0.6rem 0;
    }

    .diagnosis-name {
        font-size: 1rem;
    }

    .diagnosis-specialty {
        font-size: 0.75rem;
        padding: 0.25rem 0.6rem;
    }

    .status-badge {
        padding: 0.25rem 0.6rem;
        font-size: 0.7rem;
    }

    .diagnosis-recommendation {
        padding: 0.6rem;
    }

    .recommendation-text {
        font-size: 0.85rem;
    }

    .diagnosis-link {
        padding: 0.5rem 0.8rem;
        font-size: 0.85rem;
    }

    /* Ensure text remains readable */
    .diagnosis-description,
    .diagnosis-explanation {
        font-size: 0.85rem;
        padding: 0.6rem;
    }
}

/* Add better tap feedback for mobile */
@media (hover: none) {
    .diagnosis-link:active {
        transform: scale(0.98);
        opacity: 0.9;
    }

    .status-badge:active {
        opacity: 0.8;
    }

    .diagnosis {
        transition: transform 0.2s ease;
    }

    .diagnosis:active {
        transform: scale(0.99);
    }
}

/* Add these styles to your existing CSS */

.suggestion-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 0 0 10px 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
}

.suggestion-item {
    padding: 10px 15px;
    cursor: pointer;
    color: var(--text-color);
    transition: background-color 0.2s;
}

.suggestion-item:hover,
.suggestion-item.selected {
    background-color: var(--primary-color);
    color: white;
}

.suggestion-item:not(:last-child) {
    border-bottom: 1px solid var(--input-border);
}

/* Enhanced Triage Results Styles */
.triage-result {
    padding: 1.5rem;
    background: var(--input-bg);
    border-radius: 12px;
    margin: 1rem 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.triage-score-container {
    margin: 1rem 0;
}

.triage-score-label {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.triage-score-value {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.triage-slider-container {
    position: relative;
    padding-bottom: 1.5rem;
}

.triage-slider {
    width: 100%;
    height: 10px;
    background: linear-gradient(to right, 
        #4caf50 0%, #4caf50 25%, 
        #ffeb3b 25%, #ffeb3b 47%, 
        #ff9800 47%, #ff9800 70%, 
        #d32f2f 70%, #d32f2f 100%);
    border-radius: 5px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    margin: 1rem 0 0.5rem;
}

.triage-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: white;
    border: 2px solid #333;
    border-radius: 50%;
    cursor: default;
}

.triage-slider:disabled {
    opacity: 1;
}

.triage-labels {
    display: flex;
    justify-content: space-between;
    width: 100%;
    font-size: 0.8rem;
    color: var(--text-color);
    opacity: 0.8;
    padding-top: 0.2rem;
}

.triage-recommendation {
    margin: 1.5rem 0;
    padding: 1rem 0.5rem 1rem 1rem;
    background-color: rgba(0, 0, 0, 0.03);
    border-radius: 8px;
}

.triage-recommendation h4 {
    margin-top: 0;
    font-size: 1.1rem;
}

.triage-recommendation p {
    margin: 0.5rem 0;
}

.triage-guidelines {
    background-color: rgba(0, 0, 0, 0.02);
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1.5rem;
}

.triage-guidelines h4 {
    margin-top: 0;
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
}

.triage-guidelines ul {
    padding-left: 1.5rem;
    margin: 0.8rem 0;
}

.triage-guidelines li {
    margin-bottom: 0.5rem;
}

.triage-disclaimer {
    font-style: italic;
    font-size: 0.9rem;
    margin-top: 1rem !important;
    opacity: 0.8;
}

/* Dark mode adjustments */
[data-theme="dark"] .triage-recommendation {
    background-color: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .triage-guidelines {
    background-color: rgba(255, 255, 255, 0.03);
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .triage-result {
        padding: 1rem;
    }
    
    .triage-score-label, .triage-score-value {
        font-size: 1rem;
    }
    
    .triage-labels {
        font-size: 0.7rem;
    }
    
    .triage-guidelines ul {
        padding-left: 1.2rem;
    }
    
    .triage-disclaimer {
        font-size: 0.8rem;
    }
}

/* Add this to your CSS file */
.triage-question {
    background-color: var(--card-background);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.triage-question h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: rgb(6, 26, 49);
    font-weight: 600;
}

.triage-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
}

.triage-option {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background-color: var(--background-lighter);
    border-radius: 6px;
    transition: background-color 0.2s;
}

.triage-option:hover {
    background-color: var(--background-highlight);
}

.option-number {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 24px;
    height: 24px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    margin-right: 10px;
    font-weight: bold;
}

.triage-instruction {
    font-style: italic;
    margin-top: 10px;
    color: var(--text-muted);
    font-size: 0.9em;
}

/* API Warning Popup specific styles */
#api-warning-popup .popup-content {
    border: 2px solid #d32f2f;
    max-width: 450px;
}

#api-warning-popup .popup-content h3 {
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

#api-warning-popup button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 200px;
    height: 45px;
    margin: 20px auto 0;
    color: white;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.5px;
    background-color: #d32f2f;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#api-warning-popup button:hover {
    background-color: #b71c1c;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(183, 28, 28, 0.3);
}

#api-warning-popup button:active {
    transform: translateY(0);
}
