import SwiftUI // MARK: - Theme Colors enum Theme { static let bg = Color(hex: "06060f") static let cardBg = Color.white.opacity(0.06) static let cardBorder = Color.white.opacity(0.08) static let teal = Color(hex: "0D9488") static let tealLight = Color(hex: "14b8a6") static let textPrimary = Color.white static let textSecondary = Color(hex: "6b7280") static let red = Color(hex: "ff4757") static let orange = Color(hex: "ffa502") static let purple = Color(hex: "7c3aed") static let blue = Color(hex: "3b82f6") static let pink = Color(hex: "ec4899") static let green = Color(hex: "10b981") static let indigo = Color(hex: "6366f1") } // MARK: - Glass Card Modifier struct GlassCard: ViewModifier { var cornerRadius: CGFloat = 20 func body(content: Content) -> some View { content .background( RoundedRectangle(cornerRadius: cornerRadius) .fill(.ultraThinMaterial.opacity(0.3)) .overlay( RoundedRectangle(cornerRadius: cornerRadius) .fill( LinearGradient( colors: [Color.white.opacity(0.08), Color.white.opacity(0.02)], startPoint: .topLeading, endPoint: .bottomTrailing ) ) ) .overlay( RoundedRectangle(cornerRadius: cornerRadius) .stroke( LinearGradient( colors: [Color.white.opacity(0.15), Color.white.opacity(0.03)], startPoint: .topLeading, endPoint: .bottomTrailing ), lineWidth: 1 ) ) ) } } extension View { func glassCard(cornerRadius: CGFloat = 20) -> some View { modifier(GlassCard(cornerRadius: cornerRadius)) } } // MARK: - Glow Icon View struct GlowIcon: View { let systemName: String let color: Color var size: CGFloat = 44 var iconSize: Font = .body var body: some View { ZStack { // Glow Circle() .fill(color.opacity(0.25)) .frame(width: size * 1.2, height: size * 1.2) .blur(radius: 12) // Icon circle Circle() .fill(color.opacity(0.15)) .frame(width: size, height: size) Image(systemName: systemName) .font(iconSize) .foregroundColor(color) } } } // MARK: - Glow Stat Card struct GlowStatCard: View { let icon: String let value: String let label: String let color: Color var body: some View { VStack(spacing: 10) { GlowIcon(systemName: icon, color: color, size: 40, iconSize: .title3) Text(value) .font(.title3.bold().monospacedDigit()) .foregroundColor(.white) Text(label) .font(.caption) .foregroundColor(Theme.textSecondary) .multilineTextAlignment(.center) .lineLimit(2) } .frame(maxWidth: .infinity) .padding(.vertical, 18) .padding(.horizontal, 8) .glassCard(cornerRadius: 18) } } // MARK: - Section Header struct SectionHeader: View { let title: String var trailing: String? = nil var body: some View { HStack { Text(title) .font(.headline) .foregroundColor(.white) Spacer() if let t = trailing { Text(t) .font(.caption) .foregroundColor(Theme.textSecondary) } } .padding(.horizontal) } }