/* Main Popup Overlay */
.mw-pdf-popup {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    opacity: 0;
    transition: opacity 0.5s ease;
}

/* Base resets inside the popup to prevent theme interference */
.mw-pdf-popup * {
    box-sizing: border-box;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Active & Closing States */
.mw-pdf-popup.active {
    opacity: 1;
}

.mw-pdf-popup.closing {
    opacity: 0 !important;
}

/* Premium Card */
.mw-popup-card {
    background: #ffffff;
    border-radius: 24px;
    width: 440px;
    max-width: 92%;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 0 0 1px rgba(255,255,255,0.1) inset,
        0 40px 80px -12px rgba(0, 0, 0, 0.5), 
        0 0 0 1px rgba(0,0,0,0.05);
    transform: translateY(40px) scale(0.9);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.5s ease;
    opacity: 0;
}

.mw-pdf-popup.active .mw-popup-card {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.mw-pdf-popup.closing .mw-popup-card {
    transform: translateY(-20px) scale(0.95);
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.4s ease;
}

/* Background & Header Design */
.mw-popup-header-bg {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%); /* Dark Locked State */
    padding: 40px 20px 30px;
    position: relative;
}

.mw-popup-header-bg.mw-unlocked-bg {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%); /* Green Success State */
}

.mw-popup-header-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.25) 1px, transparent 1px);
    background-size: 16px 16px;
    opacity: 0.6;
    pointer-events: none;
}

/* Top Icon Container */
.mw-popup-icon-wrapper {
    position: relative;
    z-index: 2;
    margin-bottom: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.mw-lock-icon-ring {
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.4);
    animation: pulseLockRing 2s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

@keyframes pulseLockRing {
    0% { transform: scale(0.8); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: scale(1.4); opacity: 0; }
}

.mw-lock-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 68px;
    height: 68px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-radius: 50%; /* Perfect Padlock Circle */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 8px 20px -4px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    z-index: 2;
}

/* Header Text */
.mw-popup-header-bg h2 {
    margin: 0;
    font-size: 28px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.5px;
    position: relative;
    z-index: 2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Body & Description */
.mw-popup-body {
    padding: 35px 32px 40px;
    background: #ffffff;
}

.mw-popup-desc {
    margin: 0 0 32px;
    font-size: 17px;
    color: #475569;
    line-height: 1.6;
    font-weight: 500;
}

/* Success Typography State */
.mw-task-completed {
    display: block;
    color: #10b981;
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
    animation: slideUpFade 0.5s ease forwards;
}

@keyframes slideUpFade {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Buttons */
.mw-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 18px;
    border-radius: 16px;
    text-decoration: none;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    width: 100%;
}

/* WhatsApp Primary Button */
.mw-primary {
    background: #25D366;
    color: #ffffff !important;
    box-shadow: 
        0 10px 20px -5px rgba(37, 211, 102, 0.4), 
        0 4px 6px -2px rgba(37, 211, 102, 0.1);
}

.mw-primary:hover {
    background: #20bd5a;
    transform: translateY(-3px);
    box-shadow: 
        0 15px 25px -5px rgba(37, 211, 102, 0.5), 
        0 8px 10px -2px rgba(37, 211, 102, 0.2);
    color: #ffffff !important;
}

.mw-primary:active {
    transform: translateY(0);
    box-shadow: 0 4px 6px -2px rgba(37, 211, 102, 0.3);
}

/* Success Checkmark Animation Elements */
.mw-success-anim {
    width: 72px;
    height: 72px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.2);
    animation: scaleIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes scaleIn {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

.mw-checkmark {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: block;
    stroke-width: 4;
    stroke: #16a34a;
    stroke-miterlimit: 10;
    box-shadow: inset 0px 0px 0px #16a34a;
}

.mw-checkmark__circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 3;
    stroke-miterlimit: 10;
    stroke: #16a34a;
    fill: none;
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.mw-checkmark__check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.6s forwards;
}

@keyframes stroke {
    100% {
        stroke-dashoffset: 0;
    }
}