/**
 * Article Retention Modal Styles
 *
 * Styles for the exit intent and newsletter signup modal on article pages
 */

/* Modal Container */
.sp-article-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-in-out;
}

/* Modal Overlay */
.sp-article-modal .sp-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(3px);
}

/* Modal Content Box */
.sp-article-modal .sp-modal-content {
    position: relative;
    background: #ffffff;
    max-width: 520px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    z-index: 1;
    animation: slideUp 0.4s ease-out;
}

/* Modal Body */
.sp-article-modal .sp-modal-body {
    padding: 40px 30px;
}

/* Close Button */
.sp-article-modal .sp-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    z-index: 10;
}

.sp-article-modal .sp-modal-close:hover {
    background: #f0f0f0;
    color: #333;
    transform: rotate(90deg);
}

.sp-article-modal .sp-modal-close:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Modal Title */
.sp-article-modal-title {
    margin: 0 0 15px 0;
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.3;
}

/* Modal Description */
.sp-article-modal-description {
    margin: 0 0 30px 0;
    font-size: 16px;
    line-height: 1.6;
    color: #555;
}

/* Form Styles */
.sp-article-retention-form {
    margin: 0;
}

.sp-article-retention-form .sp-form-field {
    margin-bottom: 16px;
}

.sp-article-retention-form .sp-newsletter-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.sp-article-retention-form .sp-newsletter-input:focus {
    outline: none;
    border-color: #1a1a1a;
    box-shadow: 0 0 0 3px rgba(26, 26, 26, 0.1);
}

.sp-article-retention-form .sp-newsletter-input::placeholder {
    color: #999;
}

/* Submit Button */
.sp-article-submit {
    width: 100%;
    padding: 16px;
    background: #1a1a1a;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 16px;
}

.sp-article-submit:hover {
    background: #333;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26, 26, 26, 0.3);
}

.sp-article-submit:active {
    transform: translateY(0);
}

.sp-article-submit:disabled {
    background: #999;
    cursor: not-allowed;
    transform: none;
}

/* Privacy Text */
.sp-article-modal .sp-newsletter-privacy {
    margin: 0;
    font-size: 13px;
    color: #888;
    text-align: center;
    line-height: 1.5;
}

/* Response Messages */
.sp-newsletter-response {
    padding: 14px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 15px;
    font-weight: 500;
    animation: slideDown 0.3s ease-out;
}

.sp-newsletter-response.success {
    background: #d4edda;
    color: #155724;
    border: 2px solid #c3e6cb;
}

.sp-newsletter-response.error {
    background: #f8d7da;
    color: #721c24;
    border: 2px solid #f5c6cb;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 600px) {
    .sp-article-modal .sp-modal-content {
        width: 95%;
        max-height: 95vh;
        border-radius: 12px;
    }

    .sp-article-modal .sp-modal-body {
        padding: 30px 20px;
    }

    .sp-article-modal-title {
        font-size: 24px;
    }

    .sp-article-modal-description {
        font-size: 15px;
    }

    .sp-article-modal .sp-modal-close {
        top: 15px;
        right: 15px;
        font-size: 28px;
        width: 32px;
        height: 32px;
    }
}

/* Accessibility - Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .sp-article-modal,
    .sp-article-modal .sp-modal-content,
    .sp-newsletter-response,
    .sp-article-modal .sp-modal-close {
        animation: none;
        transition: none;
    }

    .sp-article-submit:hover {
        transform: none;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .sp-article-modal .sp-modal-overlay {
        background: rgba(0, 0, 0, 0.9);
    }

    .sp-article-modal .sp-newsletter-input {
        border-width: 3px;
    }

    .sp-article-submit {
        border: 2px solid #ffffff;
    }
}

/* Focus Visible for Keyboard Navigation */
.sp-article-modal .sp-newsletter-input:focus-visible,
.sp-article-submit:focus-visible {
    outline: 3px solid #0073aa;
    outline-offset: 2px;
}

/* Loading State for Button */
.sp-article-submit.loading {
    position: relative;
    color: transparent;
}

.sp-article-submit.loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 3px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Print Styles - Hide Modal */
@media print {
    .sp-article-modal {
        display: none !important;
    }
}
