package com.example.godeye.ui.theme

import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.material3.*
import androidx.compose.runtime.Composable
import androidx.compose.ui.graphics.Color

// Цветовая схема GodEye
object GodEyeColors {
    val Primary = Color(0xFF1976D2)
    val PrimaryVariant = Color(0xFF1565C0)
    val Secondary = Color(0xFF03DAC6)
    val Background = Color(0xFF121212)
    val Surface = Color(0xFF1E1E1E)
    val Error = Color(0xFFCF6679)
    val OnPrimary = Color.White
    val OnSecondary = Color.Black
    val OnBackground = Color.White
    val OnSurface = Color.White
    val OnError = Color.Black

    // Статусные цвета
    val Connected = Color(0xFF4CAF50)
    val Disconnected = Color(0xFFF44336)
    val Waiting = Color(0xFFFF9800)
}

private val DarkColorScheme = darkColorScheme(
    primary = GodEyeColors.Primary,
    secondary = GodEyeColors.Secondary,
    tertiary = GodEyeColors.PrimaryVariant,
    background = GodEyeColors.Background,
    surface = GodEyeColors.Surface,
    error = GodEyeColors.Error,
    onPrimary = GodEyeColors.OnPrimary,
    onSecondary = GodEyeColors.OnSecondary,
    onTertiary = GodEyeColors.OnPrimary,
    onBackground = GodEyeColors.OnBackground,
    onSurface = GodEyeColors.OnSurface,
    onError = GodEyeColors.OnError,
)

private val LightColorScheme = lightColorScheme(
    primary = GodEyeColors.Primary,
    secondary = GodEyeColors.Secondary,
    tertiary = GodEyeColors.PrimaryVariant,
    background = Color.White,
    surface = Color(0xFFF5F5F5),
    error = Color(0xFFD32F2F),
    onPrimary = Color.White,
    onSecondary = Color.Black,
    onTertiary = Color.White,
    onBackground = Color.Black,
    onSurface = Color.Black,
    onError = Color.White,
)

@Composable
fun GodEyeTheme(
    darkTheme: Boolean = isSystemInDarkTheme(),
    content: @Composable () -> Unit
) {
    val colorScheme = if (darkTheme) {
        DarkColorScheme
    } else {
        LightColorScheme
    }

    MaterialTheme(
        colorScheme = colorScheme,
        typography = Typography(),
        content = content
    )
}
