/* ============================================================
   Variant Selection Panel — Design Studio
   Ticket #9486478256: Artist product variations upon saving
   ============================================================ */

/* ---------- overlay / panel container ---------- */
#variantPanel {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    width: 380px;
    height: 100vh;
    background: #1e1e2f;
    color: #fff;
    z-index: 10000;
    box-shadow: -4px 0 20px rgba(0,0,0,.45);
    overflow-y: auto;
    font-family: 'Quicksand', 'Segoe UI', sans-serif;
    transition: transform .3s ease;
}
#variantPanel.open {
    display: block;
    animation: vpSlideIn .3s ease forwards;
}
@keyframes vpSlideIn {
    from { transform: translateX(100%); }
    to   { transform: translateX(0); }
}

/* ---------- header ---------- */
#variantPanel .vp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 14px;
    border-bottom: 1px solid #2e2e44;
}
#variantPanel .vp-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #7ED6D3;
}
#variantPanel .vp-close {
    background: none;
    border: none;
    color: #aaa;
    font-size: 22px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
#variantPanel .vp-close:hover { color: #fff; }

/* ---------- progress bar ---------- */
.vp-progress {
    padding: 12px 20px 0;
}
.vp-progress-bar {
    height: 6px;
    background: #2e2e44;
    border-radius: 3px;
    overflow: hidden;
}
.vp-progress-fill {
    height: 100%;
    background: #7ED6D3;
    border-radius: 3px;
    transition: width .4s ease;
    width: 0%;
}
.vp-progress-text {
    font-size: 12px;
    color: #999;
    margin-top: 6px;
    text-align: right;
}

/* ---------- variant list ---------- */
.vp-list {
    padding: 10px 20px 20px;
    list-style: none;
    margin: 0;
}
.vp-item {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    margin-bottom: 10px;
    background: #272740;
    border: 2px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color .2s, background .2s;
    position: relative;
}
.vp-item:hover {
    background: #2f2f50;
}
.vp-item.active {
    border-color: #7ED6D3;
    background: #2a2a4a;
}
.vp-item.completed {
    border-color: #4caf50;
}
.vp-item.failed {
    border-color: #f44336;
}

/* checkbox */
.vp-check {
    width: 24px;
    height: 24px;
    min-width: 24px;
    border: 2px solid #555;
    border-radius: 6px;
    margin-right: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: transparent;
    transition: all .2s;
}
.vp-item.completed .vp-check {
    background: #4caf50;
    border-color: #4caf50;
    color: #fff;
}
.vp-item.failed .vp-check {
    background: #f44336;
    border-color: #f44336;
    color: #fff;
}

/* variant info */
.vp-info {
    flex: 1;
}
.vp-name {
    font-size: 14px;
    font-weight: 600;
    color: #e0e0e0;
    margin-bottom: 2px;
}
.vp-dims {
    font-size: 12px;
    color: #888;
}
.vp-status {
    font-size: 11px;
    margin-top: 4px;
    font-weight: 500;
}
.vp-status.pending  { color: #888; }
.vp-status.active   { color: #7ED6D3; }
.vp-status.done     { color: #4caf50; }
.vp-status.error    { color: #f44336; }

/* retry link */
.vp-retry {
    background: none;
    border: none;
    color: #f44336;
    font-size: 12px;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    margin-top: 2px;
    display: block;
}
.vp-retry:hover { color: #ff7961; }

/* thumbnail preview in variant row */
.vp-thumb {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    background: #1a1a2e;
    overflow: hidden;
    margin-left: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.vp-thumb img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* ---------- actions ---------- */
.vp-actions {
    padding: 0 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.vp-btn {
    display: block;
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: opacity .2s, background .2s;
}
.vp-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
}
.vp-btn-primary {
    background: #7ED6D3;
    color: #1e1e2f;
}
.vp-btn-primary:hover:not(:disabled) {
    background: #5ec5c1;
}
.vp-btn-secondary {
    background: #3a3a5c;
    color: #ccc;
}
.vp-btn-secondary:hover:not(:disabled) {
    background: #4a4a6c;
}

/* ---------- notification toast ---------- */
.vp-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #272740;
    color: #fff;
    padding: 16px 24px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,.4);
    font-size: 14px;
    z-index: 10001;
    display: none;
    max-width: 360px;
    border-left: 4px solid #7ED6D3;
}
.vp-toast.error {
    border-left-color: #f44336;
}
.vp-toast.success {
    border-left-color: #4caf50;
}
.vp-toast.show {
    display: block;
    animation: vpFadeIn .3s ease;
}
@keyframes vpFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---------- toggle button on main toolbar ---------- */
.vp-toggle-btn {
    display: none; /* hidden until product has variants */
    background: #7ED6D3;
    color: #1e1e2f;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    margin-left: 10px;
    white-space: nowrap;
}
.vp-toggle-btn.visible {
    display: inline-block;
}
.vp-toggle-btn:hover {
    background: #5ec5c1;
}

/* ---------- product info fields ---------- */
.vp-product-info {
    padding: 10px 15px;
    border-bottom: 1px solid #2e2e44;
}
.vp-product-info .form-group {
    margin-bottom: 8px;
}
.vp-product-info label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #7ED6D3;
    margin-bottom: 3px;
}
.vp-product-info input,
.vp-product-info textarea {
    width: 100%;
    font-size: 13px;
    padding: 6px 10px;
    background: #2e2e44;
    border: 1px solid #3e3e54;
    border-radius: 6px;
    color: #fff;
}
.vp-product-info input:focus,
.vp-product-info textarea:focus {
    border-color: #7ED6D3;
    outline: none;
}

/* ---------- detail area variants button ---------- */
.vp-toggle-btn-detail {
    margin-top: 4px;
}

/* ---------- processing overlay ---------- */
.vp-processing-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,.7);
    z-index: 10002;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}
.vp-processing-overlay.show {
    display: flex;
}
.vp-processing-box {
    background: #1e1e2f;
    border-radius: 14px;
    padding: 40px 50px;
    text-align: center;
    color: #fff;
    max-width: 420px;
}
.vp-processing-box h4 {
    margin: 20px 0 10px;
    color: #7ED6D3;
    font-size: 18px;
}
.vp-processing-box p {
    color: #999;
    font-size: 14px;
    margin: 0;
}
.vp-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #2e2e44;
    border-top-color: #7ED6D3;
    border-radius: 50%;
    animation: vpSpin .8s linear infinite;
    margin: 0 auto;
}
@keyframes vpSpin {
    to { transform: rotate(360deg); }
}
