* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 60px 20px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
}

.controls {
    background: white;
    padding: 30px 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

.filter-btn {
    padding: 12px 24px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: #f0f0ff;
    transform: translateY(-2px);
}

.filter-btn.active {
    background: #667eea;
    color: white;
}

.search-box {
    max-width: 600px;
    margin: 0 auto 20px;
}

#searchInput {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 30px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

#searchInput:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.sample-text-control {
    max-width: 800px;
    margin: 0 auto;
}

#sampleText {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 30px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

#sampleText:focus {
    outline: none;
    border-color: #764ba2;
    box-shadow: 0 0 0 3px rgba(118, 75, 162, 0.1);
}

main {
    padding: 40px 20px;
}

.font-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 20px;
}

.font-card {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.font-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
    border-color: #667eea;
}

.font-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.font-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
}

.font-category {
    font-size: 0.85rem;
    padding: 5px 12px;
    background: #f0f0ff;
    color: #667eea;
    border-radius: 15px;
    font-weight: 600;
}

.font-preview {
    font-size: 1.8rem;
    line-height: 1.4;
    color: #222;
    word-break: break-word;
}

.loading {
    text-align: center;
    padding: 60px 20px;
    font-size: 1.3rem;
    color: #999;
}

.no-results {
    text-align: center;
    padding: 60px 20px;
    font-size: 1.3rem;
    color: #999;
}

footer {
    background: #2d3748;
    color: white;
    text-align: center;
    padding: 40px 20px;
    margin-top: 60px;
}

footer p {
    margin: 5px 0;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 0.95rem;
    }
    
    .filter-buttons {
        flex-direction: column;
    }
    
    .filter-btn {
        width: 100%;
    }
    
    .font-grid {
        grid-template-columns: 1fr;
    }
    
    .font-preview {
        font-size: 1.4rem;
    }
}
