.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 999;
    overflow: hidden;
}

.modal-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    width: 100%;
    max-width: 1400px;
    height: auto;
    min-height: 700px;
    max-height: 95vh;
    background: white;
    position: relative;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 16px;
    overflow-y: auto;
    overflow-x: hidden;
    margin: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* Улучшенные стили для больших экранов */
@media (min-width: 1400px) {
    .modal {
        max-width: 1600px;
        min-height: 750px;
    }
}

@media (min-width: 1920px) {
    .modal {
        max-width: 1800px;
        min-height: 800px;
    }
}

.modal.visible {
    opacity: 1;
}

@media (max-width: 800px) {
    .modal-backdrop {
        align-items: flex-start;
        padding: 0;
        overflow-y: auto;
    }
    
    .modal {
        width: 100%;
        max-width: 100%;
        height: auto;
        min-height: 100vh;
        max-height: none;
        margin: 0;
        border-radius: 0;
        display: flex;
        flex-direction: column;
        overflow-y: auto;
    }
    
}
