/*
  =================================================================
  فایل استایل پایه برای تمام ابزارها (Tool Base)
  نسخه: 2.1 - افزودن کلاس نتایج حساس (بازخورد اخلاقی)
  =================================================================
*/

/* ... (بخش‌های Layout & Structure و Tool Card & Form Styles بدون تغییر) ... */
/* ============== Layout & Structure ============== */
.tool-hero {
  text-align: center;
  padding: 30px 20px 40px;
  border-bottom: 1px solid var(--border-color);
  background-color: #fff;
}
.tool-title {
  font-size: clamp(1.7rem, 5vw, 2.5rem);
  margin-bottom: 10px;
  color: var(--text-color);
}
.tool-description {
  max-width: 700px;
  margin: 0 auto;
  color: var(--light-text-color);
  font-size: 1.05rem;
}
.breadcrumbs {
  margin-bottom: 20px;
  font-size: 0.9rem;
}
.breadcrumbs ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.breadcrumbs li {
  display: flex;
  align-items: center;
  color: var(--light-text-color);
}
.breadcrumbs a {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition-fast);
}
.breadcrumbs a:hover {
  text-decoration: underline;
}
.breadcrumbs li:not(:last-child)::after {
  content: '\f104'; /* Font Awesome angle-left for RTL */
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  margin-right: 8px; /* For RTL */
  color: var(--border-color);
}
.tool-section {
  padding: 50px 0;
}
.tool-wrapper {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
  align-items: flex-start;
}
@media (min-width: 992px) {
  .tool-wrapper {
    grid-template-columns: 1fr 1fr;
  }
}

/* ============== Tool Card & Form Styles ============== */
.tool-card {
  background-color: var(--card-bg-color);
  border-radius: var(--border-radius-base);
  padding: 30px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
  position: sticky; /* Make the form stick while scrolling */
  top: 100px;
}
.tool-card-title {
  font-size: 1.5rem;
  margin-bottom: 25px;
  text-align: center;
}
.form-group {
  margin-bottom: 20px;
}
.form-group label {
  display: block;
  font-weight: bold;
  margin-bottom: 8px;
  font-size: 0.95rem;
}
.input-wrapper {
  position: relative;
}
.input-wrapper input[type="number"] {
  width: 100%;
  padding: 14px 45px 14px 20px; /* RTL padding */
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-small);
  font-size: 1.1rem;
  font-family: var(--font-family-base);
  transition: var(--transition-fast);
  -moz-appearance: textfield; /* Hide number spinners on Firefox */
}
.input-wrapper input[type="number"]::-webkit-outer-spin-button,
.input-wrapper input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none; /* Hide number spinners on Chrome, Safari */
  margin: 0;
}
.input-wrapper input[type="number"]:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(123, 44, 191, 0.1);
  outline: none;
}
.input-wrapper i {
  position: absolute;
  top: 50%;
  right: 15px; /* RTL position */
  transform: translateY(-50%);
  color: var(--secondary-color);
  font-size: 1.2rem;
}
.error-message {
  color: var(--cat-تحلیل-پزشکی); /* Use a brand color for errors */
  font-size: 0.85rem;
  margin-top: 5px;
  min-height: 1.2em; /* Prevent layout shift */
  font-weight: bold;
  display: none; /* Initially hidden */
}
.form-group.error .error-message {
    display: block; /* Show on error */
}
.form-group.error input[type="number"] {
    border-color: var(--cat-تحلیل-پزشکی);
    background-color: rgba(220, 53, 69, 0.05);
}
.primary-cta {
  width: 100%;
  font-size: 1.1rem;
  padding: 15px;
  background-color: var(--primary-color);
}
.primary-cta:hover {
    background-color: #6a1b9a; /* A slightly darker shade for hover */
    box-shadow: 0 6px 12px rgba(123, 44, 191, 0.4);
}

/* ============== Result Card Styles ============== */

.result-card {
  background: linear-gradient(145deg, var(--primary-color), var(--secondary-color));
  color: white;
  border-radius: var(--border-radius-base);
  padding: 30px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 380px; /* Ensure consistent height */
  justify-content: center;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}
.result-card.visible {
    opacity: 1;
    transform: translateY(0);
}
.result-header h3 {
  font-size: 1.1rem;
  font-weight: normal;
  opacity: 0.8;
  margin-bottom: 5px;
}
.result-value {
  font-size: clamp(3rem, 10vw, 4.5rem);
  font-weight: bold;
  line-height: 1.1;
}
.result-interpretation {
    padding: 15px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-small);
}
.result-category {
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 8px;
}
.result-explanation {
    font-size: 0.95rem;
    line-height: 1.6;
    opacity: 0.9;
}
.secondary-cta {
    background-color: white;
    color: var(--primary-color);
    font-weight: bold;
}
.secondary-cta:hover {
    background-color: #f8f7ff;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* === تغییر ۱: افزودن کلاس برای نتایج حساس (بازخورد اخلاقی) === */
/* این کلاس باید در HTML ابزارهای سلامت روان (GAD-7, PHQ-9) 
  به کارت نتیجه اضافه شود تا ظاهر آن را مسئولانه‌تر کند.
*/
.result-card.result-sensitive {
    background: linear-gradient(145deg, var(--cat-تحلیل-پزشکی), #a12a36);
    text-align: right;
    justify-content: flex-start;
    gap: 15px;
}
/* افزودن یک هشدار در بالای کارت */
.result-card.result-sensitive::before {
    content: '\f071 سلب مسئولیت مهم'; /* Font Awesome Warning */
    font-family: 'Font Awesome 6 Free', 'Font Awesome 6 Free'; /* Fallback */
    font-weight: 900;
    font-size: 1.2rem;
    display: block;
    text-align: center;
    padding: 12px;
    background-color: rgba(0,0,0,0.15);
    border-radius: var(--border-radius-small);
}
/* کوچکتر کردن عدد امتیاز که مرکز توجه نباشد */
.result-card.result-sensitive .result-value {
    font-size: clamp(2rem, 8vw, 2.5rem); 
    margin-bottom: 5px;
    text-align: center;
}
.result-card.result-sensitive .result-header h3 {
    text-align: center;
}
.result-card.result-sensitive .result-interpretation {
    background-color: rgba(255, 255, 255, 0.1);
    font-size: 1rem;
    line-height: 1.7;
}
.result-card.result-sensitive .result-explanation {
    font-size: 1rem;
    opacity: 1;
}

/* این کلاس باید برای نمایش منابع بحران (خطوط تلفن کمکی) 
  در زیر نتیجه ابزارهای حساس استفاده شود.
*/
.crisis-resources {
    margin-top: 20px;
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    background-color: rgba(0,0,0,0.1);
    border-radius: var(--border-radius-small);
}
.crisis-resources h4 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: white;
}
.crisis-resources p {
    font-size: 0.95rem;
    line-height: 1.7;
    opacity: 0.9;
    margin-bottom: 10px;
}
.crisis-resources a {
    color: white;
    font-weight: bold;
    text-decoration: underline;
}

/* ... (بخش‌های Content & Article Styles و سایر بخش‌ها بدون تغییر) ... */
/* ============== Content & Article Styles ============== */
.content-section, .toc-section, .related-tools-section, .references-section {
    padding: 40px 0;
    border-top: 1px solid var(--border-color);
}
.content-section {
    max-width: 800px;
    margin: 0 auto;
}
.content-section h2, .related-tools-title, .references-section h3 {
    font-size: 1.8rem;
    margin-bottom: 20px;
}
.content-section h3 {
    font-size: 1.4rem;
    margin-top: 30px;
    margin-bottom: 15px;
    color: var(--secondary-color);
}
.content-section p, .content-section li {
    font-size: 1.05rem;
    line-height: 1.8;
    margin-bottom: 15px;
}
.content-section ul {
    padding-right: 20px;
    margin-bottom: 20px;
}
.content-section a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
}
.content-section a:hover {
    text-decoration: underline;
}

/* --- TOC Card --- */
.toc-card {
    background: var(--card-bg-color);
    padding: 25px;
    border-radius: var(--border-radius-base);
    box-shadow: var(--shadow);
}
.toc-card h3 {
    margin-bottom: 15px;
}
#table-of-contents ul {
    list-style: none;
    padding: 0;
}
#table-of-contents li a {
    display: block;
    padding: 8px 0;
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition-fast);
    font-weight: normal;
    border-bottom: 1px solid var(--border-color);
}
#table-of-contents li a:hover {
    color: var(--primary-color);
    padding-right: 10px;
}

/* --- Info & Quote Boxes --- */
.info-box, .quote-box {
    padding: 20px;
    margin: 25px 0;
    border-right: 4px solid var(--secondary-color);
    background-color: var(--bg-color);
    border-radius: 0 var(--border-radius-small) var(--border-radius-small) 0;
}
.info-box {
    display: flex;
    align-items: center;
    gap: 15px;
}
.info-box i {
    font-size: 1.5rem;
    color: var(--secondary-color);
}
.quote-box footer {
    margin-top: 10px;
    font-style: italic;
    color: var(--light-text-color);
    font-size: 0.9rem;
}

/* --- FAQ Accordion --- */
.faq-item {
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
}
.faq-item summary {
    font-weight: bold;
    cursor: pointer;
    list-style: none; /* Hide default arrow */
    position: relative;
    padding-left: 25px; /* Space for custom icon */
}
.faq-item summary::-webkit-details-marker {
    display: none; /* Hide default arrow in Chrome/Safari */
}
.faq-item summary::before {
    content: '\f054'; /* Font Awesome chevron-right for RTL */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%) rotate(0deg);
    transition: transform 0.2s ease-in-out;
    color: var(--secondary-color);
}
.faq-item[open] > summary::before {
    transform: translateY(-50%) rotate(90deg);
}
.faq-item p {
    padding-top: 15px;
    padding-right: 10px;
    color: var(--light-text-color);
}

/* --- Related Tools --- */
.related-tools-section {
    background-color: var(--bg-color);
}
.related-tools-title {
    text-align: center;
}

/* --- References --- */
.references-section {
    background-color: #fff;
    font-size: 0.9rem;
}
.references-intro {
    font-style: italic;
    color: var(--light-text-color);
    margin-bottom: 20px;
}
.references-section ul {
    list-style-type: square;
    padding-right: 20px;
    color: var(--light-text-color);
}