.media-section {
    margin: 3rem 0;
    padding: 0 2rem;
}

.section-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.media-title {
    font-size: 2.2rem;
    color: #e8b4e1;
    margin: 0 0 1rem 0;
    font-weight: 400;
    text-shadow: 0 2px 8px rgba(228, 180, 225, 0.3);
    position: relative;
    display: inline-block;
}

.title-decoration {
    height: 3px;
    background: linear-gradient(90deg, transparent, #e8b4e1, #c47aff, transparent);
    width: 150px;
    margin: 0 auto;
    border-radius: 3px;
}

/* Стили для сетки трейлеров */
.trailers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    justify-content: center;
    margin: 0 auto;
    max-width: 1200px;
}

.trailers-grid iframe {
    width: 100%;
    height: 250px;
    border-radius: 15px;
    border: 2px solid rgba(196, 122, 255, 0.3);
    box-shadow: 0 6px 20px rgba(156, 89, 209, 0.3);
    transition: all 0.4s ease;
    background: rgba(45, 27, 78, 0.6);
}

.trailers-grid iframe:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 30px rgba(228, 180, 225, 0.4);
    border-color: rgba(228, 180, 225, 0.6);
}

/* Стили для сетки скриншотов */
.screenshots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    justify-content: center;
    margin: 0 auto;
    max-width: 1200px;
}

.screenshot-card {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s ease;
    border: 2px solid rgba(196, 122, 255, 0.2);
    box-shadow: 0 4px 15px rgba(156, 89, 209, 0.2);
    background: rgba(45, 27, 78, 0.6);
}

.screenshot-card:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 12px 30px rgba(228, 180, 225, 0.4);
    border-color: rgba(228, 180, 225, 0.5);
}

.screenshot-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: all 0.4s ease;
}

.screenshot-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(90, 58, 122, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
}

.screenshot-card:hover .screenshot-overlay {
    opacity: 1;
}

.zoom-icon {
    font-size: 2.5rem;
    color: #e8b4e1;
    transform: scale(0.8);
    transition: all 0.3s ease;
}

.screenshot-card:hover .zoom-icon {
    transform: scale(1.1);
}

/* Улучшенное модальное окно с фиксированным центрированием */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 11, 46, 0.95);
    backdrop-filter: blur(10px);
    opacity: 0;
    transition: opacity 0.3s ease;
    overflow: hidden;
}

.modal.show {
    opacity: 1;
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    color: #e8b4e1;
    font-size: 2.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 2001;
    background: rgba(45, 27, 78, 0.8);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(228, 180, 225, 0.3);
}

.close-btn:hover {
    color: #c47aff;
    transform: scale(1.1);
    background: rgba(228, 180, 225, 0.2);
}

.modal-navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    width: 100%;
    margin-bottom: 1rem;
}

.nav-btn {
    background: rgba(228, 180, 225, 0.8);
    color: #5a3a7a;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nav-btn:hover {
    background: #e8b4e1;
    transform: scale(1.1);
}

.modal-image {
    max-width: 100%;
    max-height: calc(80vh - 100px);
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-info {
    margin-top: 1rem;
    text-align: center;
}

.modal-counter {
    color: #e8b4e1;
    font-size: 1.1rem;
    background: rgba(45, 27, 78, 0.8);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid rgba(228, 180, 225, 0.3);
}

/* Адаптивность */
@media (max-width: 768px) {
    .media-section {
        padding: 0 1rem;
    }
    
    .trailers-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .trailers-grid iframe {
        height: 200px;
    }
    
    .screenshots-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        padding: 10px;
    }
    
    .modal-navigation {
        gap: 0.5rem;
    }
    
    .nav-btn {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }
    
    .modal-image {
        max-height: calc(90vh - 120px);
    }
    
    .close-btn {
        top: 5px;
        right: 5px;
        width: 40px;
        height: 40px;
        font-size: 2rem;
    }
}

/* Анимация появления элементов */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.trailers-grid iframe,
.screenshot-card {
    animation: fadeInUp 0.6s ease-out;
}