{% extends 'admin/base.html.twig' %}

{% block title %}Toplu Burc Yorumu{% endblock %}
{% block page_title %}Toplu Burc Yorumu Girisi{% endblock %}

{% block body %}
    {# Breadcrumb #}
    <div class="mb-6">
        <nav class="flex items-center gap-2 text-sm text-gray-500">
            <a href="{{ path('admin_horoscope') }}" class="hover:text-primary-600 transition-colors">
                <i class="fas fa-moon mr-1"></i> Astroloji
            </a>
            <i class="fas fa-chevron-right text-xs text-gray-300"></i>
            <span class="text-gray-900 font-medium">Toplu Giris</span>
        </nav>
    </div>

    <form method="post" action="{{ path('admin_horoscope_bulk') }}">
        <input type="hidden" name="_token" value="{{ csrf_token('horoscope_bulk') }}">

        {# Date selector #}
        <div class="card mb-6">
            <div class="card-body">
                <div class="flex items-center gap-4">
                    <label class="text-sm font-medium text-gray-700">Tarih:</label>
                    <input type="date" name="date" value="{{ currentDate }}" class="form-input text-sm">
                    <p class="text-xs text-gray-500">Tum burc yorumlari bu tarih icin kaydedilecektir.</p>
                </div>
            </div>
        </div>

        {# Sign Cards #}
        <div class="grid grid-cols-1 lg:grid-cols-2 gap-4 mb-6">
            {% for slug, signData in signs %}
                {% set existing = existingMap[slug]|default(null) %}
                <div class="card overflow-hidden">
                    <div class="px-4 py-3 flex items-center gap-3" style="background: linear-gradient(135deg, #1a1a3e 0%, #2d1b4e 100%);">
                        <span class="text-2xl" style="color: #d4af37;">{{ signData.icon }}</span>
                        <div>
                            <h3 class="font-bold text-white text-sm">{{ signData.name|upper }}</h3>
                            <p class="text-xs" style="color: #d4af37aa;">{{ signData.date_range }}</p>
                        </div>
                        {% if existing %}
                            <span class="ml-auto text-xs text-green-300"><i class="fas fa-check-circle"></i> Mevcut</span>
                        {% endif %}
                    </div>
                    <div class="p-4">
                        <textarea name="content_{{ slug }}" rows="3"
                                  class="form-input w-full text-sm mb-2"
                                  placeholder="{{ signData.name }} burc yorumunu girin...">{{ existing ? existing.content : '' }}</textarea>
                        <div class="grid grid-cols-3 gap-2">
                            <select name="love_{{ slug }}" class="form-input text-xs">
                                <option value="">Ask</option>
                                {% for i in 1..5 %}
                                    <option value="{{ i }}" {% if existing and existing.loveRating == i %}selected{% endif %}>❤️ {{ i }}/5</option>
                                {% endfor %}
                            </select>
                            <select name="career_{{ slug }}" class="form-input text-xs">
                                <option value="">Kariyer</option>
                                {% for i in 1..5 %}
                                    <option value="{{ i }}" {% if existing and existing.careerRating == i %}selected{% endif %}>💼 {{ i }}/5</option>
                                {% endfor %}
                            </select>
                            <select name="health_{{ slug }}" class="form-input text-xs">
                                <option value="">Saglik</option>
                                {% for i in 1..5 %}
                                    <option value="{{ i }}" {% if existing and existing.healthRating == i %}selected{% endif %}>💚 {{ i }}/5</option>
                                {% endfor %}
                            </select>
                        </div>
                    </div>
                </div>
            {% endfor %}
        </div>

        {# Submit #}
        <div class="flex items-center justify-between">
            <a href="{{ path('admin_horoscope') }}" class="btn-secondary">
                <i class="fas fa-arrow-left mr-2"></i> Geri Don
            </a>
            <button type="submit" class="btn-primary">
                <i class="fas fa-save mr-2"></i> Tum Yorumlari Kaydet
            </button>
        </div>
    </form>
{% endblock %}
