package cl.homelogic.platform.designsystem.themes

import androidx.compose.material3.ColorScheme
import androidx.compose.material3.darkColorScheme
import androidx.compose.material3.lightColorScheme
import cl.homelogic.platform.designsystem.foundations.Palette

data class ColorPair(
    val light: Palette,
    val dark: Palette,
)

abstract class BaseTheme {
    abstract val primary: ColorPair
    abstract val primaryContainer: ColorPair
    abstract val onPrimary: ColorPair
    abstract val onPrimaryContainer: ColorPair
    abstract val secondary: ColorPair
    abstract val secondaryContainer: ColorPair
    abstract val tertiary: ColorPair
    abstract val tertiaryContainer: ColorPair
    abstract val onTertiary: ColorPair
    abstract val surfaceContainer: ColorPair
    abstract val error: ColorPair
    abstract val surface: ColorPair
    abstract val surfaceVariant: ColorPair
    abstract val onSurface: ColorPair
    abstract val onSurfaceVariant: ColorPair
    abstract val background: ColorPair
    abstract val outline: ColorPair

    val lightVariant: ColorScheme
        get() = lightColorScheme(
            primary = primary.light.color,
            primaryContainer = primaryContainer.light.color,
            onPrimary = onPrimary.light.color,
            onPrimaryContainer = onPrimaryContainer.light.color,
            secondary = secondary.light.color,
            secondaryContainer = secondaryContainer.light.color,
            tertiary = tertiary.light.color,
            tertiaryContainer = tertiaryContainer.light.color,
            onTertiary = onTertiary.light.color,
            surfaceContainer = surfaceContainer.light.color,
            error = error.light.color,
            surface = surface.light.color,
            surfaceVariant = surfaceVariant.light.color,
            onSurface = onSurface.light.color,
            onSurfaceVariant = onSurfaceVariant.light.color,
            background = background.light.color,
            outline = outline.light.color,
        )

    val darkVariant: ColorScheme
        get() = darkColorScheme(
            primary = primary.dark.color,
            primaryContainer = primaryContainer.dark.color,
            onPrimary = onPrimary.dark.color,
            onPrimaryContainer = onPrimaryContainer.dark.color,
            secondary = secondary.dark.color,
            secondaryContainer = secondaryContainer.dark.color,
            tertiary = tertiary.dark.color,
            tertiaryContainer = tertiaryContainer.dark.color,
            onTertiary = onTertiary.dark.color,
            surfaceContainer = surfaceContainer.dark.color,
            error = error.dark.color,
            surface = surface.dark.color,
            surfaceVariant = surfaceVariant.dark.color,
            onSurface = onSurface.dark.color,
            onSurfaceVariant = onSurfaceVariant.dark.color,
            background = background.dark.color,
            outline = outline.dark.color,
        )
}
