@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Space+Mono:wght@400;700&display=swap');

:root {
    --primary-gradient: linear-gradient(135deg, #3b82f6 0%, #2dd4bf 100%);
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent: #2dd4bf;
    --accent-dark: #0d9488;
    --border: rgba(255, 255, 255, 0.1);
    --shadow-premium: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.15);
    --panel-bg: rgba(255, 255, 255, 0.03);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 2rem;
}

/* ── Background Blobs ── */
.bg-blobs {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.blob {
    position: absolute;
    width: 600px;
    height: 600px;
    background: var(--primary-gradient);
    filter: blur(150px);
    opacity: 0.1;
    border-radius: 50%;
    top: -150px;
    right: -150px;
}

.blob-2 {
    bottom: -150px;
    left: -150px;
    background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
}

/* ── Container ── */
.tool-container {
    width: 100%;
    max-width: 900px;
    background: var(--card-bg);
    backdrop-filter: blur(24px);
    border: 1px solid var(--border);
    border-radius: 28px;
    padding: 2.5rem;
    box-shadow: var(--shadow-premium);
    margin: 1rem auto;
}

/* ── Header ── */
.header {
    text-align: center;
    margin-bottom: 2rem;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 0.5rem;
}

.header p {
    color: var(--text-secondary);
}

/* ── Controls ── */
.controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
    background: rgba(255, 255, 255, 0.02);
    padding: 1.5rem;
    border-radius: 20px;
    border: 1px solid var(--border);
}

.control-item {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.control-item label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

select,
input[type="number"] {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border);
    color: #fff;
    padding: 0.6rem 1rem;
    border-radius: 10px;
    outline: none;
    font-weight: 600;
}

.toggle-group {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.option-toggle {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    user-select: none;
}

.option-toggle input {
    display: none;
}

.toggle-track {
    width: 40px;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 100px;
    position: relative;
    transition: 0.3s;
}

.option-toggle input:checked~.toggle-track {
    background: var(--accent-dark);
}

.toggle-thumb {
    position: absolute;
    left: 3px;
    top: 3px;
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    transition: 0.3s;
}

.option-toggle input:checked~.toggle-track .toggle-thumb {
    transform: translateX(20px);
}

.toggle-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* ── Main Actions ── */
.actions {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.generate-btn {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 1rem 3rem;
    font-size: 1rem;
    font-weight: 800;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

.generate-btn:active {
    transform: scale(0.98);
}

/* ── Result Area ── */
.result-container {
    background: var(--panel-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1.5rem;
    position: relative;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.count-badge {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent);
}

#resultArea {
    width: 100%;
    height: 250px;
    background: transparent;
    border: none;
    color: #fff;
    font-family: 'Space Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    resize: none;
    outline: none;
    word-break: break-all;
}

.result-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.8rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.btn-icon {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border: 1px solid var(--border);
    padding: 0.6rem 1.2rem;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-secondary);
}

.btn-copy.copied {
    background: #10b981;
    border-color: #10b981;
}

/* ── Responsive ── */
@media (max-width: 640px) {
    .tool-container {
        padding: 1.5rem;
    }

    .header h1 {
        font-size: 2rem;
    }

    .toggle-group {
        flex-direction: column;
        gap: 0.8rem;
    }
}