/* ===================================== */
/*         БАЗОВЫЕ СТИЛИ МОДАЛОК         */
/* ===================================== */

/* Все модальные окна скрыты по умолчанию */
.modal {
    display: none !important;
}

/* Показываем только активные */
.modal.active {
    display: block !important;
}

/* Специфично для cover-modal */
.cover-modal.active {
    display: flex !important;
}



/* ===================================== */
/*            COVER MODAL                */
/* ===================================== */

/* Затемнение фона */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    z-index: 29999;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

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

/* Модальное окно */
.cover-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    z-index: 30000;
    align-items: center;
    justify-content: center;
}

.cover-modal.active {
    display: flex;
}

/* Контент */
.cover-modal .modal-content {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    max-width: 100vw;
    max-height: 100vh;
}

/* Контейнер изображения */
.cover-modal-image-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    cursor: zoom-in;
    position: relative;
}

/* Изображение */
.cover-modal-image {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    transition: transform 0.3s ease;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    cursor: zoom-in;
    position: relative;
    margin: auto;
    display: block;
}

.cover-modal-image.zoomed {
    cursor: zoom-out;
    max-width: none;
    max-height: none;
    transform: scale(2);
}

/* Подпись */
.cover-modal-caption {
    position: absolute;
    bottom: 30px;
    left: 0;
    right: 0;
    text-align: center;
    color: white;
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
    z-index: 30001;
    pointer-events: none;
}

.cover-title {
    font-size: 18px;
    font-weight: 600;
    display: block;
    margin-bottom: 4px;
}

.cover-subtitle {
    font-size: 14px;
    color: var(--accent);
    display: block;
}

/* Кнопка закрытия */
.cover-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    border: 2px solid rgba(255,255,255,0.3);
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 30001;
    backdrop-filter: blur(5px);
}

.cover-modal-close:hover {
    background: #FFD700;
    color: #000;
    transform: scale(1.1) rotate(90deg);
    border-color: #FFD700;
}

/* Инструменты */
.cover-tools {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 30001;
}

.cover-modal-content:hover .cover-tools {
    opacity: 1;
}

.cover-tool-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    border: 2px solid rgba(255,255,255,0.3);
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    backdrop-filter: blur(5px);
}

.cover-tool-btn:hover {
    background: #FFD700;
    color: #000;
    transform: scale(1.1);
    border-color: #FFD700;
}

/* Адаптив */
@media (max-width: 768px) {
    .cover-modal-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .cover-tools {
        opacity: 1;
        bottom: 10px;
        right: 10px;
    }

    .cover-tool-btn {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .cover-title {
        font-size: 16px;
    }
    
    .cover-subtitle {
        font-size: 12px;
    }
    
    .cover-modal-caption {
        bottom: 20px;
    }
}

/* Для очень маленьких экранов */
@media (max-width: 480px) {
    .cover-modal-close {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
    
    .cover-tool-btn {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
}

/* Анимации */
@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.cover-modal.active .cover-modal-image {
    animation: zoomIn 0.3s ease;
}

/* Убираем скролл у body когда модалка открыта */
body.modal-open {
    overflow: hidden;
}



/* Затемнение фона */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 29999;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    cursor: pointer;
}

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

/* Модальное окно */
#trackInfoModal {
    z-index: 30000;
}

#trackInfoModal .modal-content {
    z-index: 30001;
    position: relative;
}

/* Стили для модального окна с улучшениями */
#updateModal .modal-content {
    background: linear-gradient(145deg, #1e1e2a, #13131f);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 24px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    max-height: 80vh;
}

#updateModal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: rgba(0, 0, 0, 0.4);
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
    position: relative;
    z-index: 1;
    backdrop-filter: blur(10px);
    flex-shrink: 0;
}

#updateModal .modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#updateModal .modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    backdrop-filter: blur(5px);
}

#updateModal .modal-close:hover {
    background: #ff4b4b;
    transform: rotate(90deg);
}

#updateModal .modal-body {
    padding: 20px;
    position: relative;
    z-index: 1;
    overflow-y: auto;
    flex: 1;
}

#updateModal .update-content h3 {
    color: var(--accent);
    margin-bottom: 15px;
    font-size: 16px;
}

#updateModal .update-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#updateModal .update-content ul li {
    padding: 8px 0;
    color: var(--text-main);
    font-size: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

#updateModal .update-content ul li:last-child {
    border-bottom: none;
}

#updateModal .modal-footer {
    display: flex;
    gap: 10px;
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 215, 0, 0.1);
    flex-shrink: 0;
    justify-content: flex-end;
}

#updateModal .modal-btn.primary {
    background: linear-gradient(135deg, var(--accent), #ffaa00);
    color: #000;
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3);
    padding: 10px 24px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

#updateModal .modal-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.5);
}
