---
export interface Props {
    phone: string;
    description?: string;
    title?: string;
}

const {
    phone,
    title = "Срочная помощь",
    description = "Задержание, обыск, ДТП? Звоните круглосуточно."
} = Astro.props;
---

<div class="mt-6 relative group">
    <!-- Пульсирующий фон -->
    <div class="absolute inset-0 bg-gradient-to-r from-red-500 to-red-600 rounded-2xl blur opacity-20 group-hover:opacity-30 animate-pulse"></div>

    <div class="relative bg-gradient-to-br from-red-500/10 to-red-600/5 backdrop-blur-xl border border-red-500/20 rounded-2xl p-6 overflow-hidden hover:border-red-500/40 transition-all duration-500 hover:shadow-2xl hover:shadow-red-500/20">
        <!-- Декоративный круг -->
        <div class="absolute top-0 right-0 w-32 h-32 bg-red-500/10 rounded-full blur-2xl -mr-16 -mt-16 animate-pulse"></div>

        <div class="relative z-10 flex flex-col sm:flex-row items-center gap-4">
            <div class="relative">
                <!-- Пульсирующая иконка -->
                <div class="absolute inset-0 bg-red-500 rounded-xl blur animate-ping opacity-20"></div>
                <div class="relative w-12 h-12 bg-gradient-to-br from-red-500 to-red-600 rounded-xl flex items-center justify-center shadow-lg shadow-red-500/30">
                    <svg class="w-6 h-6 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"></path>
                    </svg>
                </div>
            </div>

            <div class="flex-1 text-center sm:text-left">
                <h4 class="text-red-500 font-bold text-base sm:text-lg mb-1 flex items-center justify-center sm:justify-start gap-2">
                    {title}
                    <span class="px-2 py-0.5 bg-red-500/20 text-red-600 text-xs rounded-full animate-pulse">24/7</span>
                </h4>
                <p class="text-xs sm:text-sm text-gray-600 mb-4 leading-relaxed">{description}</p>

                <a href={`tel:${phone.replace(/\D/g, '')}`} class="group/link inline-flex items-center gap-2 sm:gap-3 text-xl sm:text-2xl font-bold text-red-500 hover:text-red-600 transition-all duration-300 relative justify-center sm:justify-start">
                    <span class="relative">
                        {phone}
                        <span class="absolute bottom-0 left-0 w-full h-0.5 bg-red-500 transform scale-x-0 group-hover/link:scale-x-100 transition-transform duration-300 origin-left"></span>
                    </span>
                    <svg class="w-5 sm:w-6 h-5 sm:h-6 transform group-hover/link:translate-x-1 transition-transform duration-300" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 7l5 5m0 0l-5 5m5-5H6"></path>
                    </svg>
                </a>
            </div>
        </div>
    </div>
</div>