/* AI Refine Studio — post-generation edit panel for Socila playground */

.nl-refine-studio {
    margin-top: 1rem;
    padding: 1.15rem 1.2rem 1.25rem;
    border-radius: 18px;
    border: 1px solid rgba(0, 255, 157, 0.22);
    background: linear-gradient(145deg, rgba(0, 255, 157, 0.06), rgba(24, 24, 27, 0.92));
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
    animation: nlRefineIn 0.35s ease-out;
}

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

.nl-refine-head {
    margin-bottom: 0.85rem;
}

.nl-refine-badge {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #00ff9d;
    background: rgba(0, 255, 157, 0.12);
    border: 1px solid rgba(0, 255, 157, 0.28);
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
    margin-bottom: 0.45rem;
}

.nl-refine-head h4 {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 0.35rem;
    color: #fff;
}

.nl-refine-head p {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.72);
}

.nl-refine-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 0.75rem;
}

.nl-refine-chip {
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.88);
    border-radius: 999px;
    padding: 0.35rem 0.7rem;
    font-size: 0.74rem;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.nl-refine-chip:hover,
.nl-refine-chip.is-active {
    border-color: rgba(0, 255, 157, 0.55);
    background: rgba(0, 255, 157, 0.12);
    color: #fff;
}

.nl-refine-input {
    width: 100%;
    min-height: 72px;
    resize: vertical;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    font-family: inherit;
    font-size: 0.86rem;
    line-height: 1.45;
    padding: 0.65rem 0.75rem;
    margin-bottom: 0.75rem;
}

.nl-refine-input:focus {
    outline: none;
    border-color: rgba(0, 255, 157, 0.45);
    box-shadow: 0 0 0 2px rgba(0, 255, 157, 0.12);
}

.nl-refine-input::placeholder {
    color: rgba(255, 255, 255, 0.38);
}

.nl-refine-length {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.nl-refine-length-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.75);
    margin-right: 0.15rem;
}

.nl-refine-length-chip {
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.85);
    border-radius: 10px;
    padding: 0.3rem 0.65rem;
    font-size: 0.76rem;
    font-family: inherit;
    cursor: pointer;
}

.nl-refine-length-chip.is-active {
    border-color: rgba(0, 255, 157, 0.55);
    background: rgba(0, 255, 157, 0.14);
    color: #fff;
}

.nl-refine-versions {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.nl-refine-versions-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.5);
    margin-right: 0.15rem;
}

.nl-refine-version-btn {
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(0, 0, 0, 0.25);
    color: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    padding: 0.25rem 0.55rem;
    font-size: 0.72rem;
    font-family: inherit;
    cursor: pointer;
}

.nl-refine-version-btn.is-active {
    border-color: rgba(0, 255, 157, 0.5);
    color: #00ff9d;
}

.nl-refine-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.nl-refine-apply {
    border: none;
    border-radius: 12px;
    padding: 0.62rem 1.1rem;
    font-size: 0.86rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    color: #0a1410;
    background: linear-gradient(135deg, #00ff9d, #00d4aa);
    box-shadow: 0 4px 18px rgba(0, 255, 157, 0.25);
    transition: transform 0.12s, box-shadow 0.12s;
}

.nl-refine-apply:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 22px rgba(0, 255, 157, 0.32);
}

.nl-refine-apply:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.nl-refine-note {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.48);
}

html[data-theme="light"] .nl-refine-studio {
    background: linear-gradient(145deg, rgba(0, 120, 80, 0.06), rgba(255, 255, 255, 0.98));
    border-color: rgba(0, 90, 60, 0.18);
}

html[data-theme="light"] .nl-refine-head h4 {
    color: #102018;
}

html[data-theme="light"] .nl-refine-head p,
html[data-theme="light"] .nl-refine-note,
html[data-theme="light"] .nl-refine-length-label {
    color: rgba(16, 32, 24, 0.72);
}

html[data-theme="light"] .nl-refine-input {
    background: #f4faf7;
    border-color: rgba(0, 90, 60, 0.16);
    color: #102018;
}

html[data-theme="light"] .nl-refine-chip,
html[data-theme="light"] .nl-refine-length-chip,
html[data-theme="light"] .nl-refine-version-btn {
    background: rgba(0, 90, 60, 0.05);
    border-color: rgba(0, 90, 60, 0.14);
    color: #1a3028;
}

@media (max-width: 640px) {
    .nl-refine-studio {
        padding: 1rem;
    }

    .nl-refine-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .nl-refine-apply {
        width: 100%;
    }
}
