import SwiftUI
import Bedrock

// MARK: - Rituals Surface Colors

public enum RitualsSurfaceColors: SurfaceColorProvider {
    public static let primary = Color(red: 0.12, green: 0.09, blue: 0.08)
    public static let secondary = Color(red: 0.14, green: 0.11, blue: 0.10)
    public static let tertiary = Color(red: 0.18, green: 0.14, blue: 0.12)
    public static let overlay = Color(red: 0.12, green: 0.09, blue: 0.08)
    public static let card = Color(red: 0.16, green: 0.12, blue: 0.11)
    public static let groupedFill = Color(red: 0.13, green: 0.10, blue: 0.09)
    public static let sectionFill = Color(red: 0.18, green: 0.14, blue: 0.12)
}

// MARK: - Rituals Text Colors

public enum RitualsTextColors: TextColorProvider {
    public static let primary = Color.white
    public static let secondary = Color.white.opacity(Design.Opacity.accent)
    public static let tertiary = Color.white.opacity(Design.Opacity.medium)
    public static let disabled = Color.white.opacity(Design.Opacity.light)
    public static let placeholder = Color.white.opacity(Design.Opacity.overlay)
    public static let inverse = Color.black
}

// MARK: - Rituals Accent Colors

public enum RitualsAccentColors: AccentColorProvider {
    public static let primary = Color(red: 0.93, green: 0.55, blue: 0.40)
    public static let light = Color(red: 0.98, green: 0.70, blue: 0.55)
    public static let dark = Color(red: 0.75, green: 0.38, blue: 0.25)
    public static let secondary = Color(red: 0.95, green: 0.90, blue: 0.80)
}

// MARK: - Rituals Button Colors

public enum RitualsButtonColors: ButtonColorProvider {
    public static let primaryLight = Color(red: 0.98, green: 0.70, blue: 0.55)
    public static let primaryDark = Color(red: 0.75, green: 0.38, blue: 0.25)
    public static let secondary = Color.white.opacity(Design.Opacity.subtle)
    public static let destructive = Color.red.opacity(Design.Opacity.heavy)
    public static let cancelText = Color.white.opacity(Design.Opacity.strong)
}

// MARK: - Rituals Status Colors

public enum RitualsStatusColors: StatusColorProvider {
    public static let success = Color(red: 0.20, green: 0.75, blue: 0.55)
    public static let warning = Color(red: 0.95, green: 0.78, blue: 0.45)
    public static let error = Color(red: 0.90, green: 0.35, blue: 0.35)
    public static let info = Color(red: 0.55, green: 0.72, blue: 0.92)
}

// MARK: - Rituals Border Colors

public enum RitualsBorderColors: BorderColorProvider {
    public static let subtle = Color.white.opacity(Design.Opacity.subtle)
    public static let standard = Color.white.opacity(Design.Opacity.hint)
    public static let emphasized = Color.white.opacity(Design.Opacity.light)
    public static let selected = RitualsAccentColors.primary.opacity(Design.Opacity.medium)
}

// MARK: - Rituals Interactive Colors

public enum RitualsInteractiveColors: InteractiveColorProvider {
    public static let selected = RitualsAccentColors.primary.opacity(Design.Opacity.selection)
    public static let hover = Color.white.opacity(Design.Opacity.subtle)
    public static let pressed = Color.white.opacity(Design.Opacity.hint)
    public static let focus = RitualsAccentColors.light
}

// MARK: - Rituals Theme

public enum RitualsTheme: AppColorTheme {
    public typealias Surface = RitualsSurfaceColors
    public typealias Text = RitualsTextColors
    public typealias Accent = RitualsAccentColors
    public typealias Button = RitualsButtonColors
    public typealias Status = RitualsStatusColors
    public typealias Border = RitualsBorderColors
    public typealias Interactive = RitualsInteractiveColors
}

// MARK: - Convenience Typealiases

typealias AppSurface = RitualsSurfaceColors
typealias AppTextColors = RitualsTextColors
typealias AppAccent = RitualsAccentColors
typealias AppButtonColors = RitualsButtonColors
typealias AppStatus = RitualsStatusColors
typealias AppBorder = RitualsBorderColors
typealias AppInteractive = RitualsInteractiveColors
