package eu.darken.sdmse.common.theming

import androidx.compose.material3.ColorScheme
import androidx.compose.material3.darkColorScheme
import androidx.compose.material3.lightColorScheme
import androidx.compose.ui.graphics.Color

// AMOLED palette: pure-black dark backgrounds for OLED battery savings, with a teal
// primary + magenta tertiary so it doesn't overlap visually with Sunset.
object SdmSeColorsAmoled {

    val LightDefault = lightColorScheme(
        primary = Color(0xFF00695C),
        onPrimary = Color(0xFFFFFFFF),
        primaryContainer = Color(0xFFB2DFDB),
        onPrimaryContainer = Color(0xFF00231F),
        inversePrimary = Color(0xFF80CBC4),
        secondary = Color(0xFF455A64),
        onSecondary = Color(0xFFFFFFFF),
        secondaryContainer = Color(0xFFCFD8DC),
        onSecondaryContainer = Color(0xFF1B2227),
        tertiary = Color(0xFFAD1457),
        onTertiary = Color(0xFFFFFFFF),
        tertiaryContainer = Color(0xFFF8BBD0),
        onTertiaryContainer = Color(0xFF3E0021),
        background = Color(0xFFFFFFFF),
        onBackground = Color(0xFF111111),
        surface = Color(0xFFFFFFFF),
        onSurface = Color(0xFF111111),
        surfaceVariant = Color(0xFFE0E0E0),
        onSurfaceVariant = Color(0xFF424242),
        surfaceTint = Color(0xFF00695C),
        inverseSurface = Color(0xFF1A1A1A),
        inverseOnSurface = Color(0xFFF5F5F5),
        error = Color(0xFFBA1A1A),
        onError = Color(0xFFFFFFFF),
        errorContainer = Color(0xFFFFDAD6),
        onErrorContainer = Color(0xFF93000A),
        outline = Color(0xFF757575),
        outlineVariant = Color(0xFFBDBDBD),
        scrim = Color(0xFF000000),
        surfaceDim = Color(0xFFD6D6D6),
        surfaceBright = Color(0xFFFFFFFF),
        surfaceContainerLowest = Color(0xFFFFFFFF),
        surfaceContainerLow = Color(0xFFF7F7F7),
        surfaceContainer = Color(0xFFF1F1F1),
        surfaceContainerHigh = Color(0xFFEBEBEB),
        surfaceContainerHighest = Color(0xFFE6E6E6),
    )

    val DarkDefault = darkColorScheme(
        primary = Color(0xFF80CBC4),
        onPrimary = Color(0xFF00332C),
        primaryContainer = Color(0xFF004D40),
        onPrimaryContainer = Color(0xFFB2DFDB),
        inversePrimary = Color(0xFF00695C),
        secondary = Color(0xFFB0BEC5),
        onSecondary = Color(0xFF1B2227),
        secondaryContainer = Color(0xFF37474F),
        onSecondaryContainer = Color(0xFFCFD8DC),
        tertiary = Color(0xFFF48FB1),
        onTertiary = Color(0xFF4A0030),
        tertiaryContainer = Color(0xFF880E4F),
        onTertiaryContainer = Color(0xFFF8BBD0),
        background = Color(0xFF000000),
        onBackground = Color(0xFFE6E6E6),
        surface = Color(0xFF000000),
        onSurface = Color(0xFFE6E6E6),
        surfaceVariant = Color(0xFF2A2A2A),
        onSurfaceVariant = Color(0xFFBDBDBD),
        surfaceTint = Color(0xFF80CBC4),
        inverseSurface = Color(0xFFE6E6E6),
        inverseOnSurface = Color(0xFF1A1A1A),
        error = Color(0xFFFFB4AB),
        onError = Color(0xFF690005),
        errorContainer = Color(0xFF93000A),
        onErrorContainer = Color(0xFFFFDAD6),
        outline = Color(0xFF9E9E9E),
        outlineVariant = Color(0xFF424242),
        scrim = Color(0xFF000000),
        surfaceDim = Color(0xFF000000),
        surfaceBright = Color(0xFF2A2A2A),
        surfaceContainerLowest = Color(0xFF000000),
        surfaceContainerLow = Color(0xFF0A0A0A),
        surfaceContainer = Color(0xFF121212),
        surfaceContainerHigh = Color(0xFF1A1A1A),
        surfaceContainerHighest = Color(0xFF222222),
    )

    val LightMediumContrast = lightColorScheme(
        primary = Color(0xFF004B43),
        onPrimary = Color(0xFFFFFFFF),
        primaryContainer = Color(0xFF1F8275),
        onPrimaryContainer = Color(0xFFFFFFFF),
        inversePrimary = Color(0xFF80CBC4),
        secondary = Color(0xFF2A3941),
        onSecondary = Color(0xFFFFFFFF),
        secondaryContainer = Color(0xFF5C6E78),
        onSecondaryContainer = Color(0xFFFFFFFF),
        tertiary = Color(0xFF7E003D),
        onTertiary = Color(0xFFFFFFFF),
        tertiaryContainer = Color(0xFFC83476),
        onTertiaryContainer = Color(0xFFFFFFFF),
        background = Color(0xFFFFFFFF),
        onBackground = Color(0xFF111111),
        surface = Color(0xFFFFFFFF),
        onSurface = Color(0xFF0A0A0A),
        surfaceVariant = Color(0xFFE0E0E0),
        onSurfaceVariant = Color(0xFF2E2E2E),
        surfaceTint = Color(0xFF004B43),
        inverseSurface = Color(0xFF1A1A1A),
        inverseOnSurface = Color(0xFFF5F5F5),
        error = Color(0xFF740006),
        onError = Color(0xFFFFFFFF),
        errorContainer = Color(0xFFCF2C27),
        onErrorContainer = Color(0xFFFFFFFF),
        outline = Color(0xFF505050),
        outlineVariant = Color(0xFF6E6E6E),
        scrim = Color(0xFF000000),
        surfaceDim = Color(0xFFD6D6D6),
        surfaceBright = Color(0xFFFFFFFF),
        surfaceContainerLowest = Color(0xFFFFFFFF),
        surfaceContainerLow = Color(0xFFF7F7F7),
        surfaceContainer = Color(0xFFF1F1F1),
        surfaceContainerHigh = Color(0xFFEBEBEB),
        surfaceContainerHighest = Color(0xFFE6E6E6),
    )

    val DarkMediumContrast = darkColorScheme(
        primary = Color(0xFF9CE5DD),
        onPrimary = Color(0xFF002420),
        primaryContainer = Color(0xFF4A988E),
        onPrimaryContainer = Color(0xFF000000),
        inversePrimary = Color(0xFF003D36),
        secondary = Color(0xFFC7D5DC),
        onSecondary = Color(0xFF101820),
        secondaryContainer = Color(0xFF7C8990),
        onSecondaryContainer = Color(0xFF000000),
        tertiary = Color(0xFFFFB3C9),
        onTertiary = Color(0xFF330020),
        tertiaryContainer = Color(0xFFB55780),
        onTertiaryContainer = Color(0xFF000000),
        background = Color(0xFF000000),
        onBackground = Color(0xFFE6E6E6),
        surface = Color(0xFF000000),
        onSurface = Color(0xFFFFFFFF),
        surfaceVariant = Color(0xFF2A2A2A),
        onSurfaceVariant = Color(0xFFD5D5D5),
        surfaceTint = Color(0xFF9CE5DD),
        inverseSurface = Color(0xFFE6E6E6),
        inverseOnSurface = Color(0xFF1A1A1A),
        error = Color(0xFFFFD2CC),
        onError = Color(0xFF540003),
        errorContainer = Color(0xFFFF5449),
        onErrorContainer = Color(0xFF000000),
        outline = Color(0xFFB5B5B5),
        outlineVariant = Color(0xFF888888),
        scrim = Color(0xFF000000),
        surfaceDim = Color(0xFF000000),
        surfaceBright = Color(0xFF2A2A2A),
        surfaceContainerLowest = Color(0xFF000000),
        surfaceContainerLow = Color(0xFF0A0A0A),
        surfaceContainer = Color(0xFF121212),
        surfaceContainerHigh = Color(0xFF1A1A1A),
        surfaceContainerHighest = Color(0xFF222222),
    )

    val LightHighContrast = lightColorScheme(
        primary = Color(0xFF002923),
        onPrimary = Color(0xFFFFFFFF),
        primaryContainer = Color(0xFF004B43),
        onPrimaryContainer = Color(0xFFFFFFFF),
        inversePrimary = Color(0xFFB6F0E8),
        secondary = Color(0xFF11181E),
        onSecondary = Color(0xFFFFFFFF),
        secondaryContainer = Color(0xFF2A3941),
        onSecondaryContainer = Color(0xFFFFFFFF),
        tertiary = Color(0xFF55002A),
        onTertiary = Color(0xFFFFFFFF),
        tertiaryContainer = Color(0xFF7E003D),
        onTertiaryContainer = Color(0xFFFFFFFF),
        background = Color(0xFFFFFFFF),
        onBackground = Color(0xFF111111),
        surface = Color(0xFFFFFFFF),
        onSurface = Color(0xFF000000),
        surfaceVariant = Color(0xFFE0E0E0),
        onSurfaceVariant = Color(0xFF000000),
        surfaceTint = Color(0xFF002923),
        inverseSurface = Color(0xFF1A1A1A),
        inverseOnSurface = Color(0xFFFFFFFF),
        error = Color(0xFF600004),
        onError = Color(0xFFFFFFFF),
        errorContainer = Color(0xFF98000A),
        onErrorContainer = Color(0xFFFFFFFF),
        outline = Color(0xFF1F1F1F),
        outlineVariant = Color(0xFF3A3A3A),
        scrim = Color(0xFF000000),
        surfaceDim = Color(0xFFD6D6D6),
        surfaceBright = Color(0xFFFFFFFF),
        surfaceContainerLowest = Color(0xFFFFFFFF),
        surfaceContainerLow = Color(0xFFF7F7F7),
        surfaceContainer = Color(0xFFF1F1F1),
        surfaceContainerHigh = Color(0xFFEBEBEB),
        surfaceContainerHighest = Color(0xFFE6E6E6),
    )

    val DarkHighContrast = darkColorScheme(
        primary = Color(0xFFD6FBF5),
        onPrimary = Color(0xFF000000),
        primaryContainer = Color(0xFF9CE5DD),
        onPrimaryContainer = Color(0xFF000000),
        inversePrimary = Color(0xFF002923),
        secondary = Color(0xFFEFF4F7),
        onSecondary = Color(0xFF000000),
        secondaryContainer = Color(0xFFC7D5DC),
        onSecondaryContainer = Color(0xFF000000),
        tertiary = Color(0xFFFFE6EE),
        onTertiary = Color(0xFF000000),
        tertiaryContainer = Color(0xFFFFB3C9),
        onTertiaryContainer = Color(0xFF000000),
        background = Color(0xFF000000),
        onBackground = Color(0xFFE6E6E6),
        surface = Color(0xFF000000),
        onSurface = Color(0xFFFFFFFF),
        surfaceVariant = Color(0xFF2A2A2A),
        onSurfaceVariant = Color(0xFFFFFFFF),
        surfaceTint = Color(0xFFD6FBF5),
        inverseSurface = Color(0xFFE6E6E6),
        inverseOnSurface = Color(0xFF000000),
        error = Color(0xFFFFECE9),
        onError = Color(0xFF000000),
        errorContainer = Color(0xFFFFAEA4),
        onErrorContainer = Color(0xFF220001),
        outline = Color(0xFFE6E6E6),
        outlineVariant = Color(0xFFBDBDBD),
        scrim = Color(0xFF000000),
        surfaceDim = Color(0xFF000000),
        surfaceBright = Color(0xFF2A2A2A),
        surfaceContainerLowest = Color(0xFF000000),
        surfaceContainerLow = Color(0xFF0A0A0A),
        surfaceContainer = Color(0xFF121212),
        surfaceContainerHigh = Color(0xFF1A1A1A),
        surfaceContainerHighest = Color(0xFF222222),
    )

    fun lightScheme(style: ThemeStyle): ColorScheme = when (style) {
        ThemeStyle.MEDIUM_CONTRAST -> LightMediumContrast
        ThemeStyle.HIGH_CONTRAST -> LightHighContrast
        else -> LightDefault
    }

    fun darkScheme(style: ThemeStyle): ColorScheme = when (style) {
        ThemeStyle.MEDIUM_CONTRAST -> DarkMediumContrast
        ThemeStyle.HIGH_CONTRAST -> DarkHighContrast
        else -> DarkDefault
    }
}
