/**
 * Public styles for Subscription Churn Saver plugin
 */

/* Churn Saver Modal */
.churn-saver-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    align-items: center;
    justify-content: center;
}

.churn-saver-modal.active {
    display: flex;
    opacity: 1;
}

.churn-saver-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    z-index: -1;
}

.churn-saver-modal-content {
    background: #fff;
    border-radius: 12px;
    max-width: 560px;
    width: 100%;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    text-align: center;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.churn-saver-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.churn-saver-modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

.churn-saver-modal-title {
    margin: 0 0 16px;
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.3;
}

.churn-saver-modal-message {
    margin: 0 0 32px;
    font-size: 16px;
    color: #666;
    line-height: 1.6;
}

.churn-saver-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.churn-saver-btn {
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
    width: 100%;
}

.churn-saver-btn-primary {
    background: #4CAF50;
    color: #fff;
}

.churn-saver-btn-primary:hover {
    background: #45a049;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.churn-saver-btn-secondary {
    background: #2196F3;
    color: #fff;
}

.churn-saver-btn-secondary:hover {
    background: #1976D2;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.churn-saver-modal-footer {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.churn-saver-btn-link {
    background: none;
    border: none;
    color: #999;
    font-size: 14px;
    cursor: pointer;
    text-decoration: underline;
    padding: 8px;
}

.churn-saver-btn-link:hover {
    color: #666;
}

/* Loading state */
.churn-saver-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.churn-saver-loading .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4CAF50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success message */
.churn-saver-success-message {
    text-align: center;
    padding: 40px 20px;
}

.churn-saver-success-icon {
    width: 64px;
    height: 64px;
    color: #4CAF50;
    margin: 0 auto 20px;
    animation: scaleIn 0.3s ease;
}

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

.churn-saver-success-message h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    color: #1a1a1a;
}

/* Error message */
.churn-saver-error-message {
    background: #ff5252;
    color: #fff;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
}

/* Body class when modal is open */
body.churn-saver-modal-open {
    overflow: hidden;
}

/* Mobile responsiveness */
@media (max-width: 640px) {
    .churn-saver-modal-content {
        padding: 32px 24px;
        max-width: 95%;
    }

    .churn-saver-modal-title {
        font-size: 24px;
    }

    .churn-saver-modal-message {
        font-size: 15px;
    }

    .churn-saver-btn {
        padding: 14px 20px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .churn-saver-modal-backdrop {
        padding: 12px;
    }

    .churn-saver-modal-content {
        padding: 28px 20px;
    }

    .churn-saver-modal-title {
        font-size: 22px;
    }

    .churn-saver-modal-message {
        font-size: 14px;
        margin-bottom: 24px;
    }

    .churn-saver-btn {
        padding: 12px 16px;
        font-size: 14px;
    }
}
