/**
 * EmailTemplates Pro - Popups Styles
 * تصميم النوافذ المنبثقة وجمع الإيميلات
 */

/* ========== POPUP BASE STYLES ========== */
.etm-popup-container {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    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;
}

.etm-popup-container.active {
    opacity: 1;
    visibility: visible;
}

.etm-popup-overlay {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1;
}

.etm-popup-content {
    position: relative;
    z-index: 2;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    width: 500px;
    animation: etm-popup-fade-in 0.3s ease-out;
}

@keyframes etm-popup-fade-in {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes etm-popup-slide-in {
    from {
        opacity: 0;
        transform: translateY(50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes etm-popup-zoom-in {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ========== POPUP STRUCTURE ========== */
.etm-popup-close {
    position: absolute;
    top: 15px;
    left: 15px;
    background: none;
    border: none;
    font-size: 24px;
    color: #64748b;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    z-index: 3;
}

.etm-popup-close:hover {
    background: #f1f5f9;
    color: #ef476f;
}

.etm-popup-header {
    padding: 30px 30px 20px;
    text-align: center;
}

.etm-popup-title {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 15px;
    line-height: 1.3;
}

.etm-popup-subtitle {
    font-size: 16px;
    color: #64748b;
    margin: 0;
    line-height: 1.6;
}

.etm-popup-body {
    padding: 0 30px;
}

.etm-popup-image {
    text-align: center;
    margin-bottom: 25px;
}

.etm-popup-image img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
}

.etm-popup-description {
    font-size: 15px;
    color: #475569;
    line-height: 1.6;
    margin-bottom: 25px;
}

.etm-popup-features {
    list-style: none;
    padding: 0;
    margin: 0 0 25px;
}

.etm-popup-features li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 14px;
    color: #475569;
}

.etm-popup-features li i {
    color: #06d6a0;
    margin-top: 3px;
    flex-shrink: 0;
}

.etm-popup-footer {
    padding: 20px 30px 30px;
    text-align: center;
}

/* ========== POPUP FORMS ========== */
.etm-popup-form {
    margin-top: 20px;
}

.etm-popup-form-group {
    margin-bottom: 15px;
}

.etm-popup-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #475569;
    font-size: 14px;
}

.etm-popup-input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s;
    background: white;
    color: #1e293b;
}

.etm-popup-input:focus {
    outline: none;
    border-color: #4361ee;
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.etm-popup-input::placeholder {
    color: #94a3b8;
}

.etm-popup-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.etm-popup-checkbox input {
    width: 18px;
    height: 18px;
    border: 2px solid #cbd5e1;
    border-radius: 4px;
    cursor: pointer;
}

.etm-popup-checkbox label {
    font-size: 13px;
    color: #64748b;
    cursor: pointer;
}

.etm-popup-checkbox a {
    color: #4361ee;
    text-decoration: none;
}

.etm-popup-checkbox a:hover {
    text-decoration: underline;
}

.etm-popup-submit {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #4361ee, #3a56d4);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.etm-popup-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(67, 97, 238, 0.3);
}

.etm-popup-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* ========== POPUP MESSAGES ========== */
.etm-popup-message {
    margin-top: 15px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
    display: none;
    animation: etm-message-fade-in 0.3s ease;
}

@keyframes etm-message-fade-in {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.etm-popup-message.success {
    background: rgba(6, 214, 160, 0.1);
    color: #065f46;
    border: 1px solid rgba(6, 214, 160, 0.2);
    display: block;
}

.etm-popup-message.error {
    background: rgba(239, 71, 111, 0.1);
    color: #7f1d1d;
    border: 1px solid rgba(239, 71, 111, 0.2);
    display: block;
}

.etm-popup-message.info {
    background: rgba(67, 97, 238, 0.1);
    color: #1e40af;
    border: 1px solid rgba(67, 97, 238, 0.2);
    display: block;
}

/* ========== POPUP VARIATIONS ========== */
/* Centered Popup */
.etm-popup-centered .etm-popup-content {
    text-align: center;
}

.etm-popup-centered .etm-popup-close {
    left: 50%;
    transform: translateX(-50%);
    top: -40px;
    background: white;
}

/* Sidebar Popup */
.etm-popup-sidebar {
    justify-content: flex-end;
}

.etm-popup-sidebar .etm-popup-content {
    width: 400px;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    margin: 0;
    animation: etm-popup-slide-in 0.3s ease;
}

/* Fullscreen Popup */
.etm-popup-fullscreen .etm-popup-content {
    width: 100%;
    height: 100vh;
    max-width: 100%;
    max-height: 100vh;
    border-radius: 0;
}

/* Minimal Popup */
.etm-popup-minimal .etm-popup-content {
    width: 350px;
    padding: 0;
}

.etm-popup-minimal .etm-popup-header {
    padding: 25px 25px 15px;
}

.etm-popup-minimal .etm-popup-body {
    padding: 0 25px;
}

.etm-popup-minimal .etm-popup-footer {
    padding: 20px 25px 25px;
}

/* Notification Popup */
.etm-popup-notification {
    align-items: flex-start;
    padding-top: 20px;
}

.etm-popup-notification .etm-popup-content {
    width: 350px;
    animation: etm-notification-slide-in 0.3s ease;
}

@keyframes etm-notification-slide-in {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ========== POPUP THEMES ========== */
/* Dark Theme */
.etm-popup-dark .etm-popup-content {
    background: #1e293b;
    color: #cbd5e1;
}

.etm-popup-dark .etm-popup-title {
    color: #f1f5f9;
}

.etm-popup-dark .etm-popup-subtitle,
.etm-popup-dark .etm-popup-description,
.etm-popup-dark .etm-popup-features li {
    color: #94a3b8;
}

.etm-popup-dark .etm-popup-input {
    background: #334155;
    border-color: #475569;
    color: #f1f5f9;
}

.etm-popup-dark .etm-popup-input:focus {
    border-color: #4361ee;
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
}

/* Gradient Theme */
.etm-popup-gradient .etm-popup-content {
    background: linear-gradient(135deg, #4361ee, #764ba2);
    color: white;
}

.etm-popup-gradient .etm-popup-title {
    color: white;
}

.etm-popup-gradient .etm-popup-subtitle,
.etm-popup-gradient .etm-popup-description {
    color: rgba(255, 255, 255, 0.9);
}

.etm-popup-gradient .etm-popup-input {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: white;
}

.etm-popup-gradient .etm-popup-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.etm-popup-gradient .etm-popup-input:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: white;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.etm-popup-gradient .etm-popup-submit {
    background: white;
    color: #4361ee;
}

/* Light Theme */
.etm-popup-light .etm-popup-content {
    background: #ffffff;
    border: 1px solid #e2e8f0;
}

/* ========== POPUP ANIMATIONS ========== */
.etm-popup-animation-fade .etm-popup-content {
    animation: etm-popup-fade-in 0.3s ease;
}

.etm-popup-animation-slide .etm-popup-content {
    animation: etm-popup-slide-in 0.3s ease;
}

.etm-popup-animation-zoom .etm-popup-content {
    animation: etm-popup-zoom-in 0.3s ease;
}

.etm-popup-animation-bounce .etm-popup-content {
    animation: etm-popup-bounce-in 0.5s ease;
}

@keyframes etm-popup-bounce-in {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }

    50% {
        opacity: 1;
        transform: scale(1.05);
    }

    70% {
        transform: scale(0.95);
    }

    100% {
        transform: scale(1);
    }
}

/* ========== POPUP RESPONSIVE ========== */
@media (max-width: 768px) {
    .etm-popup-container {
        padding: 10px;
    }

    .etm-popup-content {
        width: 100%;
        max-width: 100%;
        max-height: calc(100vh - 20px);
    }

    .etm-popup-header {
        padding: 25px 20px 15px;
    }

    .etm-popup-body {
        padding: 0 20px;
    }

    .etm-popup-footer {
        padding: 15px 20px 25px;
    }

    .etm-popup-title {
        font-size: 20px;
    }

    .etm-popup-subtitle {
        font-size: 14px;
    }

    .etm-popup-sidebar .etm-popup-content {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .etm-popup-header {
        padding: 20px 15px 10px;
    }

    .etm-popup-body {
        padding: 0 15px;
    }

    .etm-popup-footer {
        padding: 10px 15px 20px;
    }

    .etm-popup-input {
        padding: 12px 14px;
        font-size: 14px;
    }

    .etm-popup-submit {
        padding: 14px;
        font-size: 15px;
    }
}

/* ========== POPUP COUNTDOWN ========== */
.etm-popup-countdown {
    text-align: center;
    margin: 15px 0;
}

.etm-countdown-timer {
    font-size: 24px;
    font-weight: 700;
    color: #4361ee;
    margin-bottom: 5px;
}

.etm-countdown-label {
    font-size: 12px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ========== POPUP SOCIAL PROOF ========== */
.etm-popup-social-proof {
    margin: 20px 0;
    text-align: center;
}

.etm-social-proof-avatars {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}

.etm-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid white;
    margin-right: -10px;
    background: #4361ee;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.etm-social-proof-text {
    font-size: 13px;
    color: #64748b;
}

.etm-social-proof-text strong {
    color: #1e293b;
}

/* ========== POPUP EXIT INTENT ========== */
.etm-exit-intent-popup .etm-popup-overlay {
    background: rgba(0, 0, 0, 0.85);
}

.etm-exit-intent-popup .etm-popup-content {
    width: 600px;
    max-width: 95%;
}

/* ========== POPUP SCROLL TRIGGER ========== */
.etm-scroll-trigger-popup .etm-popup-content {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 350px;
    max-width: calc(100% - 40px);
    animation: etm-popup-slide-up 0.3s ease;
}

@keyframes etm-popup-slide-up {
    from {
        opacity: 0;
        transform: translateY(100%);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== ACCESSIBILITY ========== */
.etm-popup-container:focus-within {
    outline: 2px solid #4361ee;
    outline-offset: 2px;
}

.etm-popup-close:focus {
    outline: 2px solid #4361ee;
    outline-offset: 2px;
}

.etm-popup-input:focus,
.etm-popup-submit:focus {
    outline: 2px solid #4361ee;
    outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {

    .etm-popup-container,
    .etm-popup-content,
    .etm-popup-message {
        transition: none;
        animation: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .etm-popup-content {
        border: 2px solid currentColor;
    }

    .etm-popup-input {
        border: 2px solid currentColor;
    }
}