import SwiftUI

private let settingsCardFill = RosettaColors.adaptive(
    light: Color(hex: 0xF2F2F7),
    dark: Color(red: 28/255, green: 28/255, blue: 30/255)
)

// MARK: - Settings Card (adaptive background, no border/blur)

struct SettingsCard<Content: View>: View {
    let content: () -> Content

    init(@ViewBuilder content: @escaping () -> Content) {
        self.content = content
    }

    var body: some View {
        content()
            .background(
                RoundedRectangle(cornerRadius: 26, style: .continuous)
                    .fill(settingsCardFill)
            )
    }
}

// MARK: - Glass Card (material blur + border)

struct GlassCard<Content: View>: View {
    let cornerRadius: CGFloat
    let fillOpacity: Double
    let content: () -> Content

    init(
        cornerRadius: CGFloat = 12,
        fillOpacity: Double = 0.06,
        @ViewBuilder content: @escaping () -> Content
    ) {
        self.cornerRadius = cornerRadius
        self.fillOpacity = fillOpacity
        self.content = content
    }

    var body: some View {
        content()
            .background {
                TelegramGlassRoundedRect(cornerRadius: cornerRadius)
            }
    }
}
