{% extends "admin/errors/base.html" %}

{% block icon %}⏱️{% endblock %}

{% block title %}429 - Too Many Requests{% endblock %}

{% block content %}
<div class="error-icon">⏱️</div>
<div class="status-code">429</div>
<div class="status-name">Too Many Requests</div>
<div class="error-message">
    You've made too many requests in a short period. Please slow down and try again in a moment.
</div>
<div class="error-code">Error Code: {{ error_code }}</div>

{% if details and details.retry_after %}
<div style="margin: 1.5rem 0; padding: 1rem; background: #fef3c7; border-radius: 0.5rem;">
    <p style="color: #92400e; font-weight: 600;">
        Please wait {{ details.retry_after }} seconds before trying again.
    </p>
</div>
{% endif %}

<div class="action-buttons">
    <a href="javascript:location.reload()" class="btn btn-primary">Retry</a>
    <a href="/admin/dashboard" class="btn btn-secondary">Dashboard</a>
</div>

{% if show_debug %}
<div class="debug-info">
    <h3>🔧 Debug Information (Admin Only)</h3>
    <div class="debug-item">
        <span class="debug-label">Path:</span>
        <span class="debug-value">{{ path }}</span>
    </div>
    <div class="debug-item">
        <span class="debug-label">Error Code:</span>
        <span class="debug-value">{{ error_code }}</span>
    </div>
    {% if details %}
    <div class="debug-item">
        <span class="debug-label">Details:</span>
        <pre>{{ details | tojson(indent=2) }}</pre>
    </div>
    {% endif %}
</div>
{% endif %}

<div class="support-link">
    Experiencing persistent rate limits? <a href="/admin/support">Contact Support</a>
</div>
{% endblock %}
