.modal, .modal-overlay {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal.active, .modal-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #ffffff;
    margin: 5% auto;
    padding: 0;
    border-radius: 28px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    animation: modalSlide 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlide {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px;
    border-bottom: 1px solid #f1f5f9;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
}

.modal-body {
    padding: 32px;
}

.close-modal {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: var(--text-muted);
}

.close-modal:hover {
    color: var(--text-main);
}

#qrcode-wrapper {
    background: #f1f5f9;
    padding: 40px;
    border-radius: 20px;
    margin: 24px 0;
    display: flex;
    justify-content: center;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* --- PREMIUM SHARE MODAL --- */
.share-modal-premium {
    max-width: 500px !important;
    padding: 40px !important;
    position: relative;
    background: #ffffff;
    border: none !important;
    text-align: center;
}

.close-modal-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #f1f5f9;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
}

.close-modal-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
    transform: rotate(90deg);
}

.share-modal-header {
    margin-bottom: 32px;
}

.share-icon-wrapper {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin: 0 auto 20px;
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.2);
}

.share-modal-header h2 {
    font-size: 1.75rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.qr-container-premium {
    position: relative;
    width: 260px;
    height: 260px;
    margin: 0 auto 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border-radius: 32px;
    border: 1px solid #f1f5f9;
}

.qr-code-box {
    position: relative;
    z-index: 2;
    padding: 16px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.qr-scan-line {
    position: absolute;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.5), transparent);
    top: 0;
    animation: scanMove 3s ease-in-out infinite;
    z-index: 3;
}

@keyframes scanMove {

    0%,
    100% {
        top: 10%;
        opacity: 0;
    }

    50% {
        top: 90%;
        opacity: 1;
    }
}

.share-url-display {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f1f5f9;
    padding: 12px 16px;
    border-radius: 12px;
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
    color: #475569;
    margin-bottom: 32px;
    border: 1px solid #e2e8f0;
}

.share-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 32px;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.share-btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

.share-btn-secondary {
    background: #ffffff;
    color: #0f172a;
    border: 1px solid #e2e8f0;
}

.share-tips {
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: left;
    padding-top: 24px;
    border-top: 1px solid #f1f5f9;
}

.tip-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: #64748b;
}

/* --- CONFIRMATION MODAL --- */
.confirm-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.confirm-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.confirm-modal {
    background: white;
    width: 90%;
    max-width: 400px;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.2);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.confirm-modal-overlay.active .confirm-modal {
    transform: scale(1);
}

.confirm-icon {
    width: 60px;
    height: 60px;
    background: #fecdd3;
    color: #e11d48;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin: 0 auto 20px;
}

.confirm-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: #0f172a;
}

.confirm-desc {
    color: #64748b;
    margin-bottom: 30px;
    line-height: 1.5;
}

.confirm-actions {
    display: flex;
    gap: 12px;
}

.confirm-actions button {
    flex: 1;
    padding: 12px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-size: 0.95rem;
}

.confirm-btn-cancel {
    background: #f1f5f9;
    color: #475569;
}

.confirm-btn-danger {
    background: #ef4444;
    color: white;
}

/* --- NOTIFICATION PREVIEW (Campaign) --- */
.notification-preview-container {
    background: #f1f5f9;
    padding: 24px;
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    width: 300px;
    margin-left: 24px;
}

.mock-phone-lock {
    background: #000000;
    border-radius: 36px;
    padding: 12px;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.3);
    border: 4px solid #1e293b;
    position: relative;
    overflow: hidden;
    min-height: 400px;
}

.mock-phone-lock::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 24px;
    background: #1e293b;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    z-index: 10;
}

.mock-notification {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 16px;
    margin-top: 50px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
}

.notif-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.notif-header .app-icon {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    background: var(--gradient);
}

.notif-header .app-name {
    font-size: 0.65rem;
    font-weight: 700;
    color: #1e293b;
}

.notif-title {
    font-size: 0.75rem;
    font-weight: 800;
    margin-bottom: 2px;
}

.notif-body {
    font-size: 0.7rem;
    color: #475569;
    line-height: 1.3;
}

/* Mobile Overrides for Modals */
@media (max-width: 768px) {
    .modal-content {
        margin: 10% auto;
        padding: 20px;
        width: 95% !important;
    }

    .notification-preview-container {
        display: block !important;
        background: transparent;
        padding: 0;
        width: 100%;
        max-width: 250px;
        margin: 0 auto 24px auto;
        order: -1;
    }

    .mock-phone-lock {
        min-height: 250px;
        border-radius: 24px;
    }

    .mock-phone-lock::before {
        width: 80px;
        height: 18px;
    }

    .mock-notification {
        margin-top: 32px;
    }
}

@media (max-width: 600px) {
    .share-icon-wrapper {
        width: 48px;
        height: 48px;
        margin-bottom: 16px;
    }

    .qr-container-premium {
        width: 200px;
        height: 200px;
    }

    .qr-code-box {
        padding: 10px;
    }

    .share-url-display {
        font-size: 0.75rem;
        padding: 8px 12px;
    }
}

@keyframes premiumModalIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(30px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-content.share-modal-premium {
    animation: premiumModalIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes notificationPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
    }

    100% {
        transform: scale(1);
    }
}

.mock-notification {
    animation: notificationPulse 2s infinite;
}