

<?php $__env->startSection('content'); ?>
<div class="container py-4">
    <!-- Main Header with Right-Aligned Button -->
    <div class="main-header mb-4 d-flex justify-content-between align-items-center">
        <h1 class="h2">Suicide Assessment Five-Step Evaluation and Triage (SAFE-T)</h1>
        <button type="button" class="btn btn-sm btn-outline-secondary show-view" data-view="dashboard">
            <i class="bi bi-arrow-left"></i> Back to Dashboard
        </button>
    </div>

    <!-- Instructions Section -->
    <h2 class="h5">Instructions</h2>
    <p>
</div>
<form id="questionForm" onsubmit="submitForm(event)" class="ajax-form-new forms-sample" method="post" action="<?php echo e(route('mentalHealth.safeTStore')); ?>" data-redirect="<?php echo e(route('mentalHealth.dashboard')); ?>">     
<!-- Centered Content with Card and Progress Bar --> 
<div class="d-flex justify-content-center min-vh-75 align-items-center">
    <div class="col-sm-12 col-xl-6">  

        <!-- Progress Bar -->
        <div class="progress mb-4">
  <div class="progress-bar bg-primary" id="progress-bar" role="progressbar" style="width: 0%;" 
       aria-valuenow="0" aria-valuemin="0" aria-valuemax="100">0%</div>
</div>
    

<!-- Question: Historical Factors -->
<div class="bg-secondary border border-white rounded h-100 p-4 question" data-question="1">
    <h2>Historical Factors</h2>
    <input type="hidden" name="question" value="Historical Factors">
    <h6 class="mb-4 text-white">
        Please select all historical factors that apply:
    </h6>

    <!-- Previous suicide attempt(s) with dates -->
    <div class="form-check">
        <input type="checkbox" class="form-check-input" id="prev_suicide" name="historical_factors[]" value="Previous suicide attempt(s)">
        <label class="form-check-label text-white" for="prev_suicide">Previous suicide attempt(s) - Date(s):</label>
    </div>
    <div id="prev_suicide_input" style="display:none; margin-left: 20px;">
        <input type="text" class="form-control" name="prev_suicide_dates" placeholder="Enter Date(s)">
    </div>

    <!-- History of psychiatric diagnosis with details -->
    <div class="form-check mt-3">
        <input type="checkbox" class="form-check-input" id="psych_diag" name="historical_factors[]" value="History of psychiatric diagnosis">
        <label class="form-check-label text-white" for="psych_diag">History of psychiatric diagnosis:</label>
    </div>
    <div id="psych_diag_input" style="display:none; margin-left: 20px;">
        <input type="text" class="form-control" name="psych_diag_details" placeholder="Enter diagnosis details">
    </div>

    <!-- Family history of suicide -->
    <div class="form-check mt-3">
        <input type="checkbox" class="form-check-input" id="family_suicide" name="historical_factors[]" value="Family history of suicide">
        <label class="form-check-label text-white" for="family_suicide">Family history of suicide</label>
    </div>

    <!-- History of abuse/trauma -->
    <div class="form-check mt-3">
        <input type="checkbox" class="form-check-input" id="abuse_trauma" name="historical_factors[]" value="History of abuse/trauma">
        <label class="form-check-label text-white" for="abuse_trauma">History of abuse/trauma</label>
    </div>

    <!-- Previous psychiatric hospitalizations with dates -->
    <div class="form-check mt-3">
        <input type="checkbox" class="form-check-input" id="prev_hosp" name="historical_factors[]" value="Previous psychiatric hospitalizations">
        <label class="form-check-label text-white" for="prev_hosp">Previous psychiatric hospitalizations - Date(s):</label>
    </div>
    <div id="prev_hosp_input" style="display:none; margin-left: 20px;">
        <input type="text" class="form-control" name="prev_hosp_dates" placeholder="Enter Date(s)">
    </div>

    <!-- Recent discharge from psychiatric hospital -->
    <div class="form-check mt-3">
        <input type="checkbox" class="form-check-input" id="recent_discharge" name="historical_factors[]" value="Recent discharge from psychiatric hospital (within past month)">
        <label class="form-check-label text-white" for="recent_discharge">Recent discharge from psychiatric hospital (within past month)</label>
    </div>

    <!-- History of impulsivity -->
    <div class="form-check mt-3">
        <input type="checkbox" class="form-check-input" id="impulsivity" name="historical_factors[]" value="History of impulsivity">
        <label class="form-check-label text-white" for="impulsivity">History of impulsivity</label>
    </div>

    <!-- History of self-harm behaviors -->
    <div class="form-check mt-3">
        <input type="checkbox" class="form-check-input" id="self_harm" name="historical_factors[]" value="History of self-harm behaviors">
        <label class="form-check-label text-white" for="self_harm">History of self-harm behaviors</label>
    </div>

    <!-- History of aggression -->
    <div class="form-check mt-3">
        <input type="checkbox" class="form-check-input" id="aggression" name="historical_factors[]" value="History of aggression">
        <label class="form-check-label text-white" for="aggression">History of aggression</label>
    </div>

    <div class="d-flex justify-content-between mt-4">
    <button class="btn btn-outline-light" onclick="navigateQuestion(-1, event)" id="prevBtn">Previous</button>
    <button class="btn btn-primary" id="nextBtn" onclick="navigateQuestion(1, event)">Next</button>
    </div>
</div>




<!-- Question: Current Symptoms -->
<div class="bg-secondary border border-white rounded h-100 p-4 question d-none" data-question="2">
    <h2>Current Symptoms</h2>
    <input type="hidden" name="question" value="Current Symptoms">
    <h6 class="mb-4 text-white">
        Please select all current symptoms that apply:
    </h6>

    <div class="form-check">
        <input type="checkbox" class="form-check-input" id="current_depression" name="current_symptoms[]" value="Current depression">
        <label class="form-check-label text-white" for="current_depression">Current depression</label>
    </div>

    <div class="form-check">
        <input type="checkbox" class="form-check-input" id="current_anxiety" name="current_symptoms[]" value="Current anxiety">
        <label class="form-check-label text-white" for="current_anxiety">Current anxiety</label>
    </div>

    <div class="form-check">
        <input type="checkbox" class="form-check-input" id="substance_use" name="current_symptoms[]" value="Current substance use/intoxication">
        <label class="form-check-label text-white" for="substance_use">Current substance use/intoxication</label>
    </div>

    <div class="form-check">
        <input type="checkbox" class="form-check-input" id="current_psychosis" name="current_symptoms[]" value="Current psychosis">
        <label class="form-check-label text-white" for="current_psychosis">Current psychosis</label>
    </div>

    <div class="form-check">
        <input type="checkbox" class="form-check-input" id="current_hopelessness" name="current_symptoms[]" value="Current hopelessness">
        <label class="form-check-label text-white" for="current_hopelessness">Current hopelessness</label>
    </div>

    <div class="form-check">
        <input type="checkbox" class="form-check-input" id="current_impulsivity" name="current_symptoms[]" value="Current impulsivity">
        <label class="form-check-label text-white" for="current_impulsivity">Current impulsivity</label>
    </div>

    <div class="form-check">
        <input type="checkbox" class="form-check-input" id="sleep_disturbance" name="current_symptoms[]" value="Sleep disturbance">
        <label class="form-check-label text-white" for="sleep_disturbance">Sleep disturbance</label>
    </div>

    <div class="form-check">
        <input type="checkbox" class="form-check-input" id="command_hallucinations" name="current_symptoms[]" value="Command hallucinations">
        <label class="form-check-label text-white" for="command_hallucinations">Command hallucinations</label>
    </div>

    <div class="form-check">
        <input type="checkbox" class="form-check-input" id="anhedonia" name="current_symptoms[]" value="Anhedonia">
        <label class="form-check-label text-white" for="anhedonia">Anhedonia</label>
    </div>

    <div class="form-check">
        <input type="checkbox" class="form-check-input" id="treatment_nonadherence" name="current_symptoms[]" value="Treatment non-adherence">
        <label class="form-check-label text-white" for="treatment_nonadherence">Treatment non-adherence</label>
    </div>

    <div class="d-flex justify-content-between mt-4">
    <button class="btn btn-outline-light" onclick="navigateQuestion(-1, event)" id="prevBtn">Previous</button>
    <button class="btn btn-primary" id="nextBtn" onclick="navigateQuestion(1, event)">Next</button>
        
        
    </div>
</div>

 


<!-- Question: Stressful Life Events -->
<div class="bg-secondary border border-white rounded h-100 p-4 question d-none" data-question="3">
    <h2>Stressful Life Events</h2>
    <input type="hidden" name="question" value="Stressful Life Events">
    <h6 class="mb-4 text-white">
        Please select all stressful life events that apply:
    </h6>

    <div class="form-check">
        <input type="checkbox" class="form-check-input" id="recent_loss" name="stressful_life_events[]" value="Recent loss/bereavement">
        <label class="form-check-label text-white" for="recent_loss">Recent loss/bereavement</label>
    </div>

    <div class="form-check">
        <input type="checkbox" class="form-check-input" id="financial_problems" name="stressful_life_events[]" value="Financial problems">
        <label class="form-check-label text-white" for="financial_problems">Financial problems</label>
    </div>

    <div class="form-check">
        <input type="checkbox" class="form-check-input" id="legal_problems" name="stressful_life_events[]" value="Legal problems">
        <label class="form-check-label text-white" for="legal_problems">Legal problems</label>
    </div>

    <div class="form-check">
        <input type="checkbox" class="form-check-input" id="relationship_problems" name="stressful_life_events[]" value="Relationship problems/conflict">
        <label class="form-check-label text-white" for="relationship_problems">Relationship problems/conflict</label>
    </div>

    <div class="form-check">
        <input type="checkbox" class="form-check-input" id="job_school_problems" name="stressful_life_events[]" value="Job/school problems">
        <label class="form-check-label text-white" for="job_school_problems">Job/school problems</label>
    </div>

    <div class="form-check">
        <input type="checkbox" class="form-check-input" id="housing_instability" name="stressful_life_events[]" value="Housing instability">
        <label class="form-check-label text-white" for="housing_instability">Housing instability</label>
    </div>

    <div class="form-check">
        <input type="checkbox" class="form-check-input" id="health_problems" name="stressful_life_events[]" value="Health problems">
        <label class="form-check-label text-white" for="health_problems">Health problems</label>
    </div>

    <div class="form-check">
        <input type="checkbox" class="form-check-input" id="humiliating_event" name="stressful_life_events[]" value="Humiliating event">
        <label class="form-check-label text-white" for="humiliating_event">Humiliating event</label>
    </div>

    <div class="form-check">
        <input type="checkbox" class="form-check-input" id="anniversary_traumatic" name="stressful_life_events[]" value="Anniversary of traumatic event">
        <label class="form-check-label text-white" for="anniversary_traumatic">Anniversary of traumatic event</label>
    </div>

    <div class="d-flex justify-content-between mt-4">
        <button class="btn btn-outline-light" onclick="navigateQuestion(-1, event)">Previous</button>
        <button class="btn btn-primary" onclick="navigateQuestion(1, event)">Next</button>
    </div>
</div>




<!-- Question: Other Risk Factors -->
<div class="bg-secondary border border-white rounded h-100 p-4 question d-none" data-question="4">
    <h2>Other Risk Factors</h2>
    <input type="hidden" name="question" value="Other Risk Factors">
    <h6 class="mb-4 text-white">
        Please select all other risk factors that apply:
    </h6>

    <!-- Access to lethal means with details -->
    <div class="form-check">
        <input type="checkbox" class="form-check-input" id="access_lethal" name="other_risk_factors[]" value="Access to lethal means">
        <label class="form-check-label text-white" for="access_lethal">Access to lethal means:</label>
    </div>
    <div id="access_lethal_input" style="display:none; margin-left: 20px;">
        <input type="text" class="form-control" name="access_lethal_details" placeholder="Enter details">
    </div>

    <!-- Chronic pain or physical illness -->
    <div class="form-check mt-3">
        <input type="checkbox" class="form-check-input" id="chronic_pain" name="other_risk_factors[]" value="Chronic pain or physical illness">
        <label class="form-check-label text-white" for="chronic_pain">Chronic pain or physical illness</label>
    </div>

    <!-- Social isolation -->
    <div class="form-check mt-3">
        <input type="checkbox" class="form-check-input" id="social_isolation" name="other_risk_factors[]" value="Social isolation">
        <label class="form-check-label text-white" for="social_isolation">Social isolation</label>
    </div>

    <!-- Poor support system -->
    <div class="form-check mt-3">
        <input type="checkbox" class="form-check-input" id="poor_support" name="other_risk_factors[]" value="Poor support system">
        <label class="form-check-label text-white" for="poor_support">Poor support system</label>
    </div>

    <!-- Minority stress -->
    <div class="form-check mt-3">
        <input type="checkbox" class="form-check-input" id="minority_stress" name="other_risk_factors[]" value="Minority stress">
        <label class="form-check-label text-white" for="minority_stress">Minority stress (LGBTQ+, racial/ethnic, etc.)</label>
    </div>

    <!-- Barriers to accessing mental health treatment -->
    <div class="form-check mt-3">
        <input type="checkbox" class="form-check-input" id="barriers_treatment" name="other_risk_factors[]" value="Barriers to accessing mental health treatment">
        <label class="form-check-label text-white" for="barriers_treatment">Barriers to accessing mental health treatment</label>
    </div>

    <!-- Other with details -->
    <div class="form-check mt-3">
        <input type="checkbox" class="form-check-input" id="other_risk" name="other_risk_factors[]" value="Other">
        <label class="form-check-label text-white" for="other_risk">Other:</label>
    </div>
    <div id="other_risk_input" style="display:none; margin-left: 20px;">
        <input type="text" class="form-control" name="other_risk_details" placeholder="Enter details">
    </div>

    <div class="d-flex justify-content-between mt-4">
        <button class="btn btn-outline-light" onclick="navigateQuestion(-1, event)">Previous</button>
        <button class="btn btn-primary" onclick="navigateQuestion(1, event)">Next</button>
    </div>
</div>




<!-- Question: Internal Protective Factors -->
<div class="bg-secondary border border-white rounded h-100 p-4 question d-none" data-question="5">
    <h2>Internal Protective Factors</h2>
    <input type="hidden" name="question" value="Internal Protective Factors">
    <h6 class="mb-4 text-white">
        Please select all internal protective factors that apply:
    </h6>

    <div class="form-check">
        <input type="checkbox" class="form-check-input" id="coping_stress" name="internal_protective_factors[]" value="Ability to cope with stress">
        <label class="form-check-label text-white" for="coping_stress">Ability to cope with stress</label>
    </div>

    <div class="form-check">
        <input type="checkbox" class="form-check-input" id="religious_beliefs" name="internal_protective_factors[]" value="Religious/spiritual beliefs that prohibit suicide">
        <label class="form-check-label text-white" for="religious_beliefs">Religious/spiritual beliefs that prohibit suicide</label>
    </div>

    <div class="form-check">
        <input type="checkbox" class="form-check-input" id="responsibility_family" name="internal_protective_factors[]" value="Responsibility to family/children">
        <label class="form-check-label text-white" for="responsibility_family">Responsibility to family/children</label>
    </div>

    <div class="form-check">
        <input type="checkbox" class="form-check-input" id="pets" name="internal_protective_factors[]" value="Pets">
        <label class="form-check-label text-white" for="pets">Pets</label>
    </div>

    <div class="form-check">
        <input type="checkbox" class="form-check-input" id="life_satisfaction" name="internal_protective_factors[]" value="Life satisfaction">
        <label class="form-check-label text-white" for="life_satisfaction">Life satisfaction</label>
    </div>

    <div class="form-check">
        <input type="checkbox" class="form-check-input" id="fear_of_death" name="internal_protective_factors[]" value="Fear of death or dying">
        <label class="form-check-label text-white" for="fear_of_death">Fear of death or dying</label>
    </div>

    <div class="form-check">
        <input type="checkbox" class="form-check-input" id="hope_future" name="internal_protective_factors[]" value="Hope for the future">
        <label class="form-check-label text-white" for="hope_future">Hope for the future</label>
    </div>

    <div class="form-check">
        <input type="checkbox" class="form-check-input" id="problem_solving" name="internal_protective_factors[]" value="Problem-solving ability">
        <label class="form-check-label text-white" for="problem_solving">Problem-solving ability</label>
    </div>

    <div class="form-check">
        <input type="checkbox" class="form-check-input" id="resilience" name="internal_protective_factors[]" value="Resilience">
        <label class="form-check-label text-white" for="resilience">Resilience</label>
    </div>

    <div class="form-check">
        <input type="checkbox" class="form-check-input" id="sense_purpose" name="internal_protective_factors[]" value="Sense of purpose in life">
        <label class="form-check-label text-white" for="sense_purpose">Sense of purpose in life</label>
    </div>

    <div class="form-check">
        <input type="checkbox" class="form-check-input" id="positive_selfesteem" name="internal_protective_factors[]" value="Positive self-esteem">
        <label class="form-check-label text-white" for="positive_selfesteem">Positive self-esteem</label>
    </div>

    <div class="d-flex justify-content-between mt-4">
        <button class="btn btn-outline-light" onclick="navigateQuestion(-1, event)">Previous</button>
        <button class="btn btn-primary" onclick="navigateQuestion(1, event)">Next</button>
    </div>
</div>



<!-- Question: External Protective Factors -->
<div class="bg-secondary border border-white rounded h-100 p-4 question d-none" data-question="6">
    <h2>External Protective Factors</h2>
    <input type="hidden" name="question" value="External Protective Factors">
    <h6 class="mb-4 text-white">
        Please select all external protective factors that apply:
    </h6>

    <div class="form-check">
        <input type="checkbox" class="form-check-input" id="social_support" name="external_protective_factors[]" value="Social support/connection">
        <label class="form-check-label text-white" for="social_support">Social support/connection</label>
    </div>

    <div class="form-check">
        <input type="checkbox" class="form-check-input" id="therapeutic_relationship" name="external_protective_factors[]" value="Therapeutic relationship">
        <label class="form-check-label text-white" for="therapeutic_relationship">Therapeutic relationship</label>
    </div>

    <div class="form-check">
        <input type="checkbox" class="form-check-input" id="responsibility_others" name="external_protective_factors[]" value="Responsibility to others">
        <label class="form-check-label text-white" for="responsibility_others">Responsibility to others</label>
    </div>

    <div class="form-check">
        <input type="checkbox" class="form-check-input" id="work_school" name="external_protective_factors[]" value="Engaged in work or school">
        <label class="form-check-label text-white" for="work_school">Engaged in work or school</label>
    </div>

    <div class="form-check">
        <input type="checkbox" class="form-check-input" id="supportive_living" name="external_protective_factors[]" value="Supportive living environment">
        <label class="form-check-label text-white" for="supportive_living">Supportive living environment</label>
    </div>

    <div class="form-check">
        <input type="checkbox" class="form-check-input" id="active_treatment" name="external_protective_factors[]" value="Active participation in treatment">
        <label class="form-check-label text-white" for="active_treatment">Active participation in treatment</label>
    </div>

    <div class="form-check">
        <input type="checkbox" class="form-check-input" id="limited_lethal_means" name="external_protective_factors[]" value="Limited access to lethal means">
        <label class="form-check-label text-white" for="limited_lethal_means">Limited access to lethal means</label>
    </div>

    <div class="form-check">
        <input type="checkbox" class="form-check-input" id="family_support_external" name="external_protective_factors[]" value="Family support">
        <label class="form-check-label text-white" for="family_support_external">Family support</label>
    </div>

    <div class="form-check">
        <input type="checkbox" class="form-check-input" id="community_resources" name="external_protective_factors[]" value="Community resources">
        <label class="form-check-label text-white" for="community_resources">Community resources</label>
    </div>

    <div class="form-check">
        <input type="checkbox" class="form-check-input" id="cultural_beliefs" name="external_protective_factors[]" value="Cultural/religious beliefs against suicide">
        <label class="form-check-label text-white" for="cultural_beliefs">Cultural/religious beliefs against suicide</label>
    </div>

    <!-- Other option with additional text input -->
    <div class="form-check">
        <input type="checkbox" class="form-check-input" id="external_other" name="external_protective_factors[]" value="Other">
        <label class="form-check-label text-white" for="external_other">Other:</label>
    </div>
    <div id="external_other_input" style="display:none; margin-left: 20px;">
        <input type="text" class="form-control" name="external_other_details" placeholder="Enter details">
    </div>

    <div class="d-flex justify-content-between mt-4">
        <button class="btn btn-outline-light" onclick="navigateQuestion(-1, event)">Previous</button>
        <button class="btn btn-primary" onclick="navigateQuestion(1, event)">Next</button>
    </div>
</div>






      <!-- Question 1 -->
      <div class="bg-secondary border border-white rounded h-100 p-4 question d-none" data-question="7">
    <h2>Suicidal Thoughts    </h2>
    <h6 class="mb-4 text-white">
    Are you having thoughts of suicide?<h6>
    <input type="hidden" name="question" value="Are you having thoughts of suicide?">
    
    <?php for($i = 0; $i <= 1; $i++): ?>
        <div class="form-check form-check-inline">
            <input class="form-check-input" type="radio" name="question7" id="question7_<?php echo e($i); ?>" value="<?php echo e($i); ?>">
            <label class="form-check-label text-white" for="question7_<?php echo e($i); ?>">
                <?php echo e(['Yes', 'No'][$i]); ?>

            </label>
        </div>
        <hr>
    <?php endfor; ?>  
 
    <!-- Buttons -->
    <div class="d-flex justify-content-between mt-4">
        <button class="btn btn-outline-light" onclick="navigateQuestion(-1, event)" id="prevBtn">Previous</button>
        <button class="btn btn-primary" id="nextBtn" onclick="navigateQuestion(1, event)">Next</button>
    </div>
</div>


<!-- Question 8 -->
<div class="bg-secondary border border-white rounded h-100 p-4 question d-none" data-question="8">
    <h2>Suicidal Thoughts </h2>
    <h6 class="mb-4 text-white">
    How often do these thoughts occur? 
    </h6>
    <input type="hidden" name="question" value="How often do these thoughts occur? ">
    
    <div class="form-group">
        <input type="text" name="question8" class="form-control" placeholder="Enter">
    </div>
    
    <div class="d-flex justify-content-between mt-4">
        <button class="btn btn-outline-light" onclick="navigateQuestion(-1, event)">Previous</button>
        <button class="btn btn-primary" onclick="navigateQuestion(1, event)">Next</button>
    </div>
</div>


<!-- Question 9 -->
<div class="bg-secondary border border-white rounded h-100 p-4 question d-none" data-question="9">
    <h2>Suicidal Thoughts </h2>
    <h6 class="mb-4 text-white">
    How long do they last? 
    </h6>
    <input type="hidden" name="question" value="How long do they last?">
    
    <div class="form-group">
        <input type="text" name="question9" class="form-control" placeholder="Enter">
    </div>
    
    <div class="d-flex justify-content-between mt-4">
        <button class="btn btn-outline-light" onclick="navigateQuestion(-1, event)">Previous</button>
        <button class="btn btn-primary" onclick="navigateQuestion(1, event)">Next</button>
    </div>
</div>



<!-- Question 10 -->
<div class="bg-secondary border border-white rounded h-100 p-4 question d-none" data-question="10">
    <h2>Suicidal Thoughts </h2>
    <h6 class="mb-4 text-white">
    How intense are they?
    </h6>
    <input type="hidden" name="question" value="How intense are they?">
    
    <div class="form-group">
        <input type="text" name="question10" class="form-control" placeholder="Enter">
    </div>
    
    <div class="d-flex justify-content-between mt-4">
        <button class="btn btn-outline-light" onclick="navigateQuestion(-1, event)">Previous</button>
        <button class="btn btn-primary" onclick="navigateQuestion(1, event)">Next</button>
    </div>
</div>


      <!-- Question 11-->
      <div class="bg-secondary border border-white rounded h-100 p-4 question d-none" data-question="11">
    <h2>Suicidal Thoughts    </h2>
    <h6 class="mb-4 text-white">
    Can you control these thoughts?<h6>
    <input type="hidden" name="question" value="Can you control these thoughts?">
    
    <?php for($i = 0; $i <= 2; $i++): ?>
        <div class="form-check form-check-inline">
            <input class="form-check-input" type="radio" name="question11" id="question11_<?php echo e($i); ?>" value="<?php echo e($i); ?>">
            <label class="form-check-label text-white" for="question11_<?php echo e($i); ?>">
                <?php echo e(['Yes', 'No','Sometimes'][$i]); ?>

            </label>
        </div>
        <hr>
    <?php endfor; ?>   
 
    <!-- Buttons -->
    <div class="d-flex justify-content-between mt-4">
        <button class="btn btn-outline-light" onclick="navigateQuestion(-1, event)" id="prevBtn">Previous</button>
        <button class="btn btn-primary" id="nextBtn" onclick="navigateQuestion(1, event)">Next</button>
    </div>
</div>




      <!-- Question 12-->
      <div class="bg-secondary border border-white rounded h-100 p-4 question d-none" data-question="12">
    <h2>Suicidal Intent</h2>
    <h6 class="mb-4 text-white">
    Do you want to die?<h6>
    <input type="hidden" name="question" value="Do you want to die?">
    
    <?php for($i = 0; $i <= 2; $i++): ?>
        <div class="form-check form-check-inline">
            <input class="form-check-input" type="radio" name="question12" id="question12_<?php echo e($i); ?>" value="<?php echo e($i); ?>">
            <label class="form-check-label text-white" for="question12_<?php echo e($i); ?>">
                <?php echo e(['Yes', 'No','Ambivalent'][$i]); ?>

            </label>
        </div>
        <hr>
    <?php endfor; ?>   
 
    <!-- Buttons -->
    <div class="d-flex justify-content-between mt-4">
        <button class="btn btn-outline-light" onclick="navigateQuestion(-1, event)" id="prevBtn">Previous</button>
        <button class="btn btn-primary" id="nextBtn" onclick="navigateQuestion(1, event)">Next</button>
    </div>
</div>



      <!-- Question 13-->
      <div class="bg-secondary border border-white rounded h-100 p-4 question d-none" data-question="13">
    <h2>Suicidal Intent</h2>
    <h6 class="mb-4 text-white">
    Do you intend to kill yourself? <h6>
    <input type="hidden" name="question" value="Do you intend to kill yourself? ">
    
    <?php for($i = 0; $i <= 2; $i++): ?>
        <div class="form-check form-check-inline">
            <input class="form-check-input" type="radio" name="question13" id="question13_<?php echo e($i); ?>" value="<?php echo e($i); ?>">
            <label class="form-check-label text-white" for="question13_<?php echo e($i); ?>">
                <?php echo e(['Yes', 'No','Ambivalent'][$i]); ?>

            </label>
        </div>
        <hr> 
    <?php endfor; ?>   
 
    <!-- Buttons -->
    <div class="d-flex justify-content-between mt-4">
        <button class="btn btn-outline-light" onclick="navigateQuestion(-1, event)" id="prevBtn">Previous</button>
        <button class="btn btn-primary" id="nextBtn" onclick="navigateQuestion(1, event)">Next</button>
    </div>
</div>




<!-- Question 14 -->
<div class="bg-secondary border border-white rounded h-100 p-4 question d-none" data-question="14">
    <h2>Suicidal Intent</h2>
    <h6 class="mb-4 text-white">
    What has kept you from acting on your thoughts?
    </h6>
    <input type="hidden" name="question" value="What has kept you from acting on your thoughts?">
    
    <div class="form-group">
        <input type="text" name="question14" class="form-control" placeholder="Enter">
    </div>
    
    <div class="d-flex justify-content-between mt-4">
        <button class="btn btn-outline-light" onclick="navigateQuestion(-1, event)">Previous</button>
        <button class="btn btn-primary" onclick="navigateQuestion(1, event)">Next</button>
    </div>
</div>



      <!-- Question 15-->
      <div class="bg-secondary border border-white rounded h-100 p-4 question d-none" data-question="15">
    <h2>Suicide Plan</h2>
    <h6 class="mb-4 text-white">
    Do you have a plan for how to kill yourself?<h6>
    <input type="hidden" name="question" value="Do you have a plan for how to kill yourself?">
    
    <?php for($i = 0; $i <= 1; $i++): ?>
        <div class="form-check form-check-inline">
            <input class="form-check-input" type="radio" name="question15" id="question15_<?php echo e($i); ?>" value="<?php echo e($i); ?>">
            <label class="form-check-label text-white" for="question15_<?php echo e($i); ?>">
                <?php echo e(['Yes', 'No'][$i]); ?>

            </label> 
        </div>
        <hr> 
    <?php endfor; ?>   
 
    <!-- Buttons -->
    <div class="d-flex justify-content-between mt-4">
        <button class="btn btn-outline-light" onclick="navigateQuestion(-1, event)" id="prevBtn">Previous</button>
        <button class="btn btn-primary" id="nextBtn" onclick="navigateQuestion(1, event)">Next</button>
    </div>
</div>



<!-- Question 16 -->
<div class="bg-secondary border border-white rounded h-100 p-4 question d-none" data-question="16">
    <h2>Suicide Plan</h2>
    <h6 class="mb-4 text-white">
    What is your plan?
    </h6>
    <input type="hidden" name="question" value="What is your plan?">
    
    <div class="form-group">
        <input type="text" name="question16" class="form-control" placeholder="Enter">
    </div>
     
    <div class="d-flex justify-content-between mt-4">
        <button class="btn btn-outline-light" onclick="navigateQuestion(-1, event)">Previous</button>
        <button class="btn btn-primary" onclick="navigateQuestion(1, event)">Next</button>
    </div>
</div>




      <!-- Question 17-->
      <div class="bg-secondary border border-white rounded h-100 p-4 question d-none" data-question="17">
    <h2>Suicide Plan</h2>
    <h6 class="mb-4 text-white">
    How prepared are you to carry out this plan?<h6>
    <input type="hidden" name="question" value="How prepared are you to carry out this plan?">
    
    <?php for($i = 0; $i <= 3; $i++): ?>
        <div class="form-check form-check-inline">
            <input class="form-check-input" type="radio" name="question17" id="question17_<?php echo e($i); ?>" value="<?php echo e($i); ?>">
            <label class="form-check-label text-white" for="question17_<?php echo e($i); ?>">
                <?php echo e(['Not prepared', 'Somewhat prepared', 'Very prepared', 'Completely prepared'][$i]); ?>

            </label> 
        </div>
        <hr> 
    <?php endfor; ?>   
 
    <!-- Buttons -->
    <div class="d-flex justify-content-between mt-4">
        <button class="btn btn-outline-light" onclick="navigateQuestion(-1, event)" id="prevBtn">Previous</button>
        <button class="btn btn-primary" id="nextBtn" onclick="navigateQuestion(1, event)">Next</button>
    </div>
</div>



<!-- Question 9 -->
<div class="bg-secondary border border-white rounded h-100 p-4 question d-none" data-question="18">
    <h2>Suicide Plan</h2>
    <input type="hidden" name="question" value="Do you have access to the means needed to carry out your plan?">
    <h6 class="mb-4 text-white">
    Do you have access to the means needed to carry out your plan?
    </h6>
    
    <!-- Yes/No Radio Buttons -->

    <div class="form-check form-check-inline">
        <input class="form-check-input" type="radio" name="question18_no" id="question0_no" value="no" onclick="toggleFileInput(false)">
        <label class="form-check-label text-white" for="question0_no">No</label>
    </div>

    <div class="form-check form-check-inline">
        <input class="form-check-input" type="radio" name="question18_yes" id="question1_yes" value="yes" onclick="toggleFileInput(true)">
        <label class="form-check-label text-white" for="question1_yes">Yes</label>
    </div>
 
    
    <!-- File Input (initially hidden) -->
    <div id="question18_file" class="form-group mt-3" style="display: none;">
        <label for="question9_file_input" class="text-white">Upload a file with details:</label>
        <input type="text" name="question18" id="question9_file_input" class="form-control">
    </div>
     
    <div class="d-flex justify-content-between mt-4">
        <button class="btn btn-outline-light" onclick="navigateQuestion(-1, event)">Previous</button>
        <button class="btn btn-primary" onclick="navigateQuestion(1, event)">Next</button>
    </div>
</div>




<!-- Question: Suicide Plan -->
<div class="bg-secondary border border-white rounded h-100 p-4 question d-none" data-question="19">
    <h2>Suicide Plan</h2>
    <input type="hidden" name="question" value="What steps have you taken to prepare for suicide?">
    <h6 class="mb-4 text-white">
        What steps have you taken to prepare for suicide?
    </h6>

    <?php
        $options = [
            'Acquired means',
            'Rehearsed method',
            'Written suicide note',
            'Given away possessions',
            'Updated will',
            'Other'
        ];
    ?>

    <?php for($i = 0; $i < count($options); $i++): ?>
        <div class="form-check">
            <input type="checkbox" class="form-check-input" id="suicide_plan_<?php echo e($i); ?>" name="suicide_plan[]" value="<?php echo e($options[$i]); ?>">
            <label class="form-check-label text-white" for="suicide_plan_<?php echo e($i); ?>">
                <?php echo e($options[$i]); ?>

            </label>
        </div>
        <?php if($i === count($options) - 1): ?>
            <div id="suicide_plan_other_input" style="display:none; margin-left:20px;">
                <input type="text" class="form-control" name="suicide_plan_other_details" placeholder="Enter details">
            </div>
        <?php endif; ?>
        <hr>
    <?php endfor; ?>

    <div class="d-flex justify-content-between mt-4">
        <button class="btn btn-outline-light" onclick="navigateQuestion(-1, event)">Previous</button>
        <button class="btn btn-primary" id="nextBtnfinel" onclick="navigateQuestion(1, event)">Next</button>
        <button type="submit" class="btn btn-success d-none" id="submitBtn">Submit</button>
    </div> 
</div>
 
 
</div>
  
  </div>
  
  </div>
  </div>
  </form>
  <!-- JavaScript for Navigation -->
  <script>
  // Toggle the input field for Previous suicide attempt(s)
  document.getElementById('prev_suicide').addEventListener('change', function() {
      document.getElementById('prev_suicide_input').style.display = this.checked ? 'block' : 'none';
  });

  // Toggle the input field for History of psychiatric diagnosis
  document.getElementById('psych_diag').addEventListener('change', function() {
      document.getElementById('psych_diag_input').style.display = this.checked ? 'block' : 'none';
  });

  // Toggle the input field for Previous psychiatric hospitalizations
  document.getElementById('prev_hosp').addEventListener('change', function() {
      document.getElementById('prev_hosp_input').style.display = this.checked ? 'block' : 'none';
  });

  document.getElementById('access_lethal').addEventListener('change', function() {
        document.getElementById('access_lethal_input').style.display = this.checked ? 'block' : 'none';
    });

    // Toggle additional details input for "Other"
    document.getElementById('other_risk').addEventListener('change', function() {
        document.getElementById('other_risk_input').style.display = this.checked ? 'block' : 'none';
    })

    document.getElementById('external_other').addEventListener('change', function() {
        document.getElementById('external_other_input').style.display = this.checked ? 'block' : 'none';
    });

    function toggleFileInput(show) {
        document.getElementById('question18_file').style.display = show ? 'block' : 'none';
    }

    var lastIndex = <?php echo e(count($options) - 1); ?>;
    document.getElementById('suicide_plan_' + lastIndex).addEventListener('change', function() {
        document.getElementById('suicide_plan_other_input').style.display = this.checked ? 'block' : 'none';
    });
</script>
  <?php $__env->stopSection(); ?> 
<?php echo $__env->make('mental.layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /var/www/html/resources/views/mental/suicidality_risk/safe-t.blade.php ENDPATH**/ ?>