import SwiftUI

struct CategoryCard: View {
    let category: Category
    let isFocused: Bool

    var body: some View {
        VStack {
            ZStack {
                LinearGradient(
                    gradient: Gradient(colors: [
                        Color.blue.opacity(0.7),
                        Color.purple.opacity(0.7)
                    ]),
                    startPoint: .topLeading,
                    endPoint: .bottomTrailing
                )

                VStack {
                    Spacer()
                    Text(category.name)
                        .font(.title3)
                        .fontWeight(.semibold)
                        .foregroundColor(.white)
                        .multilineTextAlignment(.center)
                        .lineLimit(3)
                        .padding()
                    Spacer()
                }
            }
            .frame(width: 200, height: 300)
            .clipShape(RoundedRectangle(cornerRadius: Constants.UI.vodCardCornerRadius))
            .overlay(
                RoundedRectangle(cornerRadius: Constants.UI.vodCardCornerRadius)
                    .stroke(isFocused ? Color.white : Color.clear, lineWidth: Constants.UI.focusBorderWidth)
            )
        }
        .scaleEffect(isFocused ? Constants.UI.focusScale : 1.0)
        .shadow(color: isFocused ? Color.white.opacity(0.3) : Color.black.opacity(0.5), radius: isFocused ? Constants.UI.focusShadowRadius : 5)
        .animation(.easeInOut(duration: Constants.UI.standardAnimationDuration), value: isFocused)
        .padding(15)
    }
}
