//
//  FontDebugView.swift
//  vibes
//
//  Created by Claude Code on 7/30/25.
//

import SwiftUI

struct FontDebugView: View {
    var body: some View {
        ZStack {
            Color.black.ignoresSafeArea()
            
            VStack(spacing: 20) {
                Text("Font Debug Test")
                    .font(.largeTitle)
                    .foregroundColor(.white)
                
                VStack(alignment: .leading, spacing: 10) {
                    // Test different font references
                    Text("InputSans-Regular: 128")
                        .font(.custom("InputSans-Regular", size: 10))
                        .foregroundColor(.white)
                    
                    Text("Input Sans-Regular: 128")
                        .font(.custom("Input Sans-Regular", size: 10))
                        .foregroundColor(.white)
                    
                    Text("Input Sans Regular: 128")
                        .font(.custom("Input Sans Regular", size: 10))
                        .foregroundColor(.white)
                    
                    Text("Input Sans: 128")
                        .font(.custom("Input Sans", size: 10))
                        .foregroundColor(.white)
                    
                    Text("Constants.Typography.timecode: 128")
                        .font(Constants.Typography.timecode)
                        .foregroundColor(.white)
                    
                    Text("System font (fallback): 128")
                        .font(.system(size: 10))
                        .foregroundColor(.white)
                }
                .padding()
                .background(Color.gray.opacity(0.2))
                .cornerRadius(10)
                
                // Available fonts debug
                Text("Available Custom Fonts:")
                    .font(.headline)
                    .foregroundColor(.white)
                
                ScrollView {
                    VStack(alignment: .leading) {
                        ForEach(UIFont.familyNames.sorted(), id: \.self) { family in
                            if family.contains("Input") || family.contains("PP") {
                                Text(family)
                                    .font(.caption)
                                    .foregroundColor(.green)
                                
                                ForEach(UIFont.fontNames(forFamilyName: family), id: \.self) { font in
                                    Text("  - \(font)")
                                        .font(.caption2)
                                        .foregroundColor(.gray)
                                }
                            }
                        }
                    }
                }
                .frame(maxHeight: 200)
            }
            .padding()
        }
    }
}

#Preview {
    FontDebugView()
}