{% extends "base.html" %}

{% block title %}Link Already Used{% endblock %}

{% block content %}
<div class="container mt-5">
    <div class="row justify-content-center">
        <div class="col-md-8">
            <div class="card border-warning">
                <div class="card-header bg-warning text-dark">
                    <h4 class="mb-0">
                        <i class="fas fa-exclamation-triangle"></i>
                        Link Already Used
                    </h4>
                </div>
                <div class="card-body">
                    <div class="alert alert-warning" role="alert">
                        <h5 class="alert-heading">This link has already been used</h5>
                        {% if link_type == 'assessment' %}
                            <p>
                                This invitation link stays valid until the assessment is submitted.
                                The assessment associated with this invitation has already been submitted,
                                so the link is no longer usable.
                            </p>
                        {% else %}
                            <p>For security reasons, this link can only be used once and has already been accessed.</p>
                        {% endif %}
                        <hr>
                        <p class="mb-0">
                            {% if link_type == 'assessment' %}
                                If you need to take the assessment again, please contact your administrator or consultant to request a new invitation link.
                            {% elif link_type == 'password_reset' %}
                                If you still need to reset your password, please <a href="{{ url_for('auth.reset_password_request') }}" class="alert-link">request a new password reset link</a>.
                            {% else %}
                                If you need access to this resource, please contact support for assistance.
                            {% endif %}
                        </p>
                    </div>
                    
                    <div class="mt-4">
                        <a href="{{ url_for('main.index') }}" class="btn btn-primary">
                            <i class="fas fa-home"></i>
                            Return to Home
                        </a>
                        {% if link_type == 'password_reset' %}
                            <a href="{{ url_for('auth.reset_password_request') }}" class="btn btn-outline-secondary ml-2">
                                <i class="fas fa-key"></i>
                                Request New Reset Link
                            </a>
                        {% endif %}
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %}