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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 15px;
}

.info-icon {
    cursor: pointer;
    font-size: 1rem;
    margin-left: 8px;
    opacity: 0.8;
    transition: opacity 0.2s;
    display: inline-block;
    vertical-align: middle;
}

.info-icon:hover {
    opacity: 1;
}

.info-box {
    background: rgba(255, 255, 255, 0.15);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.95rem;
    margin-top: 10px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    transition: opacity 0.3s;
}

.info-box a {
    color: white;
    text-decoration: underline;
    font-weight: 500;
}

.info-box a:hover {
    text-decoration: none;
}

.info-box.hidden {
    display: none;
}

.regex-info-box {
    background: rgba(255, 255, 255, 0.95);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-top: 8px;
    border: 1px solid rgba(102, 126, 234, 0.3);
    line-height: 1.6;
    color: #333;
}

.regex-info-box code {
    background: rgba(102, 126, 234, 0.1);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.95em;
    color: #667eea;
    font-weight: 600;
}

.regex-info-box.hidden {
    display: none;
}

.controls {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.search-box {
    margin-bottom: 15px;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-wrapper #searchInput {
    padding-right: 45px; /* Make room for the reset button */
}

.reset-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 12px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    transition: color 0.2s;
}

.reset-btn:focus-visible {
    color: #667eea;
    outline: 2px solid #667eea;
    outline-offset: -2px;
    border-radius: 4px;
}

.reset-btn svg {
    display: block;
}

#searchInput {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: border-color 0.3s;
    font-family: 'Courier New', monospace;
}

#searchInput:focus {
    outline: none;
    border-color: #667eea;
}

.search-status {
    margin-top: 8px;
    font-size: 14px;
    font-weight: 500;
}

.search-status.regex-mode {
    color: #667eea;
    cursor: pointer;
}

.search-status.regex-mode:hover {
    text-decoration: underline;
}

.search-status.text-mode {
    color: #666;
}

.alphabet-filters-wrapper {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.alphabet-filter-container {
    flex: 1;
    min-width: 0;
}

@media (max-width: 768px) {
    .alphabet-filters-wrapper {
        flex-direction: column;
    }

    .alphabet-filter-container {
        margin-bottom: 15px;
    }

    .alphabet-filter-container:last-child {
        margin-bottom: 0;
    }
}

.alphabet-toggle-btn {
    width: 100%;
    padding: 10px 16px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #333;
}

.alphabet-toggle-btn:hover {
    border-color: #667eea;
    background: #f8f8ff;
}

.alphabet-toggle-btn.active {
    border-color: #667eea;
    background: #f0f0ff;
}

.toggle-arrow {
    font-size: 12px;
    transition: transform 0.3s;
}

.alphabet-toggle-btn.active .toggle-arrow {
    transform: rotate(180deg);
}

.alphabet-filter {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 12px;
    padding: 12px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.alphabet-filter.hidden {
    display: none;
}

.letter-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    color: #333;
}

.letter-btn:hover {
    background: #f0f0f0;
    border-color: #667eea;
}

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

.filter-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-btn {
    flex: 1;
    min-width: 100px;
    padding: 10px 20px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-btn:hover {
    border-color: #667eea;
}

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

.stats {
    color: white;
    text-align: center;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.names-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.name-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    text-align: center;
}

.name-text {
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    overflow-wrap: break-word;
}

.name-gender {
    font-size: 0.9rem;
    color: #666;
    text-transform: capitalize;
}

.name-gender.kluk {
    color: #4A90E2;
}

.name-gender.holka {
    color: #E85D75;
}

.name-gender.neutral {
    color: #9B59B6;
}

.footer {
    margin-top: 40px;
    padding: 20px;
    text-align: center;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.github-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: white;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
}

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    color: white;
    font-size: 1.2rem;
    padding: 40px 20px;
}

.github-icon {
    flex-shrink: 0;
}

@media (hover: hover) {
    .name-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    }

    .reset-btn:hover {
        color: #667eea;
    }

    .github-link:hover {
        background: rgba(255, 255, 255, 0.25);
        transform: translateY(-2px);
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .names-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }

    .filter-buttons {
        flex-direction: column;
    }
}
