/* ── Quick Examples Section ───────────────────────────────── */
.examples-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}
.examples-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.875rem;
    display: flex;
    align-items: center;
    gap: 6px;
}
.examples-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.65rem;
}
.example-btn {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.75rem 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    font-family: inherit;
    position: relative;
    overflow: hidden;
}
.example-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(99,102,241,0.06), transparent);
    opacity: 0;
    transition: opacity 0.2s;
}
.example-btn:hover {
    border-color: rgba(99,102,241,0.45);
    background: rgba(99,102,241,0.06);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(99,102,241,0.15);
}
.example-btn:hover::before { opacity: 1; }
.example-btn:active { transform: translateY(0); }

.example-btn-active {
    border-color: var(--primary) !important;
    background: rgba(99,102,241,0.12) !important;
    box-shadow: 0 0 0 1px var(--primary), 0 4px 20px rgba(99,102,241,0.25) !important;
}
.example-btn-active .ex-info strong { color: var(--primary-2); }

.ex-emoji {
    font-size: 1.5rem;
    line-height: 1;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.3));
}
.ex-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.ex-info strong {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s;
}
.ex-info span {
    font-size: 0.7rem;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Custom Select Reveal Input ───────────────────────────── */
.custom-reveal {
    margin-top: 0;
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
    overflow: hidden;
    border-width: 0;
    transition: max-height 0.3s ease, opacity 0.25s ease, margin-top 0.25s ease, padding 0.25s ease, border-width 0.25s ease;
    pointer-events: none;
}
.custom-reveal-show {
    max-height: 60px;
    opacity: 1;
    margin-top: 0.6rem;
    padding-top: 0.8rem;
    padding-bottom: 0.8rem;
    border-width: 1px;
    pointer-events: all;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

/* ── Live Text Preview ────────────────────────────────────── */
.text-preview-wrap {
    margin-top: 1.25rem;
    background: rgba(255,255,255,0.025);
    border: 1px solid rgba(99,102,241,0.3);
    border-radius: 12px;
    padding: 1rem 1.25rem 1.15rem;
    position: relative;
    box-shadow: 0 0 20px rgba(99,102,241,0.08);
}
.text-preview-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--primary-2);
    margin-bottom: 0.65rem;
    display: flex;
    align-items: center;
    gap: 5px;
}
.text-preview-box {
    font-size: clamp(1.5rem, 4vw, 2.4rem);
    font-weight: 900;
    color: #ffffff;
    text-align: center;
    line-height: 1.25;
    padding: 0.5rem 0;
    min-height: 3.5rem;
    word-break: break-word;
    text-shadow: 0 2px 16px rgba(99,102,241,0.45), 0 0 40px rgba(255,255,255,0.08);
    transition: font-family 0.3s ease, color 0.2s;
    letter-spacing: 0.01em;
}

:root {
    --bg:        #0a0a0f;
    --surface:   #111118;
    --card:      #16161f;
    --border:    #2a2a38;
    --border-2:  #1e1e2a;
    --text:      #f0f0f8;
    --muted:     #888899;
    --accent:    #ff0000;
    --accent-2:  #ff4444;
    --primary:   #6366f1;
    --primary-2: #818cf8;
    --green:     #22c55e;
}

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

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', system-ui, sans-serif;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
}

/* ── Navbar ───────────────────────────────────────────────── */
.navbar {
    background: rgba(17,17,24,0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-content {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo {
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.02em;
}
.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #ff0000;
    border-radius: 8px;
    box-shadow: 0 0 16px rgba(255,0,0,0.35);
}
.nav-badge {
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
}

/* ── Hero ─────────────────────────────────────────────────── */
.hero {
    text-align: center;
    padding: 5rem 1.5rem 3rem;
    max-width: 760px;
    margin: 0 auto;
}
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(99,102,241,0.12);
    border: 1px solid rgba(99,102,241,0.3);
    color: var(--primary-2);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.35rem 1rem;
    border-radius: 999px;
    margin-bottom: 1.75rem;
    letter-spacing: 0.02em;
}
.badge-dot {
    width: 7px; height: 7px;
    background: var(--green);
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(34,197,94,0.7);
    animation: blink 2s ease-in-out infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.4} }

h1 {
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -0.04em;
    margin-bottom: 1.25rem;
    color: var(--text);
}
.gradient-text {
    background: linear-gradient(135deg, #ff0000, #ff6b6b, #ff4444);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.subtitle {
    color: var(--muted);
    font-size: 1.05rem;
    line-height: 1.7;
    font-weight: 400;
}

/* ── App Container ────────────────────────────────────────── */
.app-container {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 1.25rem 5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ── Card ─────────────────────────────────────────────────── */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2.25rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.35);
}

/* ── Section Titles ───────────────────────────────────────── */
.section-title {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.section-num {
    background: rgba(99,102,241,0.15);
    color: var(--primary-2);
    font-weight: 800;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    border: 1px solid rgba(99,102,241,0.2);
    white-space: nowrap;
    margin-top: 2px;
}
.section-title strong {
    font-size: 0.95rem;
    color: var(--text);
    display: block;
    margin-bottom: 2px;
}
.section-title p {
    font-size: 0.8rem;
    color: var(--muted);
}

/* ── Dividers ─────────────────────────────────────────────── */
.divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.75rem 0 1rem;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.divider::before,.divider::after {
    content:''; flex:1;
    height: 1px;
    background: var(--border);
}
.section-caption {
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 1.25rem;
    margin-top: -0.5rem;
}

/* ── Form ─────────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1.25rem; }
.form-group { margin-bottom: 0; }

.form-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--text);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.label-icon { font-size: 0.9rem; }
.label-hint {
    margin-left: auto;
    font-size: 0.7rem;
    color: var(--muted);
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
}

.form-control, .form-select {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 9px;
    padding: 0.8rem 1rem;
    font-size: 0.9rem;
    width: 100%;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    appearance: none;
}
.form-control::placeholder { color: #55556a; }
.form-control:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
    background: rgba(99,102,241,0.05);
}
.form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23888899' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 2.5rem;
    cursor: pointer;
}
.form-select option { background: #1a1a26; color: var(--text); }

/* ── Add-ons ──────────────────────────────────────────────── */
.addons-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 2rem;
}
.addon-chip {
    display: flex;
    align-items: center;
    gap: 7px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.55rem 0.9rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}
.addon-chip:hover {
    border-color: var(--primary);
    color: var(--primary-2);
    background: rgba(99,102,241,0.08);
}
.addon-chip input { display: none; }
.addon-chip:has(input:checked) {
    border-color: var(--primary);
    background: rgba(99,102,241,0.15);
    color: var(--primary-2);
    box-shadow: 0 0 10px rgba(99,102,241,0.2);
}

/* ── Generate Button ──────────────────────────────────────── */
.btn-generate {
    background: linear-gradient(135deg, #ff0000, #cc0000);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 1.1rem 2rem;
    font-weight: 700;
    font-size: 1rem;
    width: 100%;
    cursor: pointer;
    transition: all 0.25s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.6rem;
    box-shadow: 0 4px 24px rgba(255,0,0,0.3);
    letter-spacing: -0.01em;
}
.btn-generate:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(255,0,0,0.45);
    background: linear-gradient(135deg, #ff2222, #dd0000);
}
.btn-generate:active { transform: translateY(0); }
.btn-generate:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }

/* ── Loader ───────────────────────────────────────────────── */
.loader {
    display: none;
    border: 3px solid rgba(255,255,255,0.25);
    border-radius: 50%;
    border-top-color: white;
    width: 18px; height: 18px;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Result ───────────────────────────────────────────────── */
.result-container {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    margin-top: 1.5rem;
    display: none;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}
.result-header h3 {
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}
.btn-copy {
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border);
    color: var(--muted);
    border-radius: 7px;
    padding: 0.45rem 0.9rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.btn-copy:hover { background: rgba(255,255,255,0.1); color: var(--text); }

#output-content {
    font-size: 0.875rem;
    line-height: 1.8;
    color: #ccccd8;
    white-space: pre-wrap;
}
#output-content strong { color: var(--text); }
#output-content em { color: var(--primary-2); font-style: italic; }
#output-content .out-hr { border: none; border-top: 1px solid var(--border-2); margin: 1rem 0; }
#output-content .out-h4 { font-size: 0.9rem; color: var(--text); margin: 0.5rem 0 0.25rem; font-weight: 700; }
#output-content ul { padding-left: 1.25rem; }
#output-content li { margin-bottom: 0.25rem; }
.err-msg { color: #ef4444; font-weight: 600; font-size: 0.875rem; }

/* ── Image Section ────────────────────────────────────────── */
.img-section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 2rem 0 0.4rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}
.img-section-header strong { font-size: 0.95rem; color: var(--text); }
.img-badge {
    font-size: 0.7rem;
    font-weight: 600;
    background: rgba(34,197,94,0.1);
    color: var(--green);
    border: 1px solid rgba(34,197,94,0.25);
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
}
.img-note {
    font-size: 0.78rem;
    color: var(--muted);
    margin-bottom: 1.25rem;
}
.img-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}
.img-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}
.img-card-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-2);
}
.img-variant-badge {
    background: rgba(255,0,0,0.15);
    color: #ff6666;
    border: 1px solid rgba(255,0,0,0.25);
    font-size: 0.7rem;
    font-weight: 800;
    padding: 0.15rem 0.5rem;
    border-radius: 5px;
    letter-spacing: 0.05em;
}
.img-card-label {
    font-size: 0.78rem;
    color: var(--muted);
    font-weight: 500;
}
.img-wrap {
    background: #0d0d18;
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.img-skeleton {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 500;
    padding: 2rem;
    text-align: center;
}
.skeleton-spinner {
    width: 28px; height: 28px;
    border: 3px solid rgba(255,255,255,0.08);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}
.img-actions {
    display: flex;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border-2);
}
.btn-view, .btn-dl {
    flex: 1;
    text-align: center;
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.5rem 0.75rem;
    border-radius: 7px;
    transition: all 0.2s;
    display: block;
}
.btn-view {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    color: var(--muted);
}
.btn-view:hover { background: rgba(255,255,255,0.1); color: var(--text); }
.btn-dl {
    background: var(--primary);
    color: white;
    border: 1px solid var(--primary);
    box-shadow: 0 2px 12px rgba(99,102,241,0.3);
}
.btn-dl:hover { background: var(--primary-2); box-shadow: 0 4px 16px rgba(99,102,241,0.45); }

/* ── Formula Card ─────────────────────────────────────────── */
.formula-card {
    background: rgba(99,102,241,0.05);
    border: 1px solid rgba(99,102,241,0.2);
    border-radius: 16px;
    padding: 1.75rem 2rem;
    box-shadow: 0 4px 24px rgba(99,102,241,0.08);
}
.formula-title {
    font-weight: 800;
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--primary-2);
    margin-bottom: 1.25rem;
}
.formula-eq {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}
.f-tag {
    background: rgba(99,102,241,0.15);
    border: 1px solid rgba(99,102,241,0.25);
    color: var(--primary-2);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.3rem 0.7rem;
    border-radius: 7px;
    letter-spacing: 0.02em;
}
.f-plus { color: var(--muted); font-weight: 700; font-size: 1rem; }
.f-eq { color: var(--muted); font-weight: 800; font-size: 1.1rem; margin: 0 0.25rem; }
.f-result {
    background: linear-gradient(135deg, #ff0000, #ff6b6b);
    color: white;
    font-size: 0.82rem;
    font-weight: 800;
    padding: 0.35rem 0.9rem;
    border-radius: 7px;
    box-shadow: 0 2px 12px rgba(255,0,0,0.3);
}
.formula-rules {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.6rem;
}
.rule-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.79rem;
    color: var(--muted);
    font-weight: 500;
}

/* ── Footer ───────────────────────────────────────────────── */
footer {
    border-top: 1px solid var(--border);
    padding: 1.75rem 2rem;
    text-align: center;
    background: var(--surface);
}
.footer-inner {
    max-width: 860px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--muted);
    font-weight: 500;
    gap: 1rem;
    flex-wrap: wrap;
}
.footer-tags { display: flex; gap: 0.5rem; align-items: center; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .img-grid { grid-template-columns: 1fr; }
    .formula-rules { grid-template-columns: 1fr 1fr; }
    .examples-grid { grid-template-columns: 1fr 1fr; }
    .card { padding: 1.5rem; }
    .formula-card { padding: 1.25rem; }
    h1 { font-size: 2.2rem; }
    .hero { padding: 3.5rem 1.25rem 2rem; }
    .footer-inner { flex-direction: column; text-align: center; }
}
@media (max-width: 480px) {
    .formula-rules { grid-template-columns: 1fr; }
    .formula-eq { justify-content: flex-start; }
    .examples-grid { grid-template-columns: 1fr; }
}
