/**
 * Alkasim Newsletters Pro - Frontend Core Styles
 *
 * @package AlkasimNewslettersPro
 */

.anp-newsletter-wrapper,
.anp-newsletter-wrapper * {
    box-sizing: border-box;
}

.anp-newsletter-wrapper {
    position: relative !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: auto !important;
    height: auto !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding: 40px 20px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    box-sizing: border-box !important;
    border-radius: 0 !important;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    border: none !important;
    box-shadow: none !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    overflow: visible !important;
}

/* Inline ribbon exception (retains compact height) */
.anp-newsletter-wrapper.anp-template-8 {
    min-height: auto !important;
    padding: 20px !important;
}

/* Accessibility helper */
.anp-newsletter-wrapper .screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

/* Form inputs & buttons common reset */
.anp-newsletter-wrapper input[type="email"],
.anp-newsletter-wrapper input[type="text"] {
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.anp-newsletter-wrapper button[type="submit"] {
    cursor: pointer;
    user-select: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.anp-newsletter-wrapper button[type="submit"]:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* Button Loading Spinner */
.anp-btn-loader {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: anpSpin 0.7s infinite linear;
    display: inline-block;
}

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

/* Inline Error & Feedback Banners */
.newsletter-inline-error,
.anp-form-feedback {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13.5px;
    line-height: 1.4;
    background-color: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #f87171;
    text-align: left;
    animation: anpFadeIn 0.3s ease-out;
}

.anp-form-feedback.is-success {
    background-color: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.35);
    color: #34d399;
}

@keyframes anpFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   SUCCESS MODAL POPUP (10-Second Auto-Close)
   ========================================================================== */
.newsletter-popup-wrap {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.newsletter-popup-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.newsletter-popup-container {
    position: relative;
    z-index: 2;
    max-width: 480px;
    width: 100%;
}

.newsletter-popup {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 20px;
    padding: 40px 32px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    color: #f8fafc;
    position: relative;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.newsletter-popup-wrap.is-visible .newsletter-popup {
    transform: scale(1);
}

.newsletter-popup-close-x {
    position: absolute;
    top: 16px;
    right: 18px;
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: color 0.2s ease;
}

.newsletter-popup-close-x:hover {
    color: #ffffff;
}

/* Animated Success Checkmark Ring */
.newsletter-popup-icon-wrap {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.newsletter-popup-icon-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.15);
    border: 2px solid #6366F1;
    animation: anpPulse 2s infinite ease-in-out;
}

@keyframes anpPulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 14px rgba(99, 102, 241, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
}

.newsletter-popup-check {
    font-size: 32px;
    color: #10B981;
    font-weight: bold;
    position: relative;
    z-index: 1;
}

.newsletter-popup-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 12px 0;
    color: #ffffff;
}

.newsletter-popup-message {
    font-size: 14.5px;
    color: #94a3b8;
    line-height: 1.6;
    margin: 0 0 24px 0;
}

/* 10-Second Countdown Indicator */
.newsletter-countdown-bar {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #818cf8;
    background: rgba(99, 102, 241, 0.1);
    padding: 6px 14px;
    border-radius: 50px;
    margin-bottom: 24px;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.newsletter-countdown-bar strong {
    color: #ffffff;
    font-weight: 700;
}

.newsletter-popup-actions {
    display: flex;
    justify-content: center;
}

.newsletter-popup-btn {
    background: #6366F1;
    color: #ffffff;
    border: none;
    padding: 12px 32px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
}

.newsletter-popup-btn:hover {
    background: #4F46E5;
    transform: translateY(-1px);
}

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