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

// Sunset orange/amber palette, seed color #E65100. Ported from BlueMusic.
object SdmSeColorsSunset {

    val LightDefault = lightColorScheme(
        primary = Color(0xFFE65100),
        onPrimary = Color(0xFFFFFFFF),
        primaryContainer = Color(0xFFFFE0B2),
        onPrimaryContainer = Color(0xFF331900),
        inversePrimary = Color(0xFFFFB74D),
        secondary = Color(0xFF575E71),
        onSecondary = Color(0xFFFFFFFF),
        secondaryContainer = Color(0xFFDBE1F9),
        onSecondaryContainer = Color(0xFF14172B),
        tertiary = Color(0xFF1565C0),
        onTertiary = Color(0xFFFFFFFF),
        tertiaryContainer = Color(0xFFE3F2FD),
        onTertiaryContainer = Color(0xFF0D47A1),
        background = Color(0xFFFAF9FF),
        onBackground = Color(0xFF1A1B20),
        surface = Color(0xFFFAF9FF),
        onSurface = Color(0xFF1A1B20),
        surfaceVariant = Color(0xFFE1E2EC),
        onSurfaceVariant = Color(0xFF44474F),
        surfaceTint = Color(0xFFE65100),
        inverseSurface = Color(0xFF2F3035),
        inverseOnSurface = Color(0xFFF1F0F7),
        error = Color(0xFFBA1A1A),
        onError = Color(0xFFFFFFFF),
        errorContainer = Color(0xFFFFDAD6),
        onErrorContainer = Color(0xFF93000A),
        outline = Color(0xFF757780),
        outlineVariant = Color(0xFFC5C6D0),
        scrim = Color(0xFF000000),
        surfaceBright = Color(0xFFFAF9FF),
        surfaceContainer = Color(0xFFEEEDF4),
        surfaceContainerHigh = Color(0xFFE8E7EE),
        surfaceContainerHighest = Color(0xFFE2E2E9),
        surfaceContainerLow = Color(0xFFF4F3FA),
        surfaceContainerLowest = Color(0xFFFFFFFF),
        surfaceDim = Color(0xFFDAD9E0),
    )

    val DarkDefault = darkColorScheme(
        primary = Color(0xFFFFB74D),
        onPrimary = Color(0xFF522700),
        primaryContainer = Color(0xFF743C00),
        onPrimaryContainer = Color(0xFFFFE0B2),
        inversePrimary = Color(0xFFE65100),
        secondary = Color(0xFFBFC5DC),
        onSecondary = Color(0xFF282D40),
        secondaryContainer = Color(0xFF3F4557),
        onSecondaryContainer = Color(0xFFDBE1F9),
        tertiary = Color(0xFF90CAF9),
        onTertiary = Color(0xFF0D47A1),
        tertiaryContainer = Color(0xFF1976D2),
        onTertiaryContainer = Color(0xFFE3F2FD),
        background = Color(0xFF1A1B20),
        onBackground = Color(0xFFE2E2E9),
        surface = Color(0xFF1A1B20),
        onSurface = Color(0xFFE2E2E9),
        surfaceVariant = Color(0xFF44474F),
        onSurfaceVariant = Color(0xFFC5C6D0),
        surfaceTint = Color(0xFFFFB74D),
        inverseSurface = Color(0xFFE2E2E9),
        inverseOnSurface = Color(0xFF2F3035),
        error = Color(0xFFFFB4AB),
        onError = Color(0xFF690005),
        errorContainer = Color(0xFF93000A),
        onErrorContainer = Color(0xFFFFDAD6),
        outline = Color(0xFF8F9099),
        outlineVariant = Color(0xFF44474F),
        scrim = Color(0xFF000000),
        surfaceBright = Color(0xFF373A3F),
        surfaceContainer = Color(0xFF1E2024),
        surfaceContainerHigh = Color(0xFF282A2F),
        surfaceContainerHighest = Color(0xFF33353A),
        surfaceContainerLow = Color(0xFF1A1B20),
        surfaceContainerLowest = Color(0xFF0E0F14),
        surfaceDim = Color(0xFF1A1B20),
    )

    val LightMediumContrast = lightColorScheme(
        primary = Color(0xFFBF360C),
        onPrimary = Color(0xFFFFFFFF),
        // Darkened from BlueMusic's #FF8A50 so white text actually clears WCAG AA.
        primaryContainer = Color(0xFFA12C09),
        onPrimaryContainer = Color(0xFFFFFFFF),
        inversePrimary = Color(0xFFFFB74D),
        secondary = Color(0xFF3B4255),
        onSecondary = Color(0xFFFFFFFF),
        secondaryContainer = Color(0xFF6D7487),
        onSecondaryContainer = Color(0xFFFFFFFF),
        tertiary = Color(0xFF0D47A1),
        onTertiary = Color(0xFFFFFFFF),
        tertiaryContainer = Color(0xFF1976D2),
        onTertiaryContainer = Color(0xFFFFFFFF),
        background = Color(0xFFFAF9FF),
        onBackground = Color(0xFF1A1B20),
        surface = Color(0xFFFAF9FF),
        onSurface = Color(0xFF1A1B20),
        surfaceVariant = Color(0xFFE1E2EC),
        onSurfaceVariant = Color(0xFF40434B),
        surfaceTint = Color(0xFFBF360C),
        inverseSurface = Color(0xFF2F3035),
        inverseOnSurface = Color(0xFFF1F0F7),
        error = Color(0xFF8C0009),
        onError = Color(0xFFFFFFFF),
        errorContainer = Color(0xFFDA342E),
        onErrorContainer = Color(0xFFFFFFFF),
        outline = Color(0xFF5C5F67),
        outlineVariant = Color(0xFF787B83),
        scrim = Color(0xFF000000),
        surfaceBright = Color(0xFFFAF9FF),
        surfaceContainer = Color(0xFFEEEDF4),
        surfaceContainerHigh = Color(0xFFE8E7EE),
        surfaceContainerHighest = Color(0xFFE2E2E9),
        surfaceContainerLow = Color(0xFFF4F3FA),
        surfaceContainerLowest = Color(0xFFFFFFFF),
        surfaceDim = Color(0xFFDAD9E0),
    )

    val DarkMediumContrast = darkColorScheme(
        primary = Color(0xFFFFCC80),
        onPrimary = Color(0xFF4A2000),
        primaryContainer = Color(0xFFC67C00),
        onPrimaryContainer = Color(0xFF000000),
        inversePrimary = Color(0xFF304575),
        secondary = Color(0xFFC3C9E0),
        onSecondary = Color(0xFF0D1225),
        secondaryContainer = Color(0xFF8A90A5),
        onSecondaryContainer = Color(0xFF000000),
        tertiary = Color(0xFFBBDEFB),
        onTertiary = Color(0xFF002171),
        tertiaryContainer = Color(0xFF42A5F5),
        onTertiaryContainer = Color(0xFF000000),
        background = Color(0xFF1A1B20),
        onBackground = Color(0xFFE2E2E9),
        surface = Color(0xFF1A1B20),
        onSurface = Color(0xFFFBFAFF),
        surfaceVariant = Color(0xFF44474F),
        onSurfaceVariant = Color(0xFFC9CAD4),
        surfaceTint = Color(0xFFFFCC80),
        inverseSurface = Color(0xFFE2E2E9),
        inverseOnSurface = Color(0xFF282A2F),
        error = Color(0xFFFFBAB1),
        onError = Color(0xFF370001),
        errorContainer = Color(0xFFFF5449),
        onErrorContainer = Color(0xFF000000),
        outline = Color(0xFFA1A2AC),
        outlineVariant = Color(0xFF81828C),
        scrim = Color(0xFF000000),
        surfaceBright = Color(0xFF373A3F),
        surfaceContainer = Color(0xFF1E2024),
        surfaceContainerHigh = Color(0xFF282A2F),
        surfaceContainerHighest = Color(0xFF33353A),
        surfaceContainerLow = Color(0xFF1A1B20),
        surfaceContainerLowest = Color(0xFF0E0F14),
        surfaceDim = Color(0xFF1A1B20),
    )

    val LightHighContrast = lightColorScheme(
        primary = Color(0xFF4E2E00),
        onPrimary = Color(0xFFFFFFFF),
        primaryContainer = Color(0xFFBF360C),
        onPrimaryContainer = Color(0xFFFFFFFF),
        inversePrimary = Color(0xFFFFF3E0),
        secondary = Color(0xFF1A2033),
        onSecondary = Color(0xFFFFFFFF),
        secondaryContainer = Color(0xFF3B4255),
        onSecondaryContainer = Color(0xFFFFFFFF),
        tertiary = Color(0xFF002171),
        onTertiary = Color(0xFFFFFFFF),
        tertiaryContainer = Color(0xFF0D47A1),
        onTertiaryContainer = Color(0xFFFFFFFF),
        background = Color(0xFFFAF9FF),
        onBackground = Color(0xFF1A1B20),
        surface = Color(0xFFFAF9FF),
        onSurface = Color(0xFF000000),
        surfaceVariant = Color(0xFFE1E2EC),
        onSurfaceVariant = Color(0xFF21242C),
        surfaceTint = Color(0xFF4E2E00),
        inverseSurface = Color(0xFF2F3035),
        inverseOnSurface = Color(0xFFFFFFFF),
        error = Color(0xFF4E0002),
        onError = Color(0xFFFFFFFF),
        errorContainer = Color(0xFF8C0009),
        onErrorContainer = Color(0xFFFFFFFF),
        outline = Color(0xFF40434B),
        outlineVariant = Color(0xFF40434B),
        scrim = Color(0xFF000000),
        surfaceBright = Color(0xFFFAF9FF),
        surfaceContainer = Color(0xFFEEEDF4),
        surfaceContainerHigh = Color(0xFFE8E7EE),
        surfaceContainerHighest = Color(0xFFE2E2E9),
        surfaceContainerLow = Color(0xFFF4F3FA),
        surfaceContainerLowest = Color(0xFFFFFFFF),
        surfaceDim = Color(0xFFDAD9E0),
    )

    val DarkHighContrast = darkColorScheme(
        primary = Color(0xFFFFF8F5),
        onPrimary = Color(0xFF000000),
        primaryContainer = Color(0xFFFFCC80),
        onPrimaryContainer = Color(0xFF000000),
        inversePrimary = Color(0xFF482100),
        secondary = Color(0xFFF9FAFF),
        onSecondary = Color(0xFF000000),
        secondaryContainer = Color(0xFFC3C9E0),
        onSecondaryContainer = Color(0xFF000000),
        tertiary = Color(0xFFF8FDFF),
        onTertiary = Color(0xFF000000),
        tertiaryContainer = Color(0xFFBBDEFB),
        onTertiaryContainer = Color(0xFF000000),
        background = Color(0xFF1A1B20),
        onBackground = Color(0xFFE2E2E9),
        surface = Color(0xFF1A1B20),
        onSurface = Color(0xFFFFFFFF),
        surfaceVariant = Color(0xFF44474F),
        onSurfaceVariant = Color(0xFFFAFAFF),
        surfaceTint = Color(0xFFFFF8F5),
        inverseSurface = Color(0xFFE2E2E9),
        inverseOnSurface = Color(0xFF000000),
        error = Color(0xFFFFF9F9),
        onError = Color(0xFF000000),
        errorContainer = Color(0xFFFFBAB1),
        onErrorContainer = Color(0xFF000000),
        outline = Color(0xFFC9CAD4),
        outlineVariant = Color(0xFFC9CAD4),
        scrim = Color(0xFF000000),
        surfaceBright = Color(0xFF373A3F),
        surfaceContainer = Color(0xFF1E2024),
        surfaceContainerHigh = Color(0xFF282A2F),
        surfaceContainerHighest = Color(0xFF33353A),
        surfaceContainerLow = Color(0xFF1A1B20),
        surfaceContainerLowest = Color(0xFF0E0F14),
        surfaceDim = Color(0xFF1A1B20),
    )

    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
    }
}
