# Generated by Django 5.2.3 on 2026-07-04 14:48

from django.db import migrations, models


def populate_brand_tokens(apps, schema_editor):
    StyleSettings = apps.get_model("coyote", "StyleSettings")

    for settings in StyleSettings.objects.all():
        settings.accent = settings.gray_900
        settings.text_color = settings.body_color
        settings.surface_background = settings.gray_200
        settings.header_text = settings.body_color
        settings.footer_text = settings.body_color
        settings.button_background = settings.primary
        settings.button_text = settings.body_background
        settings.button_hover_background = settings.secondary
        settings.button_hover_text = settings.body_background
        settings.muted_text_color = "#6c757d"
        settings.border_color = "#dee2e6"
        settings.save(
            update_fields=[
                "accent",
                "text_color",
                "surface_background",
                "header_text",
                "footer_text",
                "button_background",
                "button_text",
                "button_hover_background",
                "button_hover_text",
                "muted_text_color",
                "border_color",
            ]
        )


class Migration(migrations.Migration):

    dependencies = [
        ('coyote', '0026_alter_coyotecontactpage_content_and_more'),
    ]

    operations = [
        migrations.AddField(
            model_name='stylesettings',
            name='accent',
            field=models.CharField(default='#212529', max_length=7),
        ),
        migrations.AddField(
            model_name='stylesettings',
            name='border_color',
            field=models.CharField(default='#dee2e6', max_length=7),
        ),
        migrations.AddField(
            model_name='stylesettings',
            name='button_background',
            field=models.CharField(default='#4B9E52', max_length=7),
        ),
        migrations.AddField(
            model_name='stylesettings',
            name='button_hover_background',
            field=models.CharField(default='#6c757d', max_length=7),
        ),
        migrations.AddField(
            model_name='stylesettings',
            name='button_hover_text',
            field=models.CharField(default='#ffffff', max_length=7),
        ),
        migrations.AddField(
            model_name='stylesettings',
            name='button_text',
            field=models.CharField(default='#ffffff', max_length=7),
        ),
        migrations.AddField(
            model_name='stylesettings',
            name='footer_text',
            field=models.CharField(default='#212529', max_length=7),
        ),
        migrations.AddField(
            model_name='stylesettings',
            name='header_text',
            field=models.CharField(default='#212529', max_length=7),
        ),
        migrations.AddField(
            model_name='stylesettings',
            name='muted_text_color',
            field=models.CharField(default='#6c757d', max_length=7),
        ),
        migrations.AddField(
            model_name='stylesettings',
            name='surface_background',
            field=models.CharField(default='#e9ecef', max_length=7),
        ),
        migrations.AddField(
            model_name='stylesettings',
            name='text_color',
            field=models.CharField(default='#212529', max_length=7),
        ),
        migrations.RunPython(
            populate_brand_tokens,
            migrations.RunPython.noop,
        ),
    ]
