/**
 * Newsletter Popup Styles
 * 
 * Popup modal styles following brand style guide
 * Colors: Primary #00D32F, White #FFFFFF, Black #000000
 * Typography: Roboto Slab (headings), Raleway (body)
 * 
 * @package Trader2B_Lite
 */

/* Popup Overlay */
.newsletter-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.newsletter-popup.show {
    opacity: 1;
    visibility: visible;
}

.newsletter-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    cursor: pointer;
}

/* Popup Content */
.newsletter-popup-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background-color: #ffffff;
    border-radius: 24px;
    padding: 48px 40px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.newsletter-popup.show .newsletter-popup-content {
    transform: translate(-50%, -50%) scale(1);
}

/* Close Button */
.newsletter-popup-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    font-size: 28px;
    line-height: 1;
    color: #151515;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.newsletter-popup-close:hover {
    background-color: #f0f0f0;
    color: #000000;
}

/* Icon */
.newsletter-popup-icon {
    margin: 0 auto 24px;
    width: 64px;
    height: 64px;
}

.newsletter-popup-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Title */
.newsletter-popup-title {
    font-family: 'Roboto Slab', serif;
    font-size: 56px;
    font-weight: 400;
    color: #151515;
    margin: 0 0 16px;
    line-height: 1.2;
}

/* Message */
.newsletter-popup-message {
    font-family: 'Raleway', sans-serif;
    font-size: 18px;
    font-weight: 400;
    color: #151515;
    margin: 0 0 32px;
    line-height: 1.6;
}

/* Button */
.newsletter-popup-btn {
    display: inline-block;
    padding: 14px 32px;
    background-color: #00D32F;
    color: #ffffff;
    font-family: 'Raleway', sans-serif;
    font-size: 18px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
    text-decoration: none;
    min-width: 140px;
}

.newsletter-popup-btn:hover {
    background-color: #00b929;
    transform: translateY(-2px);
}

.newsletter-popup-btn:active {
    transform: translateY(0);
}

/* Error State */
.newsletter-popup.error .newsletter-popup-btn {
    background-color: #FF4444;
}

.newsletter-popup.error .newsletter-popup-btn:hover {
    background-color: #e63939;
}

/* Loading Spinner for Form Button */
.newsletter-form button.loading,
button.btn-ebook-submit.loading,
button.btn-subscribe.loading,
.trader2b-ajax-form button[type="submit"].loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
    background-color: #00D32F !important;
}

.newsletter-form button.loading::after,
button.btn-ebook-submit.loading::after,
button.btn-subscribe.loading::after,
.trader2b-ajax-form button[type="submit"].loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.newsletter-form button .spinner,
button.btn-ebook-submit .spinner,
button.btn-subscribe .spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Responsive Styles */
@media (max-width: 768px) {
    .newsletter-popup-content {
        padding: 40px 24px;
        max-width: 90%;
    }

    .newsletter-popup-title {
        font-size: 48px;
    }

    .newsletter-popup-message {
        font-size: 16px;
    }

    .newsletter-popup-btn {
        padding: 12px 28px;
        font-size: 16px;
    }

    .newsletter-popup-icon {
        width: 56px;
        height: 56px;
        margin-bottom: 20px;
    }
}

@media (max-width: 480px) {
    .newsletter-popup-content {
        padding: 32px 20px;
    }

    .newsletter-popup-title {
        font-size: 40px;
        margin-bottom: 12px;
    }

    .newsletter-popup-message {
        font-size: 15px;
        margin-bottom: 24px;
    }

    .newsletter-popup-btn {
        width: 100%;
        padding: 14px 24px;
    }

    .newsletter-popup-icon {
        width: 48px;
        height: 48px;
        margin-bottom: 16px;
    }
}

/* Hidden Turnstile Container */
#newsletter-turnstile {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
