/*
  =================================================================
  فایل استایل اختصاصی تست اضطراب GAD-7
  نسخه: 2.0 - بهینه‌سازی شده با A11y (Contrast) و E-E-A-T
  =================================================================
*/

/* --- Disclaimer --- */
.disclaimer {
    background-color: rgba(255, 193, 7, 0.1); /* Light yellow */
    border-right: 4px solid var(--cat-کودک-و-نوزاد, #ffc107); /* Yellow border */
    padding: 15px;
    margin-top: 20px;
    border-radius: var(--border-radius-small);
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.9rem;
}
.disclaimer i {
    color: var(--cat-کودک-و-نوزاد, #ffc107);
    font-size: 1.2rem;
    margin-top: 3px;
}
.disclaimer p strong {
    color: #b38600; /* Darker yellow */
}

/* --- Questionnaire Form --- */
.form-instructions {
    font-size: 1rem;
    color: var(--light-text-color);
    margin-bottom: 25px;
    text-align: center;
}

.question-group {
    border: none;
    padding: 0;
    margin-bottom: 25px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
}
.question-group legend { padding: 0; } 

.question-text {
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 15px;
    line-height: 1.5;
}

.options-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
}

.options-group label {
    display: block;
    background-color: var(--bg-color);
    padding: 12px 15px;
    border-radius: var(--border-radius-small);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition-fast);
    text-align: center;
    font-size: 0.95rem;
}

.options-group input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.options-group input[type="radio"]:checked + label {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    font-weight: bold;
}

.options-group input[type="radio"]:focus-visible + label {
     outline: 3px solid var(--secondary-color);
     outline-offset: 2px;
}
.options-group label:hover {
     background-color: #eee;
}
.options-group input[type="radio"]:checked + label:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}


.question-group .error-message {
    color: var(--cat-تحلیل-پزشکی, #dc3545);
    font-size: 0.85rem;
    margin-top: 8px;
    font-weight: bold;
    display: block;
    min-height: 1.2em;
}
.question-group.error .question-text {
    color: var(--cat-تحلیل-پزشکی, #dc3545);
}
.question-group[aria-invalid="true"] .question-text {
     border-right: 3px solid var(--cat-تحلیل-پزشکی, #dc3545);
     padding-right: 10px;
}


.primary-cta {
    width: 100%;
    margin-top: 10px;
    background-color: var(--cat-سلامت-روان, #007bff);
}
.primary-cta:hover {
    background-color: #0056b3;
}


/* --- Custom GAD-7 Result Card --- */
.result-card-gad7 {
    color: white;
    border-radius: var(--border-radius-base);
    padding: 30px;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease-out;
}
.result-card-gad7.visible { opacity: 1; transform: translateY(0); }

.result-header h3 { font-size: 1.1rem; font-weight: bold; opacity: 0.9; margin-bottom: 5px; }
.result-header .result-value {
    font-size: clamp(3rem, 10vw, 4rem);
    font-weight: bold; line-height: 1.1; margin-bottom: 10px;
}

.result-interpretation .result-category { font-size: 1.6rem; font-weight: bold; margin-bottom: 10px; }
.result-interpretation .result-explanation { font-size: 1rem; line-height: 1.6; opacity: 0.95; }

.disclaimer-result { margin-top: 25px; background-color: rgba(0, 0, 0, 0.2); border-color: white; color: white; }
.disclaimer-result i { color: white; }
.disclaimer-result p strong { color: white; }

/* --- Result Card Color Coding (A11y Contrast Fix) --- */
.result-card-gad7.status-minimal { background: linear-gradient(145deg, #0a5c36, #084227); } /* Dark Green (WCAG Pass) */
.result-card-gad7.status-mild { background: linear-gradient(145deg, #ffc107, #ffd43b); color: var(--text-color); } /* Yellow */
.result-card-gad7.status-moderate { background: linear-gradient(145deg, #b05c0d, #9e520c); } /* Dark Orange (WCAG Pass) */
.result-card-gad7.status-severe { background: linear-gradient(145deg, #a52834, #8b212c); } /* Dark Red (WCAG Pass) */

/* Fix text for yellow */
.result-card-gad7.status-mild .disclaimer-result { background-color: rgba(0, 0, 0, 0.1); border-color: var(--text-color); color: var(--text-color); }
.result-card-gad7.status-mild .disclaimer-result i,
.result-card-gad7.status-mild .disclaimer-result p strong { color: var(--text-color); }

/* --- Result Card CTA Button --- */
.result-card-gad7 .secondary-cta {
    background-color: white;
    font-weight: bold;
    margin-top: 15px;
}
.result-card-gad7 .secondary-cta:hover {
    background-color: rgba(255, 255, 255, 0.9);
}
.result-card-gad7.status-minimal .secondary-cta { color: #084227; }
.result-card-gad7.status-moderate .secondary-cta { color: #9e520c; }
.result-card-gad7.status-severe .secondary-cta { color: #8b212c; }
.result-card-gad7.status-mild .secondary-cta {
    background-color: var(--text-color);
    color: #b38600; /* Darker yellow */
}
.result-card-gad7.status-mild .secondary-cta:hover {
    background-color: #495057; /* Darker gray */
}


/* --- Content Table --- */
.score-table-container { overflow-x: auto; margin: 20px 0; }
table { width: 100%; border-collapse: collapse; text-align: center; }
th, td { padding: 12px 15px; border: 1px solid var(--border-color); vertical-align: middle; }
th { background-color: var(--bg-color); font-weight: bold; }
/* Status colors */
table .status-minimal { background-color: rgba(32, 201, 151, 0.1); }
table .status-mild { background-color: rgba(255, 193, 7, 0.1); }
table .status-moderate { background-color: rgba(253, 126, 20, 0.1); }
table .status-severe { background-color: rgba(220, 53, 69, 0.1); }

/* --- A11y: Reduce Motion --- */
@media (prefers-reduced-motion: reduce) {
  .result-card-gad7,
  .result-card-gad7.visible,
  .options-group label {
    transition: none;
  }
  
  html {
    scroll-behavior: auto;
  }
}