package com.a2i.forwarder.ui.theme

import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.darkColorScheme
import androidx.compose.material3.lightColorScheme
import androidx.compose.runtime.Composable
import androidx.compose.ui.graphics.Color

private val DarkColors = darkColorScheme(
    primary = Color(0xFF89B4FF),
    onPrimary = DarkBackground,
    primaryContainer = Color(0xFF163968),
    onPrimaryContainer = DarkText,
    secondary = Color(0xFF6FD3E4),
    onSecondary = DarkBackground,
    secondaryContainer = Color(0xFF123D47),
    onSecondaryContainer = DarkText,
    tertiary = Color(0xFF7BDFA8),
    error = Color(0xFFFF9EA2),
    background = DarkBackground,
    onBackground = DarkText,
    surface = DarkSurface,
    onSurface = DarkText,
    surfaceVariant = DarkSurfaceMuted,
    onSurfaceVariant = DarkTextMuted,
    outline = Color(0xFF425169),
    outlineVariant = Color(0xFF29374D),
)

private val LightColors = lightColorScheme(
    primary = BrandBlue,
    onPrimary = LightSurface,
    primaryContainer = Color(0xFFE1EAFF),
    onPrimaryContainer = LightText,
    secondary = BrandCyan,
    onSecondary = LightSurface,
    secondaryContainer = Color(0xFFDDF8FC),
    onSecondaryContainer = LightText,
    tertiary = BrandEmerald,
    error = BrandRed,
    background = LightBackground,
    onBackground = LightText,
    surface = LightSurface,
    onSurface = LightText,
    surfaceVariant = LightSurfaceMuted,
    onSurfaceVariant = LightTextMuted,
    outline = Color(0xFFCAD5E4),
    outlineVariant = Color(0xFFE0E7F1),
)

@Composable
fun A2iTheme(
    darkTheme: Boolean = isSystemInDarkTheme(),
    dynamicColor: Boolean = false,
    content: @Composable () -> Unit,
) {
    val colorScheme = if (darkTheme) DarkColors else LightColors
    MaterialTheme(
        colorScheme = colorScheme,
        typography = Typography,
        content = content,
    )
}