@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --bg-primary: #080816;
    --bg-card: rgba(16, 16, 38, 0.92);
    --accent-cyan: #00d4ff;
    --accent-pink: #ff3399;
    --accent-green: #00e676;
    --accent-gold: #ffab00;
    --text-primary: #e8eaff;
    --text-muted: #6b6d8a;
    --border: rgba(255, 255, 255, 0.07);
}

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

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    font-family: 'Inter', sans-serif;
    padding: 24px 16px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow-y: auto;
}

body::before {
    content: '';
    position: fixed;
    top: -30%; left: -20%;
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(0,212,255,0.06) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}
body::after {
    content: '';
    position: fixed;
    bottom: -30%; right: -20%;
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(255,51,153,0.05) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.main-wrapper {
    max-width: 680px;
    width: 100%;
    animation: fadeUp 0.6s ease forwards;
    opacity: 0;
}
@keyframes fadeUp {
    to { opacity: 1; transform: translateY(0); }
    from { transform: translateY(20px); }
}

.card {
    background: var(--bg-card);
    backdrop-filter: blur(30px);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 32px 24px;
    position: relative;
    overflow: hidden;
}
.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-pink), var(--accent-gold));
    opacity: 0.7;
}

.header { text-align: center; margin-bottom: 28px; }
.header-icon {
    width: 52px; height: 52px;
    margin: 0 auto 14px;
    background: linear-gradient(135deg, rgba(0,212,255,0.12), rgba(255,51,153,0.08));
    border: 1px solid rgba(0,212,255,0.15);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: var(--accent-cyan);
}
h1 {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 26px;
    letter-spacing: 1px;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.tagline { font-size: 13px; color: var(--text-muted); }
.tagline span { color: var(--accent-cyan); font-weight: 600; }

.steps {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    background: rgba(0,0,0,0.25);
    border-radius: 12px;
    padding: 12px 14px;
}
.step {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    padding: 6px 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
    white-space: nowrap;
}
.step.active { background: rgba(0,212,255,0.08); color: var(--accent-cyan); }
.step.done { color: var(--accent-green); }
.step-num {
    width: 20px; height: 20px;
    border-radius: 50%;
    border: 1.5px solid currentColor;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    flex-shrink: 0;
}
.step.done .step-num { border-color: var(--accent-green); background: var(--accent-green); color: #000; }

.field { margin-bottom: 20px; }
.field-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.field-label { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--text-primary); }
.field-label i { font-size: 12px; color: var(--accent-cyan); }
.field-actions { display: flex; gap: 6px; }
.mini-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
    display: flex;
    align-items: center;
    gap: 4px;
}
.mini-btn:hover { background: rgba(255,255,255,0.1); color: var(--text-primary); }
.char-info { font-size: 11px; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; }

textarea {
    width: 100%;
    height: 140px;
    background: rgba(0, 0, 0, 0.35);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    color: #c5c7e0;
    padding: 14px 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12.5px;
    line-height: 1.65;
    resize: vertical;
    transition: border-color 0.25s, box-shadow 0.25s;
}
textarea::placeholder { color: rgba(107, 109, 138, 0.6); }
textarea:focus { outline: none; border-color: rgba(0, 212, 255, 0.35); box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.06); }
textarea[readonly] { cursor: default; }
textarea.output-box:focus { border-color: rgba(0, 230, 118, 0.35); box-shadow: 0 0 0 3px rgba(0, 230, 118, 0.06); }

.field-hint { font-size: 11px; color: var(--text-muted); margin-top: 6px; display: flex; align-items: center; gap: 5px; }
.field-hint i { font-size: 10px; }

.action-area { margin-bottom: 20px; }
.btn-row { display: flex; gap: 10px; }
.btn {
    flex: 1;
    padding: 13px 12px;
    border: none;
    border-radius: 12px;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-family: 'Rajdhani', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; }

.btn-primary { background: linear-gradient(135deg, #0099cc, #005f80); color: #fff; box-shadow: 0 3px 15px rgba(0, 153, 204, 0.2); }
.btn-primary:hover:not(:disabled) { box-shadow: 0 6px 25px rgba(0, 153, 204, 0.35); transform: translateY(-2px); }
.btn-secondary { background: linear-gradient(135deg, #aa2266, #771144); color: #fff; box-shadow: 0 3px 15px rgba(170, 34, 102, 0.2); }
.btn-secondary:hover:not(:disabled) { box-shadow: 0 6px 25px rgba(170, 34, 102, 0.35); transform: translateY(-2px); }

.btn-full { width: 100%; padding: 14px; background: linear-gradient(135deg, #cc7700, #995500); color: #fff; box-shadow: 0 3px 15px rgba(204, 119, 0, 0.2); border-radius: 12px; margin-top: 10px; border: none; font-size: 13.5px; font-weight: 700; cursor: pointer; transition: all 0.25s ease; text-transform: uppercase; letter-spacing: 0.8px; font-family: 'Rajdhani', sans-serif; display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn-full:hover:not(:disabled) { box-shadow: 0 6px 25px rgba(204, 119, 0, 0.35); transform: translateY(-2px); }
.btn-full:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; }

.sep { display: flex; align-items: center; gap: 12px; margin: 20px 0; }
.sep::before, .sep::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.sep span { font-size: 11px; color: var(--text-muted); font-weight: 500; }

.output-toolbar { display: flex; gap: 8px; margin-top: 10px; }
.output-toolbar .mini-btn { flex: 1; justify-content: center; padding: 8px 12px; font-size: 12px; font-weight: 500; }
.mini-btn.copy-active { background: rgba(0, 230, 118, 0.1); border-color: rgba(0, 230, 118, 0.25); color: var(--accent-green); }

.toast-container { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 8px; pointer-events: none; width: 90%; max-width: 400px; }
.toast-item { padding: 12px 18px; border-radius: 12px; font-size: 13px; font-weight: 500; backdrop-filter: blur(20px); display: flex; align-items: center; gap: 10px; transform: translateY(-30px); opacity: 0; transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1); pointer-events: auto; }
.toast-item.show { transform: translateY(0); opacity: 1; }
.toast-item.success { background: rgba(0, 200, 83, 0.12); border: 1px solid rgba(0, 200, 83, 0.25); color: var(--accent-green); }
.toast-item.info { background: rgba(0, 212, 255, 0.12); border: 1px solid rgba(0, 212, 255, 0.25); color: var(--accent-cyan); }
.toast-item.warn { background: rgba(255, 171, 0, 0.12); border: 1px solid rgba(255, 171, 0, 0.25); color: var(--accent-gold); }
.toast-item.error { background: rgba(255, 51, 153, 0.12); border: 1px solid rgba(255, 51, 153, 0.25); color: var(--accent-pink); }

.overlay { position: absolute; inset: 0; background: rgba(8, 8, 22, 0.75); backdrop-filter: blur(6px); border-radius: 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; z-index: 50; opacity: 0; pointer-events: none; transition: opacity 0.25s; }
.overlay.active { opacity: 1; pointer-events: all; }
.spinner { width: 40px; height: 40px; border: 3px solid rgba(0,212,255,0.15); border-top-color: var(--accent-cyan); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.overlay span { font-size: 13px; color: var(--text-muted); }

.help-toggle { text-align: center; margin-top: 20px; }
.help-toggle button { background: none; border: none; color: var(--text-muted); font-size: 12px; cursor: pointer; font-family: 'Inter', sans-serif; padding: 6px 14px; border-radius: 20px; transition: all 0.2s; }
.help-toggle button:hover { color: var(--text-primary); background: rgba(255,255,255,0.04); }
.help-content { max-height: 0; overflow: hidden; transition: max-height 0.4s ease, padding 0.4s ease; padding: 0 16px; }
.help-content.open { max-height: 400px; padding: 16px; }
.help-card { background: rgba(0,0,0,0.2); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.help-card h3 { font-size: 13px; font-weight: 600; margin-bottom: 10px; color: var(--accent-cyan); }
.help-item { display: flex; gap: 10px; margin-bottom: 10px; font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.help-item:last-child { margin-bottom: 0; }
.help-item i { color: var(--accent-cyan); margin-top: 3px; flex-shrink: 0; width: 14px; text-align: center; }
.kbd { display: inline-block; background: rgba(255,255,255,0.06); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; font-size: 10px; font-family: 'JetBrains Mono', monospace; color: var(--text-primary); }

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 10px; }
::selection { background: rgba(0, 212, 255, 0.2); color: #fff; }

@media (max-width: 500px) {
    body { padding: 12px 10px; }
    .card { padding: 24px 16px; border-radius: 16px; }
    h1 { font-size: 22px; }
    .steps { flex-direction: column; gap: 4px; padding: 10px; }
    .btn-row { flex-direction: column; }
    textarea { height: 120px; font-size: 12px; }
    .output-toolbar { flex-direction: column; }
}