body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: #e8f4f8; /* ඉතා මෘදු නිල් පැහැයක් - ඇසට ප්‍රිය */
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    background-color: #ffffff; /* සුදු පැහැති header */
    color: #333; /* Header text color */
    padding: 1rem 20px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); /* මෘදු shadow වැඩි කර ඇත */
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #eee;
}

.header-content {
    display: flex;
    justify-content: center; /* header content එක මධ්‍යගත කරයි */
    align-items: center;
    max-width: 1000px;
    width: 100%;
    margin: 0 auto;
    gap: 20px; /* Space between logo and text */
    padding: 0 20px; /* Header content padding */
}

#emansala-logo {
    height: 80px; /* Logo size */
    width: auto;
    object-fit: contain;
    margin-right: auto; /* Logo එක වම් පසට තල්ලු කරයි */
}

.header-text {
    text-align: center; /* මෙමගින් header text එක මධ්‍යගත වේ */
    flex-grow: 1; /* ඉතිරි ඉඩ ප්‍රයෝජනයට ගනී */
}

.header-text h1 {
    margin: 0;
    font-size: 2.2em;
    color: #0056b3; /* Primary blue for main heading */
}

.header-text h2 {
    margin: 5px 0 0;
    font-size: 1.5em; /* Mental Well-being & Support සඳහා විශාල අකුරු ප්‍රමාණයක් */
    font-weight: 600; /* Boldness වැඩි කර ඇත */
    color: #555;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1); /* මෘදු shadow එකක් */
}

/* Main Navigation Bar */
.main-nav {
    background-color: #e0f2f7; /* Light blue for softer menu bar */
    padding: 10px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border-bottom: 1px solid #cceeff;
}

.main-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap; /* Allows items to wrap on smaller screens */
}

.main-nav ul li {
    margin: 0 15px;
    border-right: 1px solid #aaddf7; /* Separator for menu items */
    padding-right: 15px; /* Space before separator */
}

.main-nav ul li:last-child {
    border-right: none; /* No separator for the last item */
    padding-right: 0;
}

.main-nav ul li a {
    color: #007bff; /* Primary blue for menu text */
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1em;
    padding: 8px 12px; /* Increased padding for better click area */
    display: block;
    transition: background-color 0.3s ease, color 0.3s ease, border-radius 0.3s ease;
    border-radius: 5px; /* Rounded corners for menu items */
}

.main-nav ul li a:hover {
    color: #fff;
    background-color: #007bff; /* Primary blue on hover */
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

main {
    flex: 1; /* Allows main content to grow and push footer down */
    max-width: 1000px;
    margin: 0 auto; /* Margin 0 auto to remove top/bottom margin and center horizontally */
    padding: 20px; /* Add padding here instead of margin */
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

section:last-child {
    border-bottom: none;
}

h2 {
    color: #007bff; /* Primary blue for section headings */
    text-align: center;
    margin-bottom: 15px; /* Reduced margin */
    font-size: 1.8em; /* Reduced font size */
    line-height: 1.3; /* Adjusted line height for two lines */
    border-bottom: 2px solid #eee;
    padding-bottom: 15px;
}

.content-section .section-description { /* Specific class for these two paragraphs */
    text-align: center;
    margin-bottom: 10px; /* Reduced margin between paragraphs */
    color: #555;
    line-height: 1.4; /* Reduced line height */
    font-size: 0.95em; /* Slightly smaller font for these descriptions */
}

/* Intro Section above Tiles */
.intro-section {
    display: flex;
    align-items: flex-start; /* Align items to the top */
    gap: 20px;
    background-color: #f8fcfc; /* Very light blue background */
    border: 1px solid #e0f0f5;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.02); /* Subtle inner shadow */
}

.intro-counselor-image {
    width: 120px; /* Adjust size as needed */
    height: auto;
    border-radius: 8px; /* Slightly rounded corners for image */
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); /* Small shadow for image */
    flex-shrink: 0; /* Prevents image from shrinking */
    align-self: stretch; /* Image will stretch to the height of the content */
    object-fit: cover; /* Ensure image covers the area without distortion */
}

.intro-text {
    font-size: 1em;
    line-height: 1.6;
    color: #444;
    text-align: left; /* Align text to the left */
    margin: 0; /* Remove default paragraph margin */
}

/* Selection Tiles Styling */
.tile-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 25px; /* Reduced gap */
    margin-top: 30px;
}

.tile {
    background-color: #e6f7ff; /* Light blue background for tiles */
    border: 1px solid #cceeff; /* Lighter blue border */
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    text-decoration: none;
    color: #333;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
    width: 280px;
    height: auto;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.tile:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 18px rgba(0,0,0,0.15);
    background-color: #d9edf7;
}

.tile img {
    width: 70px;
    height: 70px;
    margin-bottom: 10px;
    object-fit: contain;
}

.tile h3 {
    color: #007bff;
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 1.4em;
    line-height: 1.2;
}

.tile p {
    font-size: 0.9em;
    color: #666;
    margin: 0;
    text-align: center;
}

/* Content Sections (stress test form and AI counseling form) */
.content-section {
    background-color: #ffffff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    margin-bottom: 30px;
}
.content-section h2 {
    margin-top: 0;
}


/* Form Styling */
form label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #444;
    text-align: left;
}

form input[type="text"],
form input[type="number"],
form select,
form textarea {
    width: calc(100% - 24px);
    padding: 12px;
    margin-bottom: 20px;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 1em;
}

form textarea {
    resize: vertical;
}

form button {
    display: block;
    width: 100%;
    padding: 14px 25px;
    background: #28a745;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

form button:hover {
    background: #218838;
    transform: translateY(-2px);
}

.question-group {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.03);
}

.question-group p {
    font-weight: bold;
    margin-bottom: 18px;
    color: #333;
    line-height: 1.6;
    font-size: 1.1em;
    text-align: left;
}

.question-group .options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.question-group .options label {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background-color: #f7f7f7;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    font-size: 1em;
    color: #555;
    text-align: left;
}

.question-group .options label:hover {
    background-color: #eef;
    border-color: #cceeff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.question-group .options input[type="radio"] {
    margin-right: 12px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #007bff;
    border-radius: 50%;
    outline: none;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
}

.question-group .options input[type="radio"]:checked {
    background-color: #007bff;
    border-color: #007bff;
}

.question-group .options input[type="radio"]:checked::before {
    content: '';
    display: block;
    width: 10px;
    height: 10px;
    background-color: #fff;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Stress Bar Styling */
.stress-bar-wrapper {
    margin-top: 20px;
    margin-bottom: 20px;
    text-align: center;
}

.stress-bar-container {
    display: flex;
    flex-direction: column; /* Arrange children vertically */
    width: 100%;
    max-width: 600px; /* Max width for the container */
    margin: 0 auto; /* Center the container */
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    background-color: #fdfdfd;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.stress-bar-labels-top {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 5px;
    font-size: 0.9em;
    font-weight: bold;
    color: #555;
    padding: 0 2px; /* Adjust padding to align with bar segments */
    box-sizing: border-box;
}

.stress-bar-labels-top span {
    text-align: center;
    color: #555;
    white-space: nowrap; /* Prevent text wrapping */
    flex-grow: 1; /* Allow labels to grow evenly */
}

/* Specific colors for top labels if needed, otherwise use parent color */
.stress-bar-labels-top .label-none { color: #28a745; }
.stress-bar-labels-top .label-low { color: #4CAF50; }
.stress-bar-labels-top .label-moderate { color: #FFC107; }
.stress-bar-labels-top .label-high { color: #F44336; }

/* Stress bar labels පෙළගැස්වීම සඳහා flex-grow අගයන් */
.stress-bar-labels-top .none { flex-grow: 8; text-align: left; padding-left: 0; }
.stress-bar-labels-top .low { flex-grow: 6; }
.stress-bar-labels-top .moderate { flex-grow: 13; }
.stress-bar-labels-top .high { flex-grow: 14; text-align: right; padding-right: 0; }


.stress-bar { /* This is the actual bar */
    display: flex;
    position: relative;
    width: 100%;
    height: 30px;
    border-radius: 15px;
    overflow: hidden;
    border: 1px solid #ccc; /* Ensure border is visible */
    background-color: #ddd; /* Fallback/background for segments */
    box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
}

.stress-level-range { /* These are the colored segments inside .stress-bar */
    height: 100%;
    /* flex-grow values are defined in specific classes below */
}

/* බාර් එකේ වර්ණ සහ ප්‍රමාණයන් නිවැරදි කිරීම */
.stress-level-range.none-range { background-color: #28a745; flex-grow: 8; } /* 0-7 points */
.stress-level-range.low-range { background-color: #4CAF50; flex-grow: 6; } /* 8-13 points */
.stress-level-range.moderate-range { background-color: #FFC107; flex-grow: 13; } /* 14-26 points */
.stress-level-range.high-range { background-color: #F44336; flex-grow: 14; } /* 27-40 points */


.stress-level-indicator {
    position: absolute;
    top: -5px; /* Adjust to be slightly above the bar */
    width: 12px; /* Thicker indicator */
    height: calc(100% + 10px); /* Taller indicator */
    border-radius: 6px; /* More rounded */
    box-shadow: 0 0 10px rgba(0,0,0,0.7); /* Stronger shadow */
    transition: left 1s ease-in-out;
    z-index: 10;
    transform: translateX(-50%); /* Center the indicator on its 'left' position */
    /* background-color, border-color, and animation are now set by the blinking classes below */
}

/* Indicator සඳහා දැල්වෙන animation (script.js මගින් යොදන classes සඳහා) */
/* නව තද දම් පාට වර්ණය (#6A0DAD) භාවිතා කර ඇත */
@keyframes pulse-indicator {
    0% { box-shadow: 0 0 0 0 rgba(106, 0, 173, 0.7); } /* නව වර්ණය */
    70% { box-shadow: 0 0 0 12px rgba(106, 0, 173, 0); } /* නව වර්ණය */
    100% { box-shadow: 0 0 0 0 rgba(106, 0, 173, 0); } /* නව වර්ණය */
}

/* Blinking effect for the active indicator */
/* සියලුම blinking classes සඳහා එකම තද දම් පාට වර්ණය සහ animation යොදනු ලැබේ */
.stress-level-indicator.blinking-none,
.stress-level-indicator.blinking-low,
.stress-level-indicator.blinking-moderate,
.stress-level-indicator.blinking-high {
    background-color: #6A0DAD; /* තද දම් පාට */
    border-color: #4A0080; /* තද දම් පාට border */
    animation: pulse-indicator 1.5s infinite;
}

.stress-bar-text {
    text-align: center;
    font-size: 1.2em;
    font-weight: bold;
    margin-top: 10px;
    color: #0056b3; /* තද නිල් පැහැය */
}

/* බොත්තම් වල style ගැටලුව සඳහා specificity වැඩි කර ඇත */
#stress-result .retake-button, 
#stress-result .save-button {
    background-color: #007bff;
    color: white;
    padding: 14px 25px; /* Padding වැඩි කර ඇත */
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    flex: 1; /* Allow buttons to grow and take equal width */
    /* max-width: 200px; /* REMOVED: මෙමගින් අකුරු කැපී යාම සිදු විය හැක */
    height: auto; /* Allow height to adjust based on content */
    min-height: 50px; /* Minimum height වැඩි කර ඇත */
    display: flex; /* Use flex to center text vertically */
    align-items: center;
    justify-content: center;
    text-align: center; /* Ensure text is centered */
    white-space: normal; /* NOWRAP ඉවත් කර ඇත, අවශ්‍ය නම් අකුරු එතීමට ඉඩ දෙයි */
    word-break: break-word; /* දිගු වචන කැඩීමට ඉඩ දෙයි */
}

#stress-result .retake-button:hover, 
#stress-result .save-button:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

#stress-result .save-button {
    background-color: #28a745; /* Green for save button */
}

#stress-result .save-button:hover {
    background-color: #218838;
}


/* Report Header for Medical Report Look */
.report-header {
    display: flex;
    flex-direction: column; /* Stack logo and details vertically */
    align-items: center; /* Center items horizontally */
    justify-content: center; /* Center vertically */
    gap: 10px; /* Reduced gap for stacked items */
    margin-bottom: 25px; /* Space below header */
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0; /* Separator line */
}

.report-header .report-logo {
    height: 60px; /* Emansala logo එකේ ප්‍රමාණය නිසි ප්‍රමිතියෙන් සකසා ඇත */
    width: auto;
    object-fit: contain;
    margin-bottom: 5px; /* Space between logo and text */
}

.report-header-details {
    text-align: center; /* Center text within details div */
    font-size: 0.9em;
    color: #555;
    display: flex; /* Make details flex to align website and contact */
    flex-direction: column; /* Stack website and contact vertically */
    align-items: center; /* Center items horizontally */
}

.report-header-details .report-website {
    font-weight: bold;
    color: #007bff; /* Highlight website URL */
    margin-bottom: 5px;
}

.report-header-details .report-contact-link a {
    color: #007bff;
    text-decoration: none;
    font-weight: bold;
}

.report-header-details .report-contact-link a:hover {
    text-decoration: underline;
}

.result-box .report-title {
    color: #0056b3;
    font-size: 2.2em; /* Slightly larger title */
    margin-bottom: 25px; /* More space below title */
    border-bottom: 3px double #007bff; /* Double line underline */
    padding-bottom: 12px;
}

.result-box .user-details-report {
    text-align: left;
    margin-bottom: 20px;
    border-bottom: 1px dashed #ddd;
    padding-bottom: 10px;
    line-height: 1.8; /* More spacing for readability */
}

.result-box .user-details-report p {
    margin: 5px 0;
    font-size: 1.1em; /* Slightly larger font for user details */
    color: #444;
}

/* Stress Bar Styling */
/* .stress-bar-container rules are now defined above */


.stress-bar-labels-bottom {
    display: flex;
    justify-content: space-between;
    margin-top: 5px; /* Space between labels and bar */
    font-size: 0.85em;
    position: relative;
    color: #666;
    width: 100%; /* Full width for the labels container */
}

.stress-bar-labels-bottom span {
    position: absolute;
    transform: translateX(-50%); /* Center label on its point */
}

/* Adjust positions for bottom labels based on total 40 points */
.stress-bar-labels-bottom .label-0 { left: 0%; transform: translateX(0%); text-align: left; }
.stress-bar-labels-bottom .label-7 { left: calc((7 / 40) * 100%); }
.stress-bar-labels-bottom .label-13 { left: calc((13 / 40) * 100%); }
.stress-bar-labels-bottom .label-26 { left: calc((26 / 40) * 100%); }
.stress-bar-labels-bottom .label-40 { left: 100%; transform: translateX(-100%); text-align: right; } /* Adjust last label */


.stress-bar-text {
    text-align: center;
    font-size: 1.2em;
    font-weight: bold;
    margin-top: 10px;
    color: #0056b3; /* තද නිල් පැහැය */
}

#stress-tips-si, #stress-tips-en {
    text-align: left;
    margin-bottom: 10px;
    font-size: 1em;
    color: #444;
}

/* NEW: Report Footer Section (for counselor info and contact) */
.report-footer-section {
    margin-top: 35px;
    padding-top: 25px;
    border-top: 2px dashed #e0e0e0; /* Separator line */
    text-align: center;
}

.consultant-signature {
    margin-bottom: 20px;
    position: relative; /* For signature line */
}

.consultant-signature .signature-line {
    display: block;
    width: 250px; /* Length of signature line */
    height: 1px;
    background-color: #666;
    margin: 0 auto 10px auto; /* Center and space below */
}

.consultant-signature b {
    display: block; /* Ensure name is on its own line */
    font-size: 1.2em;
    color: #0056b3; /* Darker blue for name */
    margin-bottom: 5px;
}

.consultant-signature br + span { /* For the "Senior Mental Health Counselor" text */
    font-size: 0.95em;
    color: #555;
}

.expert-contact-info {
    font-size: 1em;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center; /* Center horizontally */
    gap: 8px; /* Space between icon and text */
}

.expert-contact-info i {
    color: #007bff;
    font-size: 1.1em;
}

.expert-contact-info a {
    color: #007bff;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.expert-contact-info a:hover {
    color: #0056b3;
    text-decoration: underline;
}

.report-actions {
    margin-top: 30px;
    display: flex; /* Make buttons display in a row */
    justify-content: center; /* Center buttons horizontally */
    gap: 15px; /* Space between buttons */
    align-items: stretch; /* Make buttons the same height */
}

/* AI Counseling Section Styling */
#ai-counseling-section form {
    padding: 25px;
    background-color: #fcfcfc;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-top: 25px;
}

#ai-counseling-section textarea {
    width: calc(100% - 24px);
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    min-height: 150px;
    resize: vertical;
    box-sizing: border-box;
    font-size: 1em;
    margin-bottom: 20px;
}

#ai-counseling-section button[type="submit"] {
    background-color: #007bff;
    color: white;
    padding: 14px 25px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    width: auto;
    display: block;
    margin: 20px auto 0 auto;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

#ai-counseling-section button[type="submit"]:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

#ai-response {
    background-color: #f8f8f8; /* සුදට ඉතාම සමීප ලා අළු පැහැයක් */
    border: 1px solid #bae7ff;
    color: #0056b3;
    padding: 25px; /* Add padding for better spacing */
    border-radius: 10px;
    margin-top: 20px; /* Space from the form */
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

#ai-response h3 {
    color: #007bff;
}

#ai-response p {
    color: #333;
    text-align: left;
    margin-bottom: 10px; /* Space between paragraphs */
}

/* New styles for user question and AI solution text */
.user-problem-text {
    font-weight: bold;
    margin-bottom: 15px; /* Space below the question */
    color: #0056b3; /* Darker blue for question */
    line-height: 1.5;
}

.ai-solution-text {
    margin-top: 15px; /* Space above the solution */
    color: #333;
    line-height: 1.6;
}

/* Add styles for the new "Ask Another Question" button */
.ask-another-button {
    background-color: #007bff; /* Blue color */
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95em;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-top: 20px; /* Space above the button */
    display: block; /* Make it a block element */
    width: auto; /* Allow width to fit content */
    margin-left: auto; /* Center the button */
    margin-right: auto; /* Center the button */
}

.ask-another-button:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}


/* NEW: Contact Us Section Styling */
#contact-us-section {
    padding: 30px;
    background-color: #f8fcfc; /* Light background */
    border: 1px solid #e0f0f5;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

#contact-us-section h2 {
    color: #007bff;
    text-align: center;
    margin-bottom: 30px;
    font-size: 2em;
    border-bottom: 2px solid #eee;
    padding-bottom: 15px;
}

.contact-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Responsive grid */
    gap: 25px; /* Space between cards */
    margin-bottom: 30px;
}

.contact-card {
    background-color: #e6f7ff; /* Light blue background for cards */
    border: 1px solid #cceeff;
    border-radius: 10px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.contact-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.1);
}

.contact-card i {
    font-size: 3.5em; /* Larger icons */
    color: #007bff; /* Icon color */
    margin-bottom: 15px;
}

.contact-card h3 {
    font-size: 1.4em;
    color: #333;
    margin-top: 0;
    margin-bottom: 10px;
}

.contact-card p {
    font-size: 1em;
    color: #555;
    line-height: 1.6;
    margin: 5px 0;
}

.contact-card a {
    color: #007bff;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.contact-card a:hover {
    color: #0056b3;
    text-decoration: underline;
}

.contact-note {
    text-align: center;
    font-size: 1.05em;
    color: #666;
    margin-top: 20px;
    line-height: 1.6;
}


/* Footer Styling */
footer {
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    background-color: #333;
    color: white;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.2);
    width: 100%;
    border-top-left-radius: 10px; /* Rounded top-left corner */
    border-top-right-radius: 10px; /* Rounded top-right corner */
    padding-top: 25px; /* වැඩි padding */
    padding-bottom: 25px; /* වැඩි padding */
}

.footer-nav ul {
    list-style: none;
    padding: 0;
    margin: 0 0 15px 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

.footer-nav ul li {
    margin: 0 10px;
}

.footer-nav ul li a {
    color: white;
    text-decoration: none;
    font-size: 0.95em;
    transition: color 0.3s ease;
}

.footer-nav ul li a:hover {
    color: #007bff;
}


/* Responsive adjustments */
@media (max-width: 768px) {
    header {
        height: auto;
        padding: 15px;
    }
    .header-content {
        flex-direction: column;
        gap: 10px;
        padding: 0 10px; /* Adjusted padding for smaller screens */
        justify-content: center; /* Small screens වලදී content මධ්‍යගත කරයි */
    }
    #emansala-logo {
        height: 60px;
        margin-right: 0; /* Remove auto margin on small screens */
    }
    .header-text {
        text-align: center; /* Small screens වලදී text මධ්‍යගත කරයි */
    }
    .header-text h1 {
        font-size: 1.8em;
    }
    .header-text h2 {
        font-size: 1em;
    }
    .main-nav ul {
        flex-direction: column;
        align-items: center;
    }
    .main-nav ul li {
        margin: 10px 0;
        border-right: none;
        padding-right: 0;
    }
    .intro-section {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .intro-counselor-image {
        margin-bottom: 15px;
    }
    .intro-text {
        text-align: center;
    }
    .tile-container {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }
    .tile {
        max-width: 90%; /* ටයිල් වල උපරිම පළල කුඩා තිර සඳහා සකස් කර ඇත */
        min-height: 160px; /* Adjust min-height for smaller screens */
    }
    main {
        padding: 15px;
        margin: 15px auto;
    }
    .content-section h2 {
        font-size: 1.6em;
    }
    .content-section .section-description {
        font-size: 0.9em;
    }
    form input[type="text"],
    form input[type="number"],
    form select,
    form textarea {
        width: calc(100% - 20px);
    }
    .stress-level-classification {
        flex-direction: column;
        gap: 5px;
        font-size: 0.8em;
    }
    .stress-bar-labels-top span {
        font-size: 0.7em;
        white-space: normal; /* Allow wrapping on small screens */
    }
    .stress-bar-labels-top .none,
    .stress-bar-labels-top .high {
        text-align: center; /* Center align on small screens for better distribution */
        padding: 0;
    }
    .stress-bar-labels-bottom span {
        font-size: 0.7em;
    }
    .stress-bar-text {
        font-size: 1.1em;
    }

    /* Adjustments for new report header/footer on small screens */
    .report-header {
        flex-direction: column;
        gap: 10px;
    }
    .report-header .report-logo {
        height: 50px;
    }
    .report-header-details {
        font-size: 0.8em;
    }
    .report-footer-section {
        padding-top: 15px;
    }
    .consultant-signature .signature-line {
        width: 150px; /* Shorter line on small screens */
    }
    .consultant-signature b {
        font-size: 1.1em;
    }
    .expert-contact-info {
        flex-direction: column;
        gap: 5px;
        font-size: 0.9em;
    }
    .report-actions {
        flex-direction: column; /* Buttons stack vertically on small screens */
        gap: 10px;
    }
    #stress-result .retake-button, 
    #stress-result .save-button {
        width: 80%; /* Smaller width for stacked buttons */
        margin: 0 auto; /* Center stacked buttons */
        padding: 12px 20px; /* Adjust padding for smaller screens */
        font-size: 0.95em; /* Slightly smaller font on mobile */
        min-height: 45px; /* Adjust min-height for smaller screens */
        white-space: normal; /* Allow text to wrap on smaller screens */
    }
    .footer-nav ul {
        flex-direction: column;
        gap: 5px;
    }

    /* Responsive adjustments for Contact Us section */
    .contact-info-grid {
        grid-template-columns: 1fr; /* Single column on smaller screens */
    }
    .contact-card {
        padding: 20px;
    }
    .contact-card i {
        font-size: 3em;
    }
    .contact-card h3 {
        font-size: 1.2em;
    }
    .contact-card p {
        font-size: 0.95em;
    }
    .contact-note {
        font-size: 0.95em;
    }
}

@media (max-width: 480px) {
    header {
        height: auto;
        padding: 10px 0;
    }
    .header-content {
        padding: 0 10px;
    }
    #emansala-logo {
        height: 50px;
    }
    .header-text h1 {
        font-size: 1.5em;
    }
    .header-text h2 {
        font-size: 0.9em;
    }
    .main-nav ul li a {
        font-size: 0.9em;
        padding: 5px 8px;
    }
    .content-section {
        padding: 20px;
    }
    .content-section h2 {
        font-size: 1.5em;
    }
    .tile {
        width: 95%; /* ඉතා කුඩා තිර සඳහා ටයිල් වල පළල වැඩි කර ඇත */
        padding: 15px;
    }
    .tile img {
        width: 60px;
        height: 60px;
    }
    .tile h3 {
        font-size: 1.2em;
    }
    .question-group {
        padding: 15px;
    }
    .question-group p {
        font-size: 0.95em;
    }
    .question-group .options label {
        padding: 10px;
        font-size: 0.9em;
    }
    .question-group .options input[type="radio"] {
        width: 16px;
        height: 16px;
    }
    #stress-test-section button[type="submit"],
    #ai-counseling-section button[type="submit"] {
        padding: 10px 18px;
        font-size: 1em;
    }
    .result-box .report-title {
        font-size: 1.6em;
    }
    .stress-bar-container {
        width: 95%;
    }
    .stress-bar-text {
        font-size: 1em;
    }
    #stress-result .retake-button, 
    #stress-result .save-button {
        width: 90%;
        padding: 10px 18px; /* Further adjust padding */
        font-size: 0.9em; /* Even smaller font on very small screens */
        min-height: 40px; /* Adjust min-height for very small screens */
    }
    .footer-nav ul {
        flex-direction: column;
        gap: 5px;
    }

    /* Responsive adjustments for Contact Us section */
    #contact-us-section h2 {
        font-size: 1.8em;
    }
    .contact-card {
        padding: 15px;
    }
    .contact-card i {
        font-size: 2.5em;
    }
    .contact-card h3 {
        font-size: 1.1em;
    }
    .contact-card p {
        font-size: 0.9em;
    }
    .contact-note {
        font-size: 0.95em;
    }
}

/* --- Print Specific Styles for A4 Paper --- */
@media print {
    body {
        margin: 0;
        padding: 0;
        background-color: #fff; /* Print on white background */
        color: #000; /* Black text for print */
    }

    /* Hide elements not needed in print */
    header,
    nav,
    footer,
    #selection-section, /* Hide other sections */
    #ai-counseling-section,
    .report-actions /* Hide buttons in the report when printing */
     {
        display: none !important;
    }

    /* Ensure only the stress report section is visible and fits */
    #stress-test-section {
        display: block !important;
        margin: 0;
        padding: 0;
        box-shadow: none; /* No shadow in print */
        border: none; /* No border in print */
        width: 100%;
        max-width: none;
    }

    #stress-result {
        border: none !important; /* Remove border from result box for cleaner print */
        box-shadow: none !important; /* Remove shadow */
        border-radius: 0 !important; /* No rounded corners */
        padding: 20mm; /* A4 standard margin (adjust as needed) */
        width: auto;
        min-height: auto;
        display: block !important; /* Ensure it's visible */
    }

    /* Force background colors and images to print */
    .report-header,
    .stress-bar,
    .stress-level-indicator,
    .none-range, .low-range, .moderate-range, .high-range {
        -webkit-print-color-adjust: exact !important; /* For WebKit browsers (Chrome, Safari) */
        print-color-adjust: exact !important; /* Standard property */
    }

    /* Adjust font sizes for better readability on print */
    .report-title {
        font-size: 28pt !important;
        margin-bottom: 15pt !important;
        border-bottom: 2pt solid #007bff !important;
        padding-bottom: 8pt !important;
    }

    .user-details-report p {
        font-size: 11pt !important;
        line-height: 1.5 !important;
    }

    .stress-bar-text {
        font-size: 12pt !important;
        margin-top: 10pt !important;
        margin-bottom: 15pt !important;
    }

    .stress-bar-container {
        width: 80% !important; /* Make bar slightly narrower to fit margins */
        margin: 10pt auto 20pt auto !important;
    }

    .stress-bar {
        height: 18pt !important;
    }

    .stress-level-indicator {
        width: 6pt !important;
        height: calc(100% + 6pt) !important;
        top: -3pt !important;
        border-width: 0.5pt !important;
    }

    .stress-bar-labels-top, .stress-bar-labels-bottom {
        font-size: 8pt !important;
    }

    #stress-tips-si, #stress-tips-en {
        font-size: 10pt !important;
        margin-bottom: 8pt !important;
        text-align: justify; /* Justify text for a more formal look */
    }

    .report-footer-section {
        margin-top: 25pt !important;
        padding-top: 15pt !important;
        border-top: 1pt dashed #ccc !important;
    }

    .consultant-signature b {
        font-size: 12pt !important;
    }

    .consultant-signature br + span {
        font-size: 10pt !important;
    }

    .expert-contact-info {
        font-size: 10pt !important;
    }

    .expert-contact-info i {
        font-size: 10pt !important;
    }

    /* Ensure print styles also hide the new contact section's buttons/links if any */
    #contact-us-section {
        display: block !important; /* Ensure it's printed if it's the active section */
        border: none !important;
        box-shadow: none !important;
        background-color: #fff !important;
        padding: 20mm !important;
    }
    .contact-info-grid a {
        color: inherit !important; /* Prevent blue links on print, use black */
        text-decoration: none !important; /* Remove underline */
    }
    .contact-info-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important; /* Adjust grid for print */
        gap: 15mm !important;
    }
    .contact-card {
        border: 1px solid #eee !important; /* Light border for cards in print */
        background-color: #fff !important;
        box-shadow: none !important;
        padding: 10mm !important;
    }
    .contact-card i {
        color: #555 !important; /* Grayish icon color for print */
        font-size: 2.5em !important;
    }
    .contact-card h3 {
        font-size: 11pt !important;
    }
    .contact-card p {
        font-size: 9pt !important;
    }
    .contact-note {
        font-size: 9pt !important;
    }
}
