import Foundation

/// A single insight metric displayed on the Insights tab.
struct InsightCard: Identifiable {
    let id: UUID
    let title: String
    let value: String
    let caption: String           // Short description shown on card
    let explanation: String       // Full explanation for detail sheet
    let symbolName: String
    let breakdown: [BreakdownItem]?  // Optional per-ritual breakdown
    let trendData: [TrendDataPoint]? // Optional trend data for sparkline charts

    init(
        id: UUID = UUID(),
        title: String,
        value: String,
        caption: String,
        explanation: String = "",
        symbolName: String,
        breakdown: [BreakdownItem]? = nil,
        trendData: [TrendDataPoint]? = nil
    ) {
        self.id = id
        self.title = title
        self.value = value
        self.caption = caption
        self.explanation = explanation
        self.symbolName = symbolName
        self.breakdown = breakdown
        self.trendData = trendData
    }
}

/// A single item in the insight breakdown list.
struct BreakdownItem: Identifiable {
    let id = UUID()
    let label: String
    let value: String
}

/// A single data point for trend charts.
struct TrendDataPoint: Identifiable {
    let id = UUID()
    let date: Date
    let value: Double  // 0.0 to 1.0 for percentage completion
    let label: String  // e.g., "Mon", "Tue"
}
