//
//  DesignConstants.swift
//  BusinessCard
//
//  App-specific design extensions to Bedrock's Design system.
//

import SwiftUI
import Bedrock

// MARK: - App-Specific Sizes

extension Design {
    /// BusinessCard-specific size constants.
    enum CardSize {
        static let cardWidth: CGFloat = 320
        static let cardHeight: CGFloat = 340
        static let cardHeightCompact: CGFloat = 200
        static let avatarSize: CGFloat = 56
        static let avatarLarge: CGFloat = 80
        static let avatarOverlap: CGFloat = 40
        static let logoSize: CGFloat = 64
        static let bannerHeight: CGFloat = 140
        static let qrSize: CGFloat = 200
        static let qrSizeLarge: CGFloat = 260
        static let colorSwatchSize: CGFloat = 40
        static let socialIconSize: CGFloat = 32
        static let widgetPhoneWidth: CGFloat = 220
        static let widgetPhoneHeight: CGFloat = 120
        static let widgetWatchSize: CGFloat = 100
        static let floatingButtonSize: CGFloat = 56
        /// Bottom offset for floating button above tab bar.
        static let floatingButtonBottomOffset: CGFloat = 72
        /// Aspect ratio for logo container (3:2 landscape).
        static let logoContainerAspectRatio: CGFloat = 3.0 / 2.0
    }
}

// MARK: - Shadow Extensions

extension Design.Shadow {
    /// Zero offset for centered shadows.
    static let offsetNone: CGFloat = 0
}

// MARK: - App Color Theme

/// BusinessCard's light theme color palette.
/// Uses warm, professional tones suitable for a business card app.
extension Color {
    
    // MARK: - App Backgrounds (Light Theme)
    
    enum AppBackground {
        static let base = Color(red: 0.97, green: 0.96, blue: 0.94)
        static let secondary = Color(red: 0.95, green: 0.95, blue: 0.95)
        static let elevated = Color(red: 1.0, green: 1.0, blue: 1.0)
        static let card = Color(red: 1.0, green: 1.0, blue: 1.0)
        static let accent = Color(red: 0.95, green: 0.91, blue: 0.86)
    }
    
    // MARK: - Card Theme Palette
    
    enum CardPalette {
        static let coral = Color(red: 0.95, green: 0.35, blue: 0.33)
        static let midnight = Color(red: 0.12, green: 0.16, blue: 0.22)
        static let ocean = Color(red: 0.08, green: 0.45, blue: 0.56)
        static let lime = Color(red: 0.73, green: 0.82, blue: 0.34)
        static let violet = Color(red: 0.42, green: 0.36, blue: 0.62)
        static let forest = Color(red: 0.13, green: 0.37, blue: 0.31)
        static let rose = Color(red: 0.95, green: 0.68, blue: 0.73)
        static let slate = Color(red: 0.38, green: 0.44, blue: 0.50)
        static let amber = Color(red: 0.98, green: 0.75, blue: 0.28)
        static let plum = Color(red: 0.56, green: 0.27, blue: 0.52)
        static let sand = Color(red: 0.93, green: 0.83, blue: 0.68)
    }
    
    // MARK: - App Accent Colors
    
    enum AppAccent {
        static let red = Color(red: 0.95, green: 0.33, blue: 0.28)
        static let gold = Color(red: 0.95, green: 0.75, blue: 0.25)
        static let mint = Color(red: 0.2, green: 0.65, blue: 0.55)
        static let ink = Color(red: 0.12, green: 0.12, blue: 0.14)
        static let slate = Color(red: 0.29, green: 0.33, blue: 0.4)
    }
    
    // MARK: - App Text Colors (Light Theme)
    
    enum AppText {
        static let primary = Color(red: 0.14, green: 0.14, blue: 0.17)
        static let secondary = Color(red: 0.32, green: 0.34, blue: 0.4)
        static let tertiary = Color(red: 0.56, green: 0.58, blue: 0.62)
        static let inverted = Color(red: 0.98, green: 0.98, blue: 0.98)
    }
    
    // MARK: - Badge Colors
    
    enum Badge {
        static let star = Color(red: 0.98, green: 0.82, blue: 0.34)
        static let neutral = Color(red: 0.89, green: 0.89, blue: 0.9)
    }
    
    // MARK: - Share Sheet Dark Theme
    
    enum ShareSheet {
        static let background = Color(red: 0.18, green: 0.20, blue: 0.23)
        static let cardBackground = Color(red: 0.24, green: 0.26, blue: 0.30)
        static let rowBackground = Color(red: 0.30, green: 0.32, blue: 0.36)
        static let text = Color(red: 0.96, green: 0.96, blue: 0.97)
        static let secondaryText = Color(red: 0.70, green: 0.72, blue: 0.75)
    }
    
    // MARK: - Social Media Brand Colors
    
    enum Social {
        static let linkedIn = Color(red: 0.0, green: 0.47, blue: 0.71)
        static let twitter = Color(red: 0.11, green: 0.63, blue: 0.95)
        static let instagram = Color(red: 0.88, green: 0.19, blue: 0.42)
        static let facebook = Color(red: 0.26, green: 0.40, blue: 0.70)
        static let tiktok = Color(red: 0.0, green: 0.0, blue: 0.0)
        static let github = Color(red: 0.13, green: 0.13, blue: 0.13)
        static let threads = Color(red: 0.0, green: 0.0, blue: 0.0)
        static let telegram = Color(red: 0.16, green: 0.63, blue: 0.89)
        static let whatsapp = Color(red: 0.15, green: 0.68, blue: 0.38)
        static let venmo = Color(red: 0.22, green: 0.53, blue: 0.79)
        static let cashApp = Color(red: 0.0, green: 0.82, blue: 0.35)
    }
}

// MARK: - Typealiases for easier migration

// These typealiases allow existing code to continue using the old names
// while we gradually migrate to the new naming convention.

extension Color {
    /// Legacy alias - use AppAccent instead
    typealias Accent = AppAccent
    
    /// Legacy alias - use AppText instead
    typealias Text = AppText
}
