// 
//  SelfieCamTheme.swift
//  SelfieCam
//
//  Custom color theme for SelfieCam matching the app's branding.
//  Uses magenta/rose tinted surfaces with branded accent colors.
//

import SwiftUI
import Bedrock

// MARK: - SelfieCam Surface Colors

/// Surface colors with a subtle rose/magenta tint to match app branding.
/// Provides more visual separation than neutral grays.
public enum SelfieCamSurfaceColors: SurfaceColorProvider {
    /// Primary background - deep rose-tinted dark
    public static let primary = Color("Surface/primary")
    
    /// Secondary/elevated surface - slightly lighter with rose tint
    public static let secondary = Color("Surface/secondary")
    
    /// Tertiary/card surface - more elevated
    public static let tertiary = Color("Surface/tertiary")
    
    /// Overlay background (for sheets/modals) - deep with subtle rose
    public static let overlay = Color("Surface/overlay")
    
    /// Card/grouped element background - distinct from primary
    public static let card = Color("Surface/card")
    
    /// Subtle fill for grouped content sections
    public static let groupedFill = Color("Surface/groupedFill")
    
    /// Section fill for list sections - slightly more visible
    public static let sectionFill = Color("Surface/sectionFill")
}

// MARK: - SelfieCam Text Colors

/// Text colors optimized for rose-tinted dark backgrounds.
public enum SelfieCamTextColors: TextColorProvider {
    public static let primary = Color("Text/primary")
    public static let secondary = Color("Text/secondary")
    public static let tertiary = Color("Text/tertiary")
    public static let disabled = Color("Text/disabled")
    public static let placeholder = Color("Text/placeholder")
    public static let inverse = Color("Text/inverse")
}

// MARK: - SelfieCam Accent Colors

/// Accent colors derived from the app's branding magenta/rose.
public enum SelfieCamAccentColors: AccentColorProvider {
    /// Primary accent - bright magenta/rose from branding
    public static let primary = Color("Accent/primary")
    
    /// Light variant - softer pink
    public static let light = Color("Accent/light")
    
    /// Dark variant - deeper magenta
    public static let dark = Color("Accent/dark")
    
    /// Secondary accent - soft cream/warm white for contrast
    public static let secondary = Color("Accent/secondary")
}

// MARK: - SelfieCam Button Colors

/// Button colors matching the branded theme.
public enum SelfieCamButtonColors: ButtonColorProvider {
    public static let primaryLight = Color("Button/primaryLight")
    public static let primaryDark = Color("Button/primaryDark")
    public static let secondary = Color("Button/secondary")
    public static let destructive = Color("Button/destructive")
    public static let cancelText = Color("Button/cancelText")
}

// MARK: - SelfieCam Status Colors

/// Standard semantic status colors.
public enum SelfieCamStatusColors: StatusColorProvider {
    public static let success = Color("Status/success")
    public static let warning = Color("Status/warning")
    public static let error = Color("Status/error")
    public static let info = Color("Status/info")
}

// MARK: - SelfieCam Border Colors

/// Border colors for the rose-tinted theme.
public enum SelfieCamBorderColors: BorderColorProvider {
    public static let subtle = Color("Border/subtle")
    public static let standard = Color("Border/standard")
    public static let emphasized = Color("Border/emphasized")
    public static let selected = Color("Border/selected")
}

// MARK: - SelfieCam Interactive Colors

/// Interactive state colors for the theme.
public enum SelfieCamInteractiveColors: InteractiveColorProvider {
    public static let selected = Color("Interactive/selected")
    public static let hover = Color("Interactive/hover")
    public static let pressed = Color("Interactive/pressed")
    public static let focus = Color("Interactive/focus")
}

// MARK: - SelfieCam Theme

/// The complete SelfieCam color theme.
///
/// Use this theme for consistent branded colors throughout the app:
/// ```swift
/// .background(SelfieCamTheme.Surface.primary)
/// .foregroundStyle(SelfieCamTheme.Accent.primary)
/// ```
public enum SelfieCamTheme: AppColorTheme {
    public typealias Surface = SelfieCamSurfaceColors
    public typealias Text = SelfieCamTextColors
    public typealias Accent = SelfieCamAccentColors
    public typealias Button = SelfieCamButtonColors
    public typealias Status = SelfieCamStatusColors
    public typealias Border = SelfieCamBorderColors
    public typealias Interactive = SelfieCamInteractiveColors
}

// MARK: - Convenience Typealiases

/// Short typealiases for cleaner usage throughout the app.
/// These avoid conflicts with Bedrock's default typealiases by using unique names.
///
/// Usage:
/// ```swift
/// .background(AppSurface.primary)
/// .foregroundStyle(AppAccent.primary)
/// ```
typealias AppSurface = SelfieCamSurfaceColors
typealias AppTextColors = SelfieCamTextColors
typealias AppAccent = SelfieCamAccentColors
typealias AppButtonColors = SelfieCamButtonColors
typealias AppStatus = SelfieCamStatusColors
typealias AppBorder = SelfieCamBorderColors
typealias AppInteractive = SelfieCamInteractiveColors
