/* ═══════════════════════════════════════════════════════════════
   Design Prompter Modal — Styles
   Matches VizTools gallery aesthetics & app dark theme
   ═══════════════════════════════════════════════════════════════ */

/* ── Backdrop ── */
.dsnprm-backdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.dsnprm-backdrop.show {
    opacity: 1;
    pointer-events: auto;
}

/* ── Modal ── */
.dsnprm-modal {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: min(900px, 90vw);
    max-height: 85vh;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}
.dsnprm-modal.show {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

/* ── Container ── */
.dsnprm-container {
    background: var(--bg-secondary, #1a1d23);
    border: 1px solid var(--border-color, #2a2d35);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.05) inset;
}

/* ── Header ── */
.dsnprm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color, #2a2d35);
    background: var(--bg-primary, #14161a);
    border-radius: 16px 16px 0 0;
}
.dsnprm-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.dsnprm-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary, #e8e8e8);
    margin: 0;
}
.dsnprm-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dsnprm-icon-btn {
    background: transparent;
    border: 1px solid var(--border-color, #2a2d35);
    border-radius: 8px;
    color: var(--text-muted, #888);
    padding: 6px;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.dsnprm-icon-btn:hover {
    background: rgba(255,255,255,0.06);
    color: var(--text-primary, #e8e8e8);
    border-color: rgba(255,255,255,0.15);
}

.dsnprm-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted, #888);
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    transition: all 0.15s;
}
.dsnprm-close-btn:hover {
    background: rgba(255,80,80,0.15);
    color: #ff5050;
}

/* ── Tabs ── */
.dsnprm-tabs {
    display: flex;
    gap: 4px;
    padding: 12px 24px;
    border-bottom: 1px solid var(--border-color, #2a2d35);
    background: var(--bg-primary, #14161a);
}
.dsnprm-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-muted, #888);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}
.dsnprm-tab:hover {
    background: rgba(255,255,255,0.04);
    color: var(--text-primary, #e8e8e8);
}
.dsnprm-tab.active {
    background: rgba(139,92,246,0.12);
    border-color: rgba(139,92,246,0.35);
    color: #a78bfa;
}

/* ── Body ── */
.dsnprm-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    min-height: 200px;
    max-height: 400px;
}

/* ── Fields Grid ── */
.dsnprm-fields-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.dsnprm-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.dsnprm-field-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted, #888);
    display: flex;
    align-items: center;
    gap: 6px;
}

.dsnprm-field-num {
    font-family: 'Courier New', monospace;
    font-size: 10px;
    font-weight: 700;
    color: #a78bfa;
    background: rgba(139,92,246,0.12);
    border: 1px solid rgba(139,92,246,0.25);
    border-radius: 3px;
    padding: 0 5px;
    line-height: 1.6;
    flex-shrink: 0;
}

.dsnprm-select {
    background: var(--bg-primary, #14161a);
    border: 1px solid var(--border-color, #2a2d35);
    border-radius: 6px;
    color: var(--text-primary, #e8e8e8);
    font-family: inherit;
    font-size: 13px;
    padding: 8px 28px 8px 10px;
    outline: none;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
}
.dsnprm-select:focus {
    border-color: rgba(139,92,246,0.5);
    box-shadow: 0 0 0 3px rgba(139,92,246,0.1);
}
.dsnprm-select:hover:not(:focus) {
    border-color: rgba(255,255,255,0.15);
}

.dsnprm-custom-input {
    background: var(--bg-primary, #14161a);
    border: 1px solid rgba(139,92,246,0.35);
    border-radius: 6px;
    color: var(--text-primary, #e8e8e8);
    font-family: inherit;
    font-size: 13px;
    padding: 7px 10px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    width: 100%;
    margin-top: 4px;
}
.dsnprm-custom-input:focus {
    border-color: #a78bfa;
    box-shadow: 0 0 0 3px rgba(139,92,246,0.1);
}
.dsnprm-custom-input::placeholder {
    color: var(--text-muted, #555);
    font-style: italic;
}

/* ── Footer ── */
.dsnprm-footer {
    border-top: 1px solid var(--border-color, #2a2d35);
    padding: 16px 24px;
    background: var(--bg-primary, #14161a);
    border-radius: 0 0 16px 16px;
}

.dsnprm-prompt-section {
    margin-bottom: 12px;
}

.dsnprm-prompt-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted, #888);
    margin-bottom: 8px;
}

.dsnprm-prompt-preview {
    background: var(--bg-secondary, #1a1d23);
    border: 1px solid var(--border-color, #2a2d35);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-primary, #e8e8e8);
    max-height: 80px;
    overflow-y: auto;
    word-break: break-word;
}
.dsnprm-prompt-preview.dsnprm-prompt-empty {
    color: var(--text-muted, #555);
    font-style: italic;
}

.dsnprm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.dsnprm-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    border: 1px solid transparent;
    font-family: inherit;
}

.dsnprm-btn-secondary {
    background: transparent;
    border-color: var(--border-color, #2a2d35);
    color: var(--text-muted, #888);
}
.dsnprm-btn-secondary:hover {
    background: rgba(255,255,255,0.06);
    color: var(--text-primary, #e8e8e8);
}

.dsnprm-btn-primary {
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    color: white;
    border-color: rgba(139,92,246,0.5);
}
.dsnprm-btn-primary:hover {
    background: linear-gradient(135deg, #9d6ff8, #7c3aed);
    box-shadow: 0 4px 16px rgba(139,92,246,0.3);
}

/* ── Scrollbar ── */
.dsnprm-body::-webkit-scrollbar,
.dsnprm-prompt-preview::-webkit-scrollbar {
    width: 5px;
}
.dsnprm-body::-webkit-scrollbar-track,
.dsnprm-prompt-preview::-webkit-scrollbar-track {
    background: transparent;
}
.dsnprm-body::-webkit-scrollbar-thumb,
.dsnprm-prompt-preview::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
}
.dsnprm-body::-webkit-scrollbar-thumb:hover,
.dsnprm-prompt-preview::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.2);
}

/* ── Reference Image Buttons (Renderer Toolbar) ── */
.rndr-ref-upload {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    border: 1px dashed var(--border-color, #3a3d45);
    background: rgba(255,255,255,0.03);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    flex-shrink: 0;
    overflow: hidden;
}
.rndr-ref-upload:hover {
    border-color: rgba(139,92,246,0.5);
    background: rgba(139,92,246,0.08);
}
.rndr-ref-upload svg {
    color: var(--text-muted, #888);
    transition: color 0.15s;
}
.rndr-ref-upload:hover svg {
    color: #a78bfa;
}
.rndr-ref-upload img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 5px;
}
.rndr-ref-upload .rndr-ref-remove {
    position: absolute;
    top: -4px; right: -4px;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: #ef4444;
    border: none;
    color: white;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.15s;
    line-height: 1;
    padding: 0;
}
.rndr-ref-upload:hover .rndr-ref-remove {
    opacity: 1;
}

/* ── Responsive ── */
@media (max-width: 700px) {
    .dsnprm-fields-grid {
        grid-template-columns: 1fr;
    }
    .dsnprm-modal {
        width: 95vw;
    }
}
