/**
 * Exit Intent Popup Styles - ОБНОВЛЕННАЯ ВЕРСИЯ
 * Стили для маркетинговых popup окон
 */

/* Overlay */
.exit-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(0px);
}

.exit-popup-overlay.active {
    opacity: 1;
    visibility: visible;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
}

/* Container */
.exit-popup-container {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 520px;
    width: 100%;
    position: relative;
    transform: translateY(30px) scale(0.9);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.exit-popup-overlay.active .exit-popup-container {
    transform: translateY(0) scale(1);
}

/* Close button */
.exit-popup-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border: none;
    background: #f8f9fa;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 1;
}

.exit-popup-close:hover {
    background: #e9ecef;
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.exit-popup-close svg {
    width: 20px;
    height: 20px;
    color: #495057;
}

/* Content */
.exit-popup-content {
    padding: 40px;
}

.exit-popup-title {
    font-size: 28px;
    font-weight: 700;
    color: #212529;
    margin: 0 0 8px 0;
    text-align: center;
    line-height: 1.3;
}

.exit-popup-subtitle {
    font-size: 16px;
    color: #6c757d;
    margin: 0 0 24px 0;
    text-align: center;
    line-height: 1.5;
}

.exit-popup-body {
    margin-bottom: 32px;
}

.popup-text {
    font-size: 16px;
    line-height: 1.6;
    color: #495057;
    margin-bottom: 20px;
    text-align: center;
}

.popup-text strong {
    color: #212529;
    font-weight: 600;
}

/* Features grid - УЛУЧШЕННЫЙ ДИЗАЙН */
.popup-features {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin: 20px 0;
}

.popup-feature {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.popup-feature:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.popup-icon {
    font-size: 24px;
    flex-shrink: 0;
    width: 32px;
    text-align: center;
}

.popup-feature span:not(.popup-icon) {
    font-size: 15px;
    color: #495057;
    font-weight: 500;
}

/* Actions */
.exit-popup-actions {
    display: flex;
    gap: 12px;
    flex-direction: column;
}

.exit-popup-btn {
    padding: 14px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    width: 100%;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    display: inline-block;
}

.exit-popup-btn:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.exit-popup-btn:hover:before {
    width: 300px;
    height: 300px;
}

.exit-popup-btn-primary {
    background: linear-gradient(135deg, #0066cc 0%, #0052a3 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 102, 204, 0.3);
}

.exit-popup-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 102, 204, 0.4);
    color: white;
}

.exit-popup-btn-secondary {
    background: #f8f9fa;
    color: #495057;
    border: 2px solid #dee2e6;
}

.exit-popup-btn-secondary:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    color: #495057;
}

/* Timer styles (если понадобится в будущем) */
.popup-timer-container {
    text-align: center;
    margin-bottom: 24px;
}

.popup-timer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding: 20px;
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border-radius: 12px;
    border: 2px solid #ffeaa7;
}

.timer-block {
    text-align: center;
}

.timer-value {
    display: block;
    font-size: 32px;
    font-weight: 700;
    color: #856404;
    line-height: 1;
}

.timer-label {
    display: block;
    font-size: 12px;
    color: #856404;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.timer-separator {
    font-size: 24px;
    font-weight: 700;
    color: #856404;
    margin: 0 4px;
}

/* Offer details */
.popup-offer-details {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    border: 1px solid #bee5eb;
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}

.popup-offer-details p {
    margin: 8px 0;
    font-size: 15px;
    color: #0c5460;
    line-height: 1.5;
}

.popup-offer-details strong {
    color: #0c5460;
}

/* Responsive */
@media (max-width: 576px) {
    .exit-popup-overlay {
        padding: 15px;
    }

    .exit-popup-content {
        padding: 32px 24px;
    }

    .exit-popup-title {
        font-size: 24px;
    }

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

    .popup-text {
        font-size: 14px;
    }

    .timer-value {
        font-size: 28px;
    }

    .timer-label {
        font-size: 11px;
    }

    .exit-popup-actions {
        gap: 10px;
    }

    .exit-popup-btn {
        padding: 12px 20px;
        font-size: 15px;
    }

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

    .popup-icon {
        font-size: 20px;
    }

    .popup-feature span:not(.popup-icon) {
        font-size: 14px;
    }
}

/* Animations */
@keyframes popup-bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.exit-popup-container {
    animation: popup-bounce 0.5s ease 0.3s both;
}

/* Accessibility */
.exit-popup-overlay:focus-within .exit-popup-container {
    outline: 3px solid #0066cc;
    outline-offset: 2px;
}

.exit-popup-btn:focus {
    outline: 3px solid #0066cc;
    outline-offset: 2px;
}

.exit-popup-close:focus {
    outline: 3px solid #0066cc;
    outline-offset: 2px;
}

/* Улучшения для доступности */
@media (prefers-reduced-motion: reduce) {
    .exit-popup-overlay,
    .exit-popup-container,
    .exit-popup-btn,
    .popup-feature {
        transition: none;
        animation: none;
    }

    .exit-popup-container {
        transform: none;
    }
}

/* Dark mode compatibility */
@media (prefers-color-scheme: dark) {
    .exit-popup-container {
        background: #2d3748;
        border-color: rgba(255, 255, 255, 0.1);
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    }

    .exit-popup-title {
        color: #f7fafc;
    }

    .exit-popup-subtitle,
    .popup-text {
        color: #a0aec0;
    }

    .popup-text strong {
        color: #f7fafc;
    }

    .popup-feature {
        background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
        border-color: rgba(255, 255, 255, 0.1);
    }

    .popup-feature:hover {
        background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    }

    .popup-feature span:not(.popup-icon) {
        color: #e2e8f0;
    }

    .exit-popup-close {
        background: #4a5568;
    }

    .exit-popup-close:hover {
        background: #2d3748;
    }

    .exit-popup-close svg {
        color: #e2e8f0;
    }

    .exit-popup-btn-secondary {
        background: #4a5568;
        color: #e2e8f0;
        border-color: #2d3748;
    }

    .exit-popup-btn-secondary:hover {
        background: #2d3748;
        color: #f7fafc;
    }
}

/* Print styles */
@media print {
    .exit-popup-overlay {
        display: none !important;
    }
}

/* Performance optimizations */
.exit-popup-overlay {
    will-change: opacity, visibility;
}

.exit-popup-container {
    will-change: transform;
}

.exit-popup-btn {
    will-change: transform, box-shadow;
}