/* Модальное окно */
.project-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    opacity: 0;
    animation: fadeIn 0.3s forwards;
}

@keyframes fadeIn { to { opacity: 1; } }

.modal-content {
    background: #1a1a1a;
    width: 100%;
    max-width: 1000px;
    border-radius: 10px;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
    overflow: hidden;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: #fff;
    font-size: 30px;
    cursor: pointer;
    z-index: 10;
    transition: color 0.3s;
}
.modal-close:hover { color: var(--color-gold); }

.modal-body {
    display: flex;
    flex-direction: column;
}

/* Слайдер */
.modal-slider {
    position: relative;
    width: 100%;
    height: 50vh; /* Высота слайдера */
    background: #000;
}

.modal-slide {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.4s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none; /* Чтобы клики проходили сквозь неактивные слайды */
}
.modal-slide.active { 
    opacity: 1; 
    pointer-events: auto;
}

/* Стили для картинок и ВИДЕО */
.modal-slide img,
.modal-slide video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    padding: 15px;
    cursor: pointer;
    font-size: 20px;
    transition: 0.3s;
    z-index: 5; /* Поверх видео */
}
.slider-btn:hover { background: var(--color-gold); }
.prev { left: 0; }
.next { right: 0; }

.modal-info {
    padding: 25px;
    background: #222;
}

.modal-info h2 {
    color: var(--color-gold);
    margin-bottom: 10px;
    font-size: 1.8rem;
}

.modal-desc {
    color: #ccc;
    font-size: 1rem;
    line-height: 1.6;
}

/* Адаптив */
@media (min-width: 768px) {
    .modal-slider { height: 60vh; }
}