//
//  NoiseClockTheme.swift
//  TheNoiseClock
//
//  Created by Matt Bruce on 1/31/26.
//

import SwiftUI
import Bedrock

// MARK: - NoiseClock Surface Colors

public enum NoiseClockSurfaceColors: SurfaceColorProvider {
    public static let primary = Color(red: 0.06, green: 0.08, blue: 0.12)
    public static let secondary = Color(red: 0.09, green: 0.11, blue: 0.18)
    public static let tertiary = Color(red: 0.12, green: 0.15, blue: 0.22)
    public static let overlay = Color(red: 0.08, green: 0.10, blue: 0.16)
    public static let card = Color(red: 0.10, green: 0.13, blue: 0.20)
    public static let groupedFill = Color(red: 0.09, green: 0.12, blue: 0.18)
    public static let sectionFill = Color(red: 0.12, green: 0.16, blue: 0.24)
}

// MARK: - NoiseClock Text Colors

public enum NoiseClockTextColors: 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: - NoiseClock Accent Colors

public enum NoiseClockAccentColors: AccentColorProvider {
    public static let primary = Color(red: 0.45, green: 0.75, blue: 1.00)
    public static let light = Color(red: 0.65, green: 0.85, blue: 1.00)
    public static let dark = Color(red: 0.25, green: 0.55, blue: 0.90)
    public static let secondary = Color(red: 0.90, green: 0.95, blue: 1.00)
}

// MARK: - NoiseClock Button Colors

public enum NoiseClockButtonColors: ButtonColorProvider {
    public static let primaryLight = Color(red: 0.55, green: 0.80, blue: 1.00)
    public static let primaryDark = Color(red: 0.20, green: 0.50, blue: 0.85)
    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: - NoiseClock Status Colors

public enum NoiseClockStatusColors: StatusColorProvider {
    public static let success = Color(red: 0.20, green: 0.80, blue: 0.45)
    public static let warning = Color(red: 1.00, green: 0.75, blue: 0.20)
    public static let error = Color(red: 0.90, green: 0.30, blue: 0.30)
    public static let info = Color(red: 0.50, green: 0.70, blue: 0.95)
}

// MARK: - NoiseClock Border Colors

public enum NoiseClockBorderColors: 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 = NoiseClockAccentColors.primary.opacity(Design.Opacity.medium)
}

// MARK: - NoiseClock Interactive Colors

public enum NoiseClockInteractiveColors: InteractiveColorProvider {
    public static let selected = NoiseClockAccentColors.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 = NoiseClockAccentColors.light
}

// MARK: - NoiseClock Theme

public enum NoiseClockTheme: AppColorTheme {
    public typealias Surface = NoiseClockSurfaceColors
    public typealias Text = NoiseClockTextColors
    public typealias Accent = NoiseClockAccentColors
    public typealias Button = NoiseClockButtonColors
    public typealias Status = NoiseClockStatusColors
    public typealias Border = NoiseClockBorderColors
    public typealias Interactive = NoiseClockInteractiveColors
}

// MARK: - Convenience Typealiases

typealias AppSurface = NoiseClockSurfaceColors
typealias AppTextColors = NoiseClockTextColors
typealias AppAccent = NoiseClockAccentColors
typealias AppButtonColors = NoiseClockButtonColors
typealias AppStatus = NoiseClockStatusColors
typealias AppBorder = NoiseClockBorderColors
typealias AppInteractive = NoiseClockInteractiveColors
