/*
 * popups.css — ProToolsly
 * Styles for:
 *   1. Exit-Intent Signup Popup
 *   2. Signup Success / Congratulations Modal
 * 
 * Uses existing CSS variables from style.css (--primary, --bg-card, --text, etc.)
 * so dark-mode works automatically.
 */

/* ============================================================
   SHARED MODAL BACKDROP
   ============================================================ */
.pt-modal-backdrop {
    display: none;                       /* hidden by default */
    position: fixed;
    inset: 0;                            /* cover entire viewport */
    background: rgba(10, 25, 50, 0.72);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pt-modal-backdrop.pt-modal-active {
    display: flex;
    opacity: 1;
}

/* Entrance animation for the card */
.pt-modal-card {
    background: var(--bg-card, #fff);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: translateY(30px) scale(0.97);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}

.pt-modal-backdrop.pt-modal-active .pt-modal-card {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* ============================================================
   EXIT-INTENT MODAL
   ============================================================ */
#exit-intent-modal .pt-modal-card {
    border-top: 4px solid var(--primary, #2563EB);
}

.exit-modal-header {
    padding: 28px 28px 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.exit-modal-title {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--text, #1A202C);
    line-height: 1.3;
    flex: 1;
}

.exit-modal-title .wave {
    display: inline-block;
    animation: wave 1.5s ease-in-out infinite;
    transform-origin: 70% 70%;
}

@keyframes wave {
    0%, 100% { transform: rotate(0deg); }
    25%       { transform: rotate(15deg); }
    75%       { transform: rotate(-10deg); }
}

.pt-modal-close-btn {
    background: none;
    border: none;
    font-size: 1.4rem;
    color: var(--text-muted, #718096);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    line-height: 1;
    transition: color 0.2s, background 0.2s;
    flex-shrink: 0;
    margin-top: -4px;
}

.pt-modal-close-btn:hover {
    color: var(--text, #1A202C);
    background: var(--border, #E2E8F0);
}

.exit-modal-body {
    padding: 16px 28px 0;
}

.exit-modal-body p {
    font-size: 0.96rem;
    color: var(--text-muted, #718096);
    line-height: 1.65;
    margin-bottom: 18px;
}

.exit-benefits-list {
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.exit-benefits-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text, #1A202C);
}

.exit-benefits-list li .benefit-icon {
    width: 28px;
    height: 28px;
    background: rgba(37, 99, 235, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.exit-modal-footer {
    padding: 20px 28px 28px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-exit-signup {
    display: block;
    width: 100%;
    padding: 13px 20px;
    background: linear-gradient(135deg, var(--primary, #2563EB), #1e4fc2);
    color: #fff !important;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
    text-decoration: none !important;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.35);
}

.btn-exit-signup:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.45);
}

.btn-exit-continue {
    display: block;
    width: 100%;
    padding: 11px 20px;
    background: transparent;
    color: var(--text-muted, #718096);
    border: 1px solid var(--border, #E2E8F0);
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.btn-exit-continue:hover {
    color: var(--text, #1A202C);
    border-color: var(--text-muted, #718096);
    background: var(--bg, #F7F8FC);
}

/* ============================================================
   SIGNUP SUCCESS / CONGRATULATIONS MODAL
   ============================================================ */
#signup-success-modal .pt-modal-card {
    text-align: center;
    border-top: 4px solid var(--success, #38A169);
}

.success-modal-icon {
    font-size: 3.5rem;
    margin: 32px auto 8px;
    display: block;
    animation: popIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes popIn {
    from { transform: scale(0); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

.success-modal-close {
    position: absolute;
    top: 14px;
    right: 18px;
}

.success-modal-body {
    padding: 8px 32px 0;
}

.success-modal-body h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--success, #38A169);
    margin-bottom: 14px;
    line-height: 1.3;
}

.success-modal-body p {
    font-size: 0.93rem;
    color: var(--text-muted, #718096);
    line-height: 1.65;
    margin-bottom: 10px;
    white-space: pre-line;
}

.success-modal-body .user-greeting {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text, #1A202C);
}

.success-modal-footer {
    padding: 24px 32px 32px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-success-dashboard {
    display: block;
    width: 100%;
    padding: 13px 20px;
    background: linear-gradient(135deg, var(--success, #38A169), #2f8a57);
    color: #fff !important;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
    text-decoration: none !important;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(56, 161, 105, 0.35);
}

.btn-success-dashboard:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(56, 161, 105, 0.45);
}

.btn-success-explore {
    display: block;
    width: 100%;
    padding: 11px 20px;
    background: transparent;
    color: var(--primary, #2563EB);
    border: 1px solid var(--primary, #2563EB);
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none !important;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
}

.btn-success-explore:hover {
    background: rgba(37, 99, 235, 0.06);
}

/* ============================================================
   MOBILE RESPONSIVE
   ============================================================ */
@media (max-width: 540px) {
    .pt-modal-card {
        border-radius: 12px;
    }

    .exit-modal-header,
    .exit-modal-body,
    .exit-modal-footer {
        padding-left: 20px;
        padding-right: 20px;
    }

    .success-modal-body,
    .success-modal-footer {
        padding-left: 20px;
        padding-right: 20px;
    }

    .exit-modal-title {
        font-size: 1.2rem;
    }

    .success-modal-body h2 {
        font-size: 1.25rem;
    }
}

/* ============================================================
   DARK MODE OVERRIDES
   ============================================================ */
[data-theme="dark"] .btn-exit-continue:hover {
    background: var(--bg, #0F172A);
}

[data-theme="dark"] .exit-benefits-list li .benefit-icon {
    background: rgba(37, 99, 235, 0.2);
}
