/* =========================================================================
   Custom Popup & Notification System (Shopify / Polaris Standard)
   Modern, minimal, clean UI for in-app toasts & confirmation modals.
   Single source of truth for the entire platform.
   ========================================================================= */

/* Backdrop Overlay */
.custom-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.custom-modal-backdrop.show-popup {
    display: flex !important;
    opacity: 1;
}

/* Compact Modal Card */
.custom-popup-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 24px 20px 20px;
    width: 100%;
    max-width: 340px;
    text-align: center;
    box-shadow: 0 20px 35px -10px rgba(15, 23, 42, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.04);
    transform: scale(0.94);
    opacity: 0;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
}
.custom-modal-backdrop.show-popup .custom-popup-card {
    transform: scale(1);
    opacity: 1;
}

/* Clean Icon Badge */
.popup-icon-badge {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    margin: 0 auto 14px auto;
    flex-shrink: 0;
}
.popup-icon-badge.danger {
    background: #fee2e2;
    color: #dc2626;
}
.popup-icon-badge.warning {
    background: #fef3c7;
    color: #d97706;
}
.popup-icon-badge.success {
    background: #f1f5f9;
    color: #0f172a;
}
.popup-icon-badge.info {
    background: #e0e7ff;
    color: #4f46e5;
}

/* Modal Typography */
.popup-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 6px 0;
    line-height: 1.35;
}
.popup-text {
    font-size: 0.86rem;
    color: #64748b;
    margin: 0 0 18px 0;
    line-height: 1.45;
    word-break: break-word;
}

/* Input for Prompts */
.popup-input-wrap {
    margin-bottom: 16px;
}
.popup-input {
    width: 100%;
    padding: 9px 12px;
    border-radius: 8px;
    border: 1.5px solid #cbd5e1;
    outline: none;
    font-size: 0.88rem;
    color: #0f172a;
    box-sizing: border-box;
    transition: all 0.2s ease;
    text-align: left;
}
.popup-input:focus {
    border-color: #0f172a;
    box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08);
}

/* Action Buttons (2 Equal Columns) */
.popup-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 4px;
}
.btn-popup {
    padding: 9px 14px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.86rem;
    border: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.16s ease;
    cursor: pointer;
    width: 100%;
}
.btn-popup:hover {
    transform: translateY(-1px);
}
.btn-popup:active {
    transform: translateY(0);
}

.btn-popup-danger {
    background: #dc2626;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.25);
}
.btn-popup-danger:hover {
    background: #b91c1c;
    box-shadow: 0 4px 10px rgba(220, 38, 38, 0.35);
}

.btn-popup-cancel {
    background: #f1f5f9;
    color: #334155 !important;
    border: 1px solid #e2e8f0;
}
.btn-popup-cancel:hover {
    background: #e2e8f0;
    color: #0f172a !important;
}

.btn-popup-success {
    background: #0f172a;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.2);
}
.btn-popup-success:hover {
    background: #1e293b;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.3);
}

/* =======================================================
   TOAST NOTIFICATIONS (TOP-RIGHT - SINGLE SOLID ELEGANT THEME)
   ======================================================= */
#cpToastContainer {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 340px;
    width: calc(100% - 32px);
    pointer-events: none;
}
.cp-toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 10px 14px;
    box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -4px rgba(0, 0, 0, 0.2);
    font-size: 0.85rem;
    font-weight: 500;
    color: #f8fafc;
    opacity: 0;
    transform: translateY(-8px) scale(0.97);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.cp-toast.cp-toast-show {
    opacity: 1;
    transform: translateY(0) scale(1);
}
.cp-toast-icon {
    font-size: 1rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
}
.cp-toast-message {
    flex: 1;
    line-height: 1.35;
    word-break: break-word;
    color: #f8fafc;
}

/* Single unified icon tone - No green lines or clashes */
.cp-toast-success .cp-toast-icon { color: #38bdf8; }
.cp-toast-error .cp-toast-icon, .cp-toast-danger .cp-toast-icon { color: #f87171; }
.cp-toast-warning .cp-toast-icon { color: #fbbf24; }
.cp-toast-info .cp-toast-icon { color: #94a3b8; }

@media (max-width: 480px) {
    #cpToastContainer {
        top: 12px;
        right: 12px;
        left: 12px;
        max-width: none;
    }
    .custom-popup-card {
        padding: 20px 16px;
        border-radius: 14px;
    }
}
