from django.db import models
from django.utils import timezone


class HomeBanner(models.Model):
    """Model for Homepage banner section"""
    icon = models.CharField(max_length=50, help_text="Badge icon class (e.g., 'fa-solid fa-building')")
    badge = models.CharField(max_length=100, help_text="Badge text")
    heading = models.CharField(max_length=200, help_text="Main heading text")
    highlight = models.CharField(max_length=100, blank=True, help_text="Highlighted text (gradient text)")
    subheading = models.CharField(max_length=200, blank=True, help_text="Subheading text")
    description = models.TextField(help_text="Banner description")
    button_text = models.CharField(max_length=100, default="Learn More", help_text="Primary CTA button text")
    button_url = models.CharField(max_length=200, default="#", help_text="Primary CTA button URL")
    display_order = models.PositiveIntegerField(default=0, help_text="Order for displaying banners in carousel")
    is_active = models.BooleanField(default=True, help_text="Whether this banner is active")
    created_at = models.DateTimeField(auto_now_add=True)
    updated_at = models.DateTimeField(auto_now=True)

    class Meta:
        verbose_name = "Home Banner"
        verbose_name_plural = "Home Banners"
        ordering = ['display_order', 'created_at']

    def __str__(self):
        return f"{self.heading} - {self.badge}"

