from django.db import models

class HeroSlide(models.Model):
    badge_text = models.CharField(max_length=100, default="Best IT Solutions & Innovations")
    title = models.CharField(max_length=200, default="Quality Digital Services You Really Need!")
    highlight_word = models.CharField(max_length=100, default="Really Need!", blank=True)
    description = models.TextField(default="SONICTECH builds world-class software, enterprise web applications, and digital platforms designed to accelerate business growth and streamline operations.")
    primary_btn_text = models.CharField(max_length=50, default="Get Started")
    primary_btn_url = models.CharField(max_length=100, default="/contact")
    secondary_btn_text = models.CharField(max_length=50, default="Our Services")
    secondary_btn_url = models.CharField(max_length=100, default="/services")
    image = models.ImageField(upload_to='hero/', blank=True, null=True)
    image_url = models.URLField(blank=True, default="https://images.unsplash.com/photo-1522071820081-009f0129c71c?auto=format&fit=crop&w=1600&q=80")
    order = models.PositiveIntegerField(default=0)
    is_active = models.BooleanField(default=True)

    class Meta:
        ordering = ['order']
        verbose_name = "Hero Slide"
        verbose_name_plural = "Hero Slides"

    def __str__(self):
        return f"Slide: {self.title[:50]}"


class CompanyStat(models.Model):
    number = models.CharField(max_length=50, default="150+")
    label = models.CharField(max_length=100, default="Projects Completed")
    icon = models.CharField(max_length=50, default="CheckCircle2", help_text="Lucide icon name")
    order = models.PositiveIntegerField(default=0)

    class Meta:
        ordering = ['order']
        verbose_name = "Company Statistic"
        verbose_name_plural = "Company Statistics"

    def __str__(self):
        return f"{self.number} {self.label}"


class WhyChooseUs(models.Model):
    title = models.CharField(max_length=150)
    description = models.TextField()
    icon = models.CharField(max_length=50, default="ShieldCheck")
    order = models.PositiveIntegerField(default=0)

    class Meta:
        ordering = ['order']
        verbose_name = "Why Choose Us Item"
        verbose_name_plural = "Why Choose Us Items"

    def __str__(self):
        return self.title
