/* Namespace all styles with pf-* to avoid collisions */

/* ---- Base / Reset ---- */
.pf-container {
    --pf-bg: #0b1020;
    --pf-surface: #121a2e;
    --pf-text: #e6ecff;
    --pf-subtext: #a7b1d6;
    --pf-primary: #3b82f6;
    --pf-accent: #22c55e;
    --pf-border: rgba(59, 130, 246, 0.6);
    --pf-shadow: 0 10px 30px rgba(59, 130, 246, 0.25);
    --pf-focus: 0 0 0 3px rgba(59, 130, 246, 0.35);

    color: var(--pf-text);
    background: transparent;
    max-width: 720px;
    margin: 2.5rem auto;
    padding: 0 1rem;
    font-family: ui-sans-serif, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

/* ---- Floating/Dancing Input ---- */
@keyframes pf-float-dance {
    0% {
        transform: translate(0, 0) rotate(0);
    }

    25% {
        transform: translate(16px, -20px) rotate(3deg);
    }

    50% {
        transform: translate(-12px, -14px) rotate(-2deg);
    }

    75% {
        transform: translate(18px, -26px) rotate(4deg);
    }

    100% {
        transform: translate(0, 0) rotate(0);
    }
}

.pf-floating {
    animation: pf-float-dance 4s ease-in-out infinite;
}

.pf-floating.pf-used {
    animation: none !important;
    transform: none !important;
}

.pf-input-wrap {
    background: var(--pf-surface);
    border: 2px solid var(--pf-border);
    border-radius: 18px;
    padding: 1.25rem;
    box-shadow: var(--pf-shadow);
}

.pf-label {
    display: block;
    font-weight: 700;
    margin-bottom: .5rem;
}

.pf-input {
    width: 100%;
    font-size: 1.125rem;
    padding: .9rem 1.1rem;
    border-radius: 999px;
    border: 2px solid var(--pf-primary);
    color: var(--pf-text);
    background: #0f1830;
    outline: none;
    box-shadow: 0 0 20px rgba(59, 130, 246, .25);
    transition: box-shadow .25s ease, transform .1s ease;
}

.pf-input:focus-visible {
    box-shadow: var(--pf-focus), 0 0 20px rgba(59, 130, 246, .25);
}

.pf-input::placeholder {
    color: var(--pf-subtext);
    opacity: .7;
}

.pf-help {
    margin: .5rem 0 0;
    color: var(--pf-subtext);
    font-size: .9rem;
}

/* ---- Controls ---- */
.pf-controls {
    display: flex;
    gap: .5rem;
    margin: .9rem 0 .25rem;
    flex-wrap: wrap;
}

.pf-btn {
    -webkit-appearance: none;
    appearance: none;
    border: 2px solid var(--pf-primary);
    background: #0f1830;
    color: var(--pf-text);
    padding: .55rem .9rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: transform .06s ease, background .2s ease, border-color .2s ease;
}

.pf-btn:hover {
    background: #122046;
}

.pf-btn:active {
    transform: translateY(1px);
}

.pf-btn:focus-visible {
    outline: none;
    box-shadow: var(--pf-focus);
}

.pf-primary {
    border-color: var(--pf-primary);
}

.pf-secondary {
    border-color: #64748b;
}

.pf-accent {
    border-color: var(--pf-accent);
}

.pf-progress {
    margin-top: .25rem;
    color: var(--pf-subtext);
    font-size: .9rem;
}

/* ---- Results ---- */
.pf-result-wrap {
    margin-top: 1.25rem;
}

.pf-result-card {
    border: 2px solid var(--pf-border);
    border-radius: 18px;
    background: var(--pf-surface);
    padding: 1rem;
    box-shadow: var(--pf-shadow);
}

.pf-result-title {
    margin: 0 0 .5rem 0;
    font-size: 1.1rem;
}

.pf-result-text {
    margin: 0;
    white-space: pre-wrap;
    background: #0b1530;
    border: 1px dashed rgba(59, 130, 246, .45);
    border-radius: 12px;
    padding: .85rem;
    line-height: 1.5;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.pf-result-actions {
    display: flex;
    gap: .5rem;
    margin-top: .75rem;
    flex-wrap: wrap;
}

/* ---- Responsive ---- */
@media (max-width:600px) {
    .pf-container {
        margin: 1.25rem auto;
    }
}