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

:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --secondary-color: #8b5cf6;
    --background: #0f172a;
    --surface: #1e293b;
    --surface-light: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: #475569;
    --success: #10b981;
    --error: #ef4444;
    --gradient: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    text-align: center;
    padding: 40px 20px;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

main {
    flex: 1;
    background: var(--surface);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

.generator-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
}

.tab-btn {
    padding: 10px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    background: var(--surface-light);
    color: var(--text-primary);
}

.tab-btn.active {
    background: var(--gradient);
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.options-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.option-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.option-group label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.option-group select {
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--surface-light);
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.option-group select:hover {
    border-color: var(--primary-color);
}

.option-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.checkbox-group {
    flex-direction: row;
    align-items: center;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.generate-btn {
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: 10px;
    background: var(--gradient);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.generate-btn:active {
    transform: translateY(0);
}

.result-box {
    margin-top: 20px;
    padding: 24px;
    background: var(--surface-light);
    border-radius: 12px;
    text-align: center;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    transition: background 0.2s ease;
}

.result-box:hover {
    background: #3d4a5c;
}

.result-box::after {
    content: 'Click to copy';
    position: absolute;
    bottom: 8px;
    right: 12px;
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.result-box:hover::after {
    opacity: 1;
}

.result-box .placeholder {
    color: var(--text-muted);
    font-style: italic;
}

.result-box .generated-name {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-word;
}

.bulk-result {
    flex-direction: column;
    align-items: stretch;
    text-align: left;
    max-height: 400px;
    overflow-y: auto;
    cursor: default;
}

.bulk-result:hover::after {
    display: none;
}

.bulk-result .name-list {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bulk-result .name-item {
    padding: 10px 14px;
    background: var(--surface);
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background 0.2s ease;
}

.bulk-result .name-item:hover {
    background: var(--background);
}

.bulk-result .name-item span {
    font-size: 1rem;
    color: var(--text-primary);
}

.bulk-result .name-item .copy-icon {
    font-size: 0.85rem;
    color: var(--text-muted);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.bulk-result .name-item:hover .copy-icon {
    opacity: 1;
}

.copy-btn {
    margin-top: 16px;
    padding: 12px 20px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.copy-btn:hover {
    background: var(--surface-light);
    border-color: var(--primary-color);
    color: var(--text-primary);
}

.copy-btn.hidden {
    display: none;
}

.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--success);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    z-index: 1000;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

footer {
    text-align: center;
    padding: 24px 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

footer a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* Scrollbar styling */
.bulk-result::-webkit-scrollbar {
    width: 8px;
}

.bulk-result::-webkit-scrollbar-track {
    background: var(--surface);
    border-radius: 4px;
}

.bulk-result::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.bulk-result::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 16px;
    }

    header {
        padding: 30px 16px;
    }

    header h1 {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    main {
        padding: 16px;
        border-radius: 12px;
    }

    .generator-tabs {
        gap: 6px;
    }

    .tab-btn {
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    .options-panel {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .result-box {
        padding: 20px 16px;
    }

    .result-box .generated-name {
        font-size: 1.25rem;
    }

    .bulk-result .name-item {
        padding: 8px 12px;
    }
}

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

    .tab-btn {
        padding: 8px 10px;
        font-size: 0.8rem;
    }

    .generate-btn {
        padding: 12px 20px;
        font-size: 0.95rem;
    }
}
