/* ==========================================================================
   Gemini AI Enhancement — close-friend theme
   Enqueued by mp_nano_banana_enhance_script() in GeminiAI.php.
   ========================================================================== */

/* ── Shared AI buttons ─────────────────────────────────────────────────── */

.mp-nano-banana-btn {
    background: #000;
    color: #fff;
    padding: 10px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.mp-nano-banana-btn:hover {
    opacity: 0.9;
}

.mp-nano-banana-btn:disabled,
.mp-gen-ai-btn:disabled {
    opacity: 1;
    cursor: not-allowed;
    transform: none;
}

/* ── Generate-using-AI editor wrapper ──────────────────────────────────── */

.mp-gen-ai-editor-wrap {
    margin-top: -70px;
    text-align: left;
    position: relative;
    z-index: 5;
    padding-right: 8px;
    padding-bottom: 6px;
    pointer-events: none;
}
.mp-gen-ai-editor-wrap > * {
    pointer-events: all;
}

/* ── Locked / premium variant ──────────────────────────────────────────── */

.mp-gen-ai-btn--locked {
    opacity: 0.65;
    cursor: default !important;
    transform: none !important;
}

.mp-gen-ai-locked-wrap {
    position: relative;
    margin-bottom: 50px;
    margin-right: 8px;
    text-align: right;
}

/* Transparent bridge: fills the gap so the mouse never leaves the wrap
   while moving from the button up to the tooltip link.                 */
.mp-gen-ai-locked-wrap::after {
    content: '';
    display: block;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 100%;
    height: 10px;
}

.mp-gen-ai-premium-tip {
    display: none;
    position: absolute;
    bottom: calc(100% + 10px);
    right: 0;
    background: #1f2937;
    color: #f9fafb;
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 4px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    z-index: 20;
}

.mp-gen-ai-premium-tip a {
    color: #93c5fd;
    text-decoration: underline;
}

.mp-gen-ai-locked-wrap:hover .mp-gen-ai-premium-tip {
    display: block;
}

/* ── Loader / spinner ──────────────────────────────────────────────────── */

.mp-nano-loader {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: mp-spin 1s ease-in-out infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes mp-spin {
    to { transform: rotate(360deg); }
}

/* ── Notice banners ────────────────────────────────────────────────────── */

.mp-nano-notice {
    padding: 10px;
    border-radius: 4px;
    font-size: 13px;
}

.mp-nano-notice.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.mp-nano-notice.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.mp-nano-notice.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* ── Enhancement preview ───────────────────────────────────────────────── */

.mp-nano-preview-container {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.mp-nano-preview-title {
    font-weight: 600;
    margin-bottom: 10px;
    color: #495057;
}

.mp-nano-preview-image {
    max-width: 300px;
    max-height: 300px;
    border-radius: 8px;
    border: 3px solid #4285f4;
    padding: 3px;
    background: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* ── Progress bar (legacy, kept for gallery modal) ─────────────────────── */

.mp-nano-progress-bar {
    width: 100%;
    height: 4px;
    background: #e9ecef;
    border-radius: 2px;
    margin: 15px 0;
    overflow: hidden;
}

.mp-nano-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4285f4, #34a853);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 2px;
}

/* ── Enhancement type options ──────────────────────────────────────────── */

.mp-nano-edit-options {
    margin-top: 15px;
    padding: 10px;
    background: white;
    border-radius: 4px;
}

.mp-nano-edit-options select,
.mp-nano-edit-options textarea {
    width: 100%;
    padding: 8px;
    margin: 5px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}

.mp-nano-use-button {
    margin-top: 10px;
    padding: 8px 16px;
    background: #34a853;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
}

.mp-nano-use-button:hover {
    background: #2d8e47;
}

/* ── Progress steps (legacy, kept for compatibility) ───────────────────── */

.mp-nano-progress-steps {
    margin: 10px 0;
    font-size: 13px;
    color: #666;
}

.mp-nano-step {
    margin: 5px 0;
    padding: 3px 0;
}

.mp-nano-step.active    { color: #4285f4; font-weight: 500; }
.mp-nano-step.completed { color: #34a853; }

/* =========================================================================
   NEW PROGRESS CARD DESIGN — responsive down to 320px
   ========================================================================= */

/* ── Card wrapper ──────────────────────────────────────────────────────── */
.mp-progress-card {
    background: #fff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 12px !important;
    padding: 0 !important;
    overflow: hidden !important;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08) !important;
    margin-top: 15px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* ── Header ────────────────────────────────────────────────────────────── */
.mp-progress-header {
    display: flex !important;
    align-items: center !important;
    gap: 16px !important;
    padding: 20px 20px 16px !important;
    flex-wrap: nowrap !important;
    box-sizing: border-box !important;
}

.mp-progress-header-text {
    flex: 1 !important;
    min-width: 0 !important;
}

.mp-progress-header-text h3 {
    margin: 0 0 4px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    color: #111827 !important;
    line-height: 1.3 !important;
}

.mp-progress-header-text p {
    margin: 0 !important;
    font-size: 13px !important;
    color: #6b7280 !important;
    line-height: 1.4 !important;
}

/* ── Circular progress ─────────────────────────────────────────────────── */
.mp-circular-progress {
    position: relative !important;
    width: 68px !important;
    height: 68px !important;
    flex-shrink: 0 !important;
}

.mp-circle-svg {
    width: 68px !important;
    height: 68px !important;
    display: block !important;
    transform: rotate(-90deg) !important;
}

.mp-circle-bg {
    fill: none !important;
    stroke: #e5e7eb !important;
    stroke-width: 7 !important;
}

.mp-circle-fill {
    fill: none !important;
    stroke: #3b82f6 !important;
    stroke-width: 7 !important;
    stroke-linecap: round !important;
    transition: stroke-dashoffset 0.6s ease !important;
}

.mp-circle-pct {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    color: #1d4ed8 !important;
}

/* ── Divider ───────────────────────────────────────────────────────────── */
.mp-progress-divider {
    height: 1px !important;
    background: #f3f4f6 !important;
    margin: 0 !important;
}

/* ── Steps wrapper ─────────────────────────────────────────────────────── */
.mp-steps-wrapper {
    padding: 16px 16px 8px !important;
    box-sizing: border-box !important;
    width: 100% !important;
}

/* ── Each step row: left column (dot+line) + right card ────────────────── */
.mp-step-row {
    display: flex !important;
    align-items: stretch !important;
    gap: 0 !important;
    margin-bottom: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* ── Left column: dot + vertical line ─────────────────────────────────── */
.mp-step-left {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    width: 24px !important;
    min-width: 24px !important;
    flex-shrink: 0 !important;
    padding-top: 18px !important;
    margin-right: 12px !important;
}

.mp-dot {
    width: 13px !important;
    height: 13px !important;
    border-radius: 50% !important;
    flex-shrink: 0 !important;
    display: block !important;
    transition: all 0.3s ease !important;
}

.mp-dot-done  { background: #22c55e !important; border: 2px solid #22c55e !important; }
.mp-dot-active { background: #fff !important; border: 2.5px solid #3b82f6 !important; box-shadow: 0 0 0 3px rgba(59,130,246,0.18) !important; }
.mp-dot-pending { background: #fff !important; border: 2px solid #d1d5db !important; }

/* vertical line — only shown when .mp-vline exists (between steps 1-2, 2-3) */
.mp-vline {
    width: 2px !important;
    flex: 1 !important;
    min-height: 16px !important;
    background: #e5e7eb !important;
    margin-top: 3px !important;
    display: block !important;
    transition: background 0.4s ease !important;
}

.mp-vline-done { background: #22c55e !important; }

/* ── Right: step card ──────────────────────────────────────────────────── */
.mp-step-card {
    flex: 1 !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 12px 12px !important;
    border: 1.5px solid #f0f0f0 !important;
    border-radius: 10px !important;
    background: #fafafa !important;
    margin-bottom: 10px !important;
    box-sizing: border-box !important;
    min-width: 0 !important;
    flex-wrap: nowrap !important;
}

.mp-step-card-active {
    background: #eff6ff !important;
    border-color: #bfdbfe !important;
    box-shadow: 0 1px 6px rgba(59,130,246,0.1) !important;
}

.mp-step-card-done {
    background: #f0fdf4 !important;
    border-color: #bbf7d0 !important;
}

/* ── Icon box ──────────────────────────────────────────────────────────── */
.mp-step-icon-wrap {
    width: 38px !important;
    height: 38px !important;
    border-radius: 9px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    transition: all 0.3s ease !important;
}

.mp-step-icon-done    { background: #dcfce7 !important; color: #16a34a !important; }
.mp-step-icon-active  { background: #dbeafe !important; color: #2563eb !important; }
.mp-step-icon-pending { background: #f3f4f6 !important; color: #9ca3af !important; }

/* ── Step number badge ─────────────────────────────────────────────────── */
.mp-step-num {
    width: 20px !important;
    height: 20px !important;
    border-radius: 50% !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    transition: all 0.3s ease !important;
}

.mp-step-num-done    { background: #22c55e !important; color: #fff !important; }
.mp-step-num-active  { background: #3b82f6 !important; color: #fff !important; }
.mp-step-num-pending { background: #e5e7eb !important; color: #6b7280 !important; }

/* ── Step texts ────────────────────────────────────────────────────────── */
.mp-step-texts {
    flex: 1 !important;
    min-width: 0 !important;
    display: block !important;
}

.mp-step-texts strong {
    display: block !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #111827 !important;
    line-height: 1.3 !important;
    white-space: normal !important;
}

.mp-step-texts span {
    display: block !important;
    font-size: 11.5px !important;
    color: #6b7280 !important;
    line-height: 1.4 !important;
    white-space: normal !important;
}

/* ── Status badge ──────────────────────────────────────────────────────── */
.mp-step-badge {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    padding: 4px 9px !important;
    border-radius: 6px !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    border: 1.5px solid transparent !important;
    transition: all 0.3s ease !important;
}

.mp-badge-done       { background: #f0fdf4 !important; color: #16a34a !important; border-color: #bbf7d0 !important; }
.mp-badge-processing { background: #eff6ff !important; color: #2563eb !important; border-color: #bfdbfe !important; }
.mp-badge-pending    { background: #f9fafb !important; color: #9ca3af !important; border-color: #e5e7eb !important; }

/* ── Badge spinner ─────────────────────────────────────────────────────── */
.mp-badge-spinner {
    display: inline-block !important;
    width: 11px !important;
    height: 11px !important;
    border: 2px solid rgba(37,99,235,0.25) !important;
    border-top-color: #2563eb !important;
    border-radius: 50% !important;
    animation: mp-spin 0.8s linear infinite !important;
    flex-shrink: 0 !important;
}

/* ── Footer bar ────────────────────────────────────────────────────────── */
.mp-progress-footer {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 11px 16px !important;
    background: #f8faff !important;
    border-top: 1px solid #e5e7eb !important;
    font-size: 12px !important;
    color: #374151 !important;
    box-sizing: border-box !important;
    width: 100% !important;
}

.mp-progress-footer svg { color: #6b7280 !important; flex-shrink: 0 !important; }
.mp-progress-footer strong { font-weight: 600 !important; color: #111827 !important; }

/* =========================================================================
   RESPONSIVE — 600px and below
   ========================================================================= */
@media (max-width: 600px) {
    .mp-progress-header { gap: 12px !important; padding: 14px 14px 12px !important; }
    .mp-circular-progress { width: 54px !important; height: 54px !important; }
    .mp-circle-svg { width: 54px !important; height: 54px !important; }
    .mp-circle-pct { font-size: 11px !important; }
    .mp-progress-header-text h3 { font-size: 14px !important; }
    .mp-progress-header-text p { font-size: 12px !important; }
    .mp-steps-wrapper { padding: 12px 10px 4px !important; }
    .mp-step-left { width: 20px !important; min-width: 20px !important; margin-right: 8px !important; padding-top: 14px !important; }
    .mp-dot { width: 11px !important; height: 11px !important; }
    .mp-step-card { padding: 10px 8px !important; gap: 7px !important; }
    .mp-step-icon-wrap { width: 32px !important; height: 32px !important; border-radius: 7px !important; }
    .mp-step-icon-wrap svg { width: 16px !important; height: 16px !important; }
    .mp-step-num { width: 18px !important; height: 18px !important; font-size: 10px !important; }
    .mp-step-texts strong { font-size: 12px !important; }
    .mp-step-texts span { font-size: 11px !important; }
    .mp-step-badge { font-size: 10px !important; padding: 3px 7px !important; }
    .mp-progress-footer { padding: 10px 12px !important; font-size: 11px !important; }
}

/* =========================================================================
   RESPONSIVE — 400px and below (includes 320px)
   ========================================================================= */
@media (max-width: 400px) {
    .mp-progress-header { gap: 8px !important; padding: 12px 10px 10px !important; }
    .mp-circular-progress { width: 46px !important; height: 46px !important; }
    .mp-circle-svg { width: 46px !important; height: 46px !important; }
    .mp-circle-pct { font-size: 10px !important; }
    .mp-progress-header-text h3 { font-size: 13px !important; }
    .mp-progress-header-text p { font-size: 11px !important; }
    .mp-steps-wrapper { padding: 10px 8px 4px !important; }
    .mp-step-left { width: 16px !important; min-width: 16px !important; margin-right: 6px !important; }
    .mp-step-card { padding: 8px 6px !important; gap: 5px !important; margin-bottom: 8px !important; }
    .mp-step-icon-wrap { width: 28px !important; height: 28px !important; border-radius: 6px !important; }
    .mp-step-icon-wrap svg { width: 14px !important; height: 14px !important; }
    .mp-step-num { width: 16px !important; height: 16px !important; font-size: 9px !important; }
    .mp-step-texts strong { font-size: 11px !important; }
    .mp-step-texts span { font-size: 10px !important; }
    .mp-step-badge { font-size: 9px !important; padding: 3px 5px !important; gap: 3px !important; }
    .mp-step-badge svg { width: 9px !important; height: 9px !important; }
    .mp-progress-footer { padding: 8px 10px !important; font-size: 10.5px !important; gap: 6px !important; }
    .mp-progress-footer svg { width: 13px !important; height: 13px !important; }
}

/* ── Gallery image enhancement ─────────────────────────────────────────── */

.mp-gallery-enhance-btn {
    display: inline-block;
    width: 100%;
    margin-left: 5px;
    padding: 4px 8px;
    background: linear-gradient(135deg, #4285f4 0%, #34a853 100%);
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    vertical-align: middle;
}

.mp-gallery-enhance-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.mp-gallery-enhance-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.mp_pro_image_gallary {
    position: relative;
    display: inline-block;
    margin: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 5px;
    background: #f9f9f9;
}

.mp_pro_image_gallary img {
    max-width: 100px;
    max-height: 100px;
    border-radius: 3px;
    display: block;
    margin-bottom: 5px;
}

.mp-gallery-actions {
    display: flex;
    gap: 5px;
    justify-content: center;
    margin-top: 5px;
}

.mp-gallery-progress-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(255,255,255,0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 20;
    border-radius: 4px;
}

.mp-gallery-loader {
    width: 30px; height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #4285f4;
    border-radius: 50%;
    animation: mp-spin 1s linear infinite;
    margin-bottom: 10px;
}

/* ── Gallery modal ─────────────────────────────────────────────────────── */

.mp-gallery-modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 9999;
    overflow: auto;
}

.mp-gallery-modal-content {
    background: white;
    margin: 50px auto;
    padding: 20px;
    max-width: 300px;
    border-radius: 8px;
    position: relative;

}

.mp-gallery-modal-close {
    position: absolute;
    top: 10px; right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}
.mp-gallery-modal-close:hover { color: #000; }

.mp-gallery-enhance-options { margin: 20px 0; }

.mp-gallery-preview {
    text-align: center;
    margin: 20px 0;
}
.mp-gallery-preview img {
    width: 250px;
    max-width: 100%;
    max-height: 100%;
    border-radius: 4px;
    border: 2px solid #ddd;
}

.mp-gallery-replace-btn {
    background: #505050;
    color: white;
    border: none;
    padding: 10px 30px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-right: 10px;
}
.mp-gallery-replace-btn:hover { background: #8c8c8c; }

.mp-gallery-cancel-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}
.mp-gallery-cancel-btn:hover { background: #c82333; }

@media (max-width: 685px) {
   .mp-gallery-preview-container .mp-gallery-replace-btn {
        width: 100%;
       
    }
    .mp-gallery-preview-container .mp-gallery-cancel-btn {
        width: 100%;
        margin-top: 10px;
}}

.mp-img-delete_gal {
    color: #ff0000;
    text-decoration: none;
    font-size: 11px;
    display: inline-block;
}
.mp-img-delete_gal:hover { text-decoration: underline; }

/* ── Category check notices ────────────────────────────────────────────── */

.mp-category-notice {
    margin-top: 10px;
    padding: 10px;
    border-radius: 4px;
    font-size: 13px;
}
.mp-category-notice.success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.mp-category-notice.error   { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.mp-category-notice.info    { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }

#mp-gallery-category-notice {
    margin-top: 10px;
    padding: 10px;
    border-radius: 4px;
    font-size: 13px;
    display: none;
}
#mp-gallery-category-notice.success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
#mp-gallery-category-notice.error   { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
#mp-gallery-category-notice.info    { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }

/* ── Pending gallery image wrapper ─────────────────────────────────────── */
.mp-pending-gallery-item {
    display: inline-block;
    position: relative;
    margin: 5px;
    vertical-align: top;
}
.mp-pending-gallery-item img {
    width: 50px; height: 50px;
    object-fit: cover;
    border-radius: 3px;
    border: 1px solid #ddd;
    display: block;
}
.mp-pending-remove-btn {
    display: block;
    color: #ff0000;
    font-size: 11px;
    cursor: pointer;
    text-align: center;
    margin-top: 3px;
    text-decoration: none;
    background: none;
    border: none;
    padding: 0;
}
.mp-pending-remove-btn:hover { text-decoration: underline; color: #cc0000; }

.mp-gallery-modal-content h3 {
    padding-bottom: 10px;
    border-bottom: 1px solid #c6c6c6;
}
.mp-gallery-enhance-options .mp-gallery-select
{
    border: 1px solid #ddd;
}
.mp-gallery-preview-container h4 {
    padding-bottom: 10px;
    border-bottom: 1px solid #c6c6c6;
}
.mp-gallery-preview-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    z-index: 10000;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
    max-width: 350px;
}
@media (max-width: 768px) {
    
    .mp-gallery-preview-container {
        width:300px !important;
    }
}
/* ==========================================================================
   Category-check toast — fixed bottom-right, visible from any product tab.
   ========================================================================== */
#mp-toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 360px;
    pointer-events: none;
}
.mp-toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #fff;
    color: #1f2937;
    padding: 14px 16px;
    border-radius: 8px;
    border-left: 4px solid #6b7280;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    font-size: 14px;
    line-height: 1.4;
    opacity: 0;
    transform: translateX(120%);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: auto;
}
.mp-toast.mp-toast-show {
    opacity: 1;
    transform: translateX(0);
}
.mp-toast-error  { border-left-color: #dc2626; }
.mp-toast-success { border-left-color: #16a34a; }
.mp-toast-info   { border-left-color: #2563eb; }
.mp-toast-msg { flex: 1; }
.mp-toast-close {
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    color: #9ca3af;
    flex-shrink: 0;
}
.mp-toast-close:hover { color: #4b5563; }
@media (max-width: 768px) {
    #mp-toast-container {
        left: 12px;
        right: 12px;
        bottom: 12px;
        max-width: none;
    }
}
