/* ==============================================================================
 * ÔN LUYỆN SGK & DEEPTUTOR AI — PAYWALL & VIRAL GROWTH ENGINE
 * Triết lý Ponytail: Native Web API, Zero Bloat, Pure Glassmorphism CSS
 * ============================================================================== */

/* 1. Glassmorphism Backdrop Overlay */
.nm-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.78);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    box-sizing: border-box;
    opacity: 0;
    transition: opacity 0.25s ease-out;
}
.nm-modal-backdrop.is-open {
    display: flex;
    opacity: 1;
}

/* 2. Glassmorphism Modal Card */
.nm-modal-card {
    background: rgba(255, 255, 255, 0.96);
    border: 1.5px solid rgba(255, 255, 255, 0.8);
    border-radius: 24px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35), 0 0 40px rgba(245, 158, 11, 0.15);
    width: 100%;
    max-width: 620px;
    max-height: 92vh;
    overflow-y: auto;
    padding: 1.75rem;
    position: relative;
    box-sizing: border-box;
    transform: scale(0.95) translateY(20px);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.nm-modal-backdrop.is-open .nm-modal-card {
    transform: scale(1) translateY(0);
}

/* Close Button */
.nm-modal-close-btn {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #475569;
    font-size: 1.25rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
}
.nm-modal-close-btn:hover {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fca5a5;
    transform: rotate(90deg);
}

/* Modal Header */
.nm-paywall-header {
    text-align: center;
    margin-bottom: 1.5rem;
}
.nm-vip-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
    color: white;
    padding: 0.35rem 0.95rem;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
    margin-bottom: 0.75rem;
}
.nm-paywall-title {
    font-size: 1.45rem;
    font-weight: 900;
    color: #0f172a;
    line-height: 1.35;
    margin: 0 0 0.5rem 0;
}
.nm-paywall-subtitle {
    font-size: 0.92rem;
    color: #475569;
    line-height: 1.5;
    margin: 0;
}

/* Feature Locked Alert Box */
.nm-locked-feature-box {
    background: #fffbeb;
    border: 1.5px solid #fde68a;
    border-left: 5px solid #f59e0b;
    border-radius: 12px;
    padding: 0.85rem 1rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.nm-locked-feature-icon {
    font-size: 1.6rem;
    flex-shrink: 0;
}
.nm-locked-feature-text {
    font-size: 0.88rem;
    color: #92400e;
    line-height: 1.45;
}

/* Price Box */
.nm-price-tag-row {
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border: 1.5px solid #bbf7d0;
    border-radius: 14px;
    padding: 0.85rem 1.25rem;
    margin-bottom: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.nm-price-label {
    font-size: 0.88rem;
    font-weight: 700;
    color: #166534;
}
.nm-price-amount {
    font-size: 1.55rem;
    font-weight: 900;
    color: #059669;
}
.nm-price-strike {
    font-size: 0.85rem;
    color: #94a3b8;
    text-decoration: line-through;
    margin-right: 0.4rem;
}

/* Tabs */
.nm-pay-tabs {
    display: flex;
    gap: 0.5rem;
    background: #f1f5f9;
    padding: 0.35rem;
    border-radius: 12px;
    margin-bottom: 1.25rem;
}
.nm-pay-tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 0.65rem 0.5rem;
    border-radius: 9px;
    font-size: 0.88rem;
    font-weight: 700;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}
.nm-pay-tab-btn.is-active {
    background: white;
    color: #0f172a;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* Tab Panels */
.nm-tab-panel {
    display: none;
}
.nm-tab-panel.is-active {
    display: block;
}

/* VietQR View */
.nm-qr-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.25rem;
    text-align: center;
}
.nm-qr-img {
    width: 210px;
    height: 210px;
    object-fit: contain;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    margin-bottom: 1rem;
    background: white;
}
.nm-qr-info-grid {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
    text-align: left;
    font-size: 0.88rem;
}
.nm-qr-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.45rem 0.65rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}
.nm-qr-copy-btn {
    background: #0284c7;
    color: white;
    border: none;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
}
.nm-qr-copy-btn:hover {
    background: #0369a1;
}

/* License Key Input Box */
.nm-license-box {
    background: #f8fafc;
    border: 1.5px solid #cbd5e1;
    border-radius: 14px;
    padding: 1.25rem;
    text-align: center;
}
.nm-device-code-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #e2e8f0;
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    font-size: 0.88rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 1rem;
}
.nm-key-input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.85rem 1rem;
    font-size: 1.15rem;
    font-weight: 800;
    text-align: center;
    letter-spacing: 2px;
    text-transform: uppercase;
    border: 2px solid #94a3b8;
    border-radius: 10px;
    margin-bottom: 1rem;
    outline: none;
    transition: border-color 0.2s;
    font-family: monospace, sans-serif;
}
.nm-key-input:focus {
    border-color: #059669;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.2);
}
.nm-activate-btn {
    width: 100%;
    padding: 0.85rem;
    font-size: 1rem;
    font-weight: 800;
    color: white;
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(5, 150, 105, 0.3);
    transition: all 0.2s;
}
.nm-activate-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(5, 150, 105, 0.4);
}

/* Toast Message */
.nm-paywall-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #0f172a;
    color: white;
    padding: 0.75rem 1.4rem;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 700;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    z-index: 1000000;
    display: none;
    opacity: 0;
    transition: all 0.25s ease;
}
.nm-paywall-toast.show {
    display: block;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Parent Report Modal Styles */
.nm-report-modal-card {
    max-width: 720px;
}
.nm-canvas-preview-wrap {
    width: 100%;
    display: flex;
    justify-content: center;
    background: #0f172a;
    border-radius: 14px;
    padding: 0.75rem;
    margin-bottom: 1.25rem;
    overflow: hidden;
}
.nm-canvas-preview {
    max-width: 100%;
    height: auto;
    max-height: 58vh;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}
.nm-report-actions-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.nm-report-btn {
    flex: 1;
    min-width: 160px;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
    text-decoration: none;
}
.nm-report-btn-save {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(5, 150, 105, 0.3);
}
.nm-report-btn-share {
    background: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.3);
}


/* -------------------------------------------------------------------------
   3 PRICING TIERS & AUTO-ACTIVATION VIETQR STYLES (v2026.2)
   ------------------------------------------------------------------------- */
.nm-plans-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.nm-plan-card {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 1rem 0.85rem;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    flex-direction: column;
    text-align: left;
}
.nm-plan-card:hover {
    border-color: #38bdf8;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}
.nm-plan-card.is-selected {
    border-color: #0284c7;
    background: linear-gradient(145deg, #f0f9ff 0%, #ffffff 100%);
    box-shadow: 0 8px 24px rgba(2, 132, 199, 0.2);
    transform: translateY(-2px);
}
.nm-plan-card.is-pro.is-selected {
    border-color: #f59e0b;
    background: linear-gradient(145deg, #fffbeb 0%, #ffffff 100%);
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.25);
}

.nm-plan-badge-pill {
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    padding: 0.2rem 0.5rem;
    border-radius: 9999px;
    margin-bottom: 0.5rem;
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}
.nm-plan-badge-starter {
    background: #e0f2fe;
    color: #0369a1;
}
.nm-plan-badge-pro {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3);
}
.nm-plan-badge-life {
    background: #dcfce7;
    color: #15803d;
}

.nm-plan-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 0.2rem;
}
.nm-plan-duration {
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 0.6rem;
}
.nm-plan-price-group {
    margin-top: auto;
}
.nm-plan-price-num {
    font-size: 1.35rem;
    font-weight: 900;
    color: #0f172a;
}
.nm-plan-card.is-pro .nm-plan-price-num {
    color: #d97706;
}
.nm-plan-original-price {
    font-size: 0.75rem;
    color: #94a3b8;
    text-decoration: line-through;
    margin-left: 0.3rem;
}

/* Real-Time Radar Poller Animation */
.nm-radar-status-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.65rem 1rem;
    margin-top: 0.85rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: #334155;
}
.nm-radar-pulse-dot {
    width: 10px;
    height: 10px;
    background: #f59e0b;
    border-radius: 50%;
    box-shadow: 0 0 10px #f59e0b;
    animation: radarPulse 1.5s infinite;
}
@keyframes radarPulse {
    0% { transform: scale(0.9); opacity: 0.7; }
    50% { transform: scale(1.4); opacity: 1; box-shadow: 0 0 14px #ea580c; }
    100% { transform: scale(0.9); opacity: 0.7; }
}

/* Success Celebration View */
.nm-success-celebration-view {
    display: none;
    text-align: center;
    padding: 2rem 1rem;
    animation: fadeInModal 0.3s ease-out;
}
.nm-success-icon-anim {
    font-size: 4rem;
    margin-bottom: 0.85rem;
    animation: bounceTada 0.8s ease-in-out;
}
@keyframes bounceTada {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.2) rotate(-6deg); }
    50% { transform: scale(1.25) rotate(6deg); }
    75% { transform: scale(1.1) rotate(-3deg); }
}

/* Refund & Security Guarantee Bar */
.nm-guarantee-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 12px;
    padding: 0.65rem 1rem;
    margin-top: 1.15rem;
    font-size: 0.78rem;
    color: #166534;
    line-height: 1.4;
}
.nm-guarantee-bar strong {
    color: #15803d;
}

@media (max-width: 640px) {
    .nm-plans-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    .nm-plan-card {
        padding: 0.75rem;
    }
    .nm-guarantee-bar {
        flex-direction: column;
        align-items: flex-start;
    }
}
