/**
 * WooMazing Web Push Frontend Styles
 * Responsive, elegant opt-in card, bottom sheet, floating bell & toasts.
 * 
 * @package WooMazing
 * @version 2.4.23
 */

/* ==========================================================================
   Floating Bell Widget
   ========================================================================== */
.wm-push-bell {
    position: fixed;
    z-index: 99998;
    bottom: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7C3AED 0%, #6366F1 100%);
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.35), 0 2px 6px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px solid #ffffff;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.wm-push-bell.wm-pos-right {
    right: 24px;
}
.wm-push-bell.wm-pos-left {
    left: 24px;
}
.wm-push-bell:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 12px 28px rgba(124, 58, 237, 0.45), 0 4px 10px rgba(0,0,0,0.15);
}
.wm-push-bell svg {
    width: 24px;
    height: 24px;
    fill: #ffffff;
    transition: transform 0.3s ease;
}
.wm-push-bell:hover svg {
    animation: wm-bell-ring 0.6s ease infinite;
}
.wm-push-bell-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #EF4444;
    border: 2px solid #ffffff;
    animation: wm-bell-pulse 2s infinite;
}
.wm-push-bell.subscribed .wm-push-bell-badge {
    background: #10B981;
    animation: none;
}

/* Floating Tooltip */
.wm-push-bell-tooltip {
    position: absolute;
    bottom: 58px;
    background: #1E293B;
    color: #F8FAFC;
    font-size: 11.5px;
    padding: 6px 12px;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    transform: translateY(4px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.2);
    font-family: inherit;
    font-weight: 500;
}
.wm-push-bell.wm-pos-right .wm-push-bell-tooltip {
    right: 0;
}
.wm-push-bell.wm-pos-left .wm-push-bell-tooltip {
    left: 0;
}
.wm-push-bell:hover .wm-push-bell-tooltip {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   Opt-in Prompt Card (Desktop Floating & Mobile Bottom Sheet)
   ========================================================================== */
#wm-push-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
#wm-push-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.wm-push-card {
    position: fixed;
    z-index: 100000;
    bottom: 24px;
    width: 380px;
    max-width: calc(100vw - 32px);
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 20px 45px -10px rgba(124, 58, 237, 0.25), 0 0 0 1px rgba(124, 58, 237, 0.12), 0 10px 25px -5px rgba(0,0,0,0.08);
    padding: 22px 20px 18px;
    box-sizing: border-box;
    font-family: inherit;
    direction: rtl;
    text-align: right;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.96);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.35s;
}
.wm-push-card.wm-pos-right {
    right: 24px;
}
.wm-push-card.wm-pos-left {
    left: 24px;
}
.wm-push-card.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Top Badge */
.wm-push-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.wm-push-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    color: #7C3AED;
    background: #F3E8FF;
    padding: 4px 12px;
    border-radius: 50px;
    letter-spacing: -0.2px;
}
/* Close Button (X) */
#wm-push-card .wm-push-close-btn,
button.wm-push-close-btn {
    background: #F1F5F9 !important;
    border: 1px solid #E2E8F0 !important;
    color: #64748B !important;
    font-size: 18px !important;
    cursor: pointer !important;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    max-width: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
    line-height: 1 !important;
    padding: 0 !important;
    box-shadow: none !important;
}
#wm-push-card .wm-push-close-btn:hover,
button.wm-push-close-btn:hover {
    background: #E2E8F0 !important;
    color: #0F172A !important;
    transform: rotate(90deg) scale(1.05) !important;
}

/* Body Content */
.wm-push-content {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 18px;
}
.wm-push-icon-box {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 16px;
    background: linear-gradient(135deg, #FAF5FF 0%, #EDE9FE 100%);
    border: 1px solid #DDD6FE;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.1);
    overflow: hidden;
}
.wm-push-icon-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 15px;
}
.wm-push-icon-box svg {
    width: 26px;
    height: 26px;
    fill: #7C3AED;
}

.wm-push-text {
    flex: 1;
}
.wm-push-title {
    font-size: 15px;
    font-weight: 800;
    color: #1E293B;
    margin: 0 0 6px 0;
    line-height: 1.45;
}
.wm-push-desc {
    font-size: 12.5px;
    color: #475569;
    margin: 0;
    line-height: 1.65;
}

/* Action Buttons */
.wm-push-actions {
    display: flex;
    gap: 10px;
}
#wm-push-card .wm-push-btn-accept,
button.wm-push-btn-accept {
    flex: 1 !important;
    background: linear-gradient(135deg, #7C3AED 0%, #6366F1 100%) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 50px !important;
    padding: 12px 22px !important;
    min-height: 44px !important;
    font-size: 13.5px !important;
    font-weight: 700 !important;
    font-family: inherit !important;
    cursor: pointer !important;
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease !important;
    text-decoration: none !important;
}
#wm-push-card .wm-push-btn-accept:hover,
button.wm-push-btn-accept:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.45) !important;
}
#wm-push-card .wm-push-btn-accept:active,
button.wm-push-btn-accept:active {
    transform: translateY(1px) !important;
}
#wm-push-card .wm-push-btn-dismiss,
button.wm-push-btn-dismiss {
    background: #F8FAFC !important;
    color: #64748B !important;
    border: 1px solid #CBD5E1 !important;
    border-radius: 50px !important;
    padding: 12px 20px !important;
    min-height: 44px !important;
    font-size: 12.5px !important;
    font-weight: 600 !important;
    font-family: inherit !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: none !important;
    transition: background 0.15s ease, color 0.15s ease !important;
    text-decoration: none !important;
}
#wm-push-card .wm-push-btn-dismiss:hover,
button.wm-push-btn-dismiss:hover {
    background: #F1F5F9 !important;
    color: #334155 !important;
}

/* Toast Message */
.wm-push-toast {
    position: fixed;
    z-index: 100001;
    bottom: 24px;
    right: 24px;
    background: #065F46;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    padding: 12px 20px;
    border-radius: 14px;
    box-shadow: 0 10px 25px rgba(6, 95, 70, 0.35);
    direction: rtl;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}
.wm-push-toast.active {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   Mobile Bottom Sheet Responsiveness
   ========================================================================== */
@media (max-width: 640px) {
    .wm-push-card {
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 22px 22px 0 0 !important;
        padding: 12px 18px 24px !important;
        padding-bottom: max(24px, env(safe-area-inset-bottom)) !important;
        transform: translateY(100%) !important;
        box-shadow: 0 -10px 30px rgba(0,0,0,0.15) !important;
    }
    .wm-push-card.active {
        transform: translateY(0) !important;
    }
    .wm-push-drag-handle {
        width: 36px;
        height: 4px;
        background: #CBD5E1;
        border-radius: 2px;
        margin: 0 auto 12px;
        display: block;
    }
    .wm-push-actions {
        flex-direction: column;
        gap: 8px;
    }
    .wm-push-btn-accept,
    .wm-push-btn-dismiss {
        width: 100%;
        text-align: center;
        justify-content: center;
        padding: 13px 20px;
        border-radius: 50px !important;
    }
    .wm-push-bell {
        bottom: calc(55px + env(safe-area-inset-bottom, 0px) + 16px) !important;
        width: 44px;
        height: 44px;
    }
    .wm-push-bell.wm-pos-right {
        right: 16px;
    }
    .wm-push-bell.wm-pos-left {
        left: 16px;
    }
}

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes wm-bell-ring {
    0% { transform: rotate(0); }
    15% { transform: rotate(14deg); }
    30% { transform: rotate(-14deg); }
    45% { transform: rotate(10deg); }
    60% { transform: rotate(-10deg); }
    75% { transform: rotate(4deg); }
    100% { transform: rotate(0); }
}

@keyframes wm-bell-pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}
