/* Joomla 5 Modern Styles for Yandex Popup */
.ya_popup__bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    z-index: 10000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.ya_popup {
    padding: 2.5rem;
    max-width: 650px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    border: 1px solid rgba(0,0,0,0.1);
    animation: yaPopupFadeIn 0.3s ease-out;
}

.ya_popup h3 {
    margin-top: 0;
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.3;
}

.ya_popup_content {
    text-align: justify;
    margin-bottom: 2rem;
    line-height: 1.6;
    font-size: 1rem;
}

.ya_popup_content a {
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s ease;
}

.ya_popup_content a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.ya_popup_buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.ya_button_wrapper {
    display: flex;
}

.ya_popup_accept, .ya_popup_decline {
    width: 100%;
    padding: 1rem 1.5rem;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: none;
    letter-spacing: normal;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
}

.ya_popup_accept:hover, .ya_popup_decline:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.ya_popup_accept:active, .ya_popup_decline:active {
    transform: translateY(0);
}

/* Joomla 5 Compatibility */
.ya_popup * {
    box-sizing: border-box;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ya_popup {
        padding: 1.5rem;
        margin: 1rem;
        width: 95%;
    }
    
    .ya_popup h3 {
        font-size: 1.3rem;
        margin-bottom: 1rem;
    }
    
    .ya_popup_content {
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
    }
    
    .ya_popup_buttons {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .ya_popup_accept, .ya_popup_decline {
        padding: 0.875rem 1.25rem;
        font-size: 0.95rem;
        min-height: 45px;
    }
}

@media (max-width: 480px) {
    .ya_popup {
        padding: 1.25rem;
    }
    
    .ya_popup h3 {
        font-size: 1.2rem;
    }
    
    .ya_popup_content {
        font-size: 0.9rem;
    }
}

/* Animations */
@keyframes yaPopupFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Focus states for accessibility */
.ya_popup_accept:focus, 
.ya_popup_decline:focus {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .ya_popup {
        border: 2px solid currentColor;
    }
    
    .ya_popup_accept, 
    .ya_popup_decline {
        border: 2px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .ya_popup {
        animation: none;
    }
    
    .ya_popup_accept:hover, 
    .ya_popup_decline:hover {
        transform: none;
    }
}