/**
 * Стили для выбора папок шаблонов
 *
 * @package Watson_Builder
 */

/* Контейнер для выбора папок */
.watson-folders-container {
    font-family: 'Roboto', sans-serif;
    max-height: 600px;
    padding: 0 20px;
    overflow-y: auto;
    margin: 0 auto;
}

.watson-folders-container h3 {
    font-size: 22px;
    margin-bottom: 10px;
    text-align: center;
}

.watson-folders-container p {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
    text-align: center;
}

/* Сетка для отображения папок */
.watson-folders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 30px;
    margin-bottom: 20px;
}

/* Элемент папки */
.watson-folder-item {
    border-radius: 3px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.watson-folder-item:hover {
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.watson-folder-item.active {
    border: 2px solid rgb(60, 65, 230);
}
.watson-folder-item.active .watson-folder-info {
    background-color: rgb(60, 65, 230);
}
/* Изображение папки */
.watson-folder-image {
    position: relative;
    overflow: hidden;
    background-color: #f5f5f5;
    display: flex;
    aspect-ratio: 16/9;
    align-items: center;
    justify-content: center;
    object-fit: contain;
}
.SiteParts-Navbar .watson-folder-image {
    aspect-ratio: 16/4;
}

.watson-folder-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

/* Действия для папки (кнопки) */
.watson-folder-actions {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.watson-folder-item:hover .watson-folder-actions {
    opacity: 1;
}

.watson-folder-insert,
.watson-folder-zoom {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: white;
    border: none;
    margin: 0 5px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.watson-folder-insert:hover,
.watson-folder-zoom:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

.watson-folder-insert svg,
.watson-folder-zoom svg {
    width: 16px;
    height: 16px;
    stroke: #333;
}


/* Лайтбокс для увеличенного просмотра */
.watson-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.watson-lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    margin: auto;
}

.watson-lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    display: block;
    margin: 0 auto;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

.watson-lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    font-size: 30px;
    color: white;
    cursor: pointer;
    transition: color 0.2s ease;
}

.watson-lightbox-close:hover {
    color: #ddd;
}

.watson-lightbox-caption {
    color: white;
    text-align: center;
    padding: 10px 0;
    font-size: 16px;
}

/* Спиннер загрузки */
.watson-loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
}

.watson-loading-spinner .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Сообщение об ошибке */
.watson-error {
    color: #d9534f;
    text-align: center;
    padding: 20px;
    background-color: #f8d7da;
    border-radius: 4px;
    margin: 20px 0;
}

/* Адаптивность */
@media (max-width: 768px) {
    .watson-folders-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .watson-folder-insert,
    .watson-folder-zoom {
        width: 36px;
        height: 36px;
    }
}

/* Дополнительные стили */


/* Информация о папке */
.watson-folder-info {
    position: absolute;
    top: 0;
    left: 0;
    padding: 0 5px;
    background-color: #000;
}

.watson-folder-number {
    font-size: 12px;
    color: #fff;
}

/* Кнопки действий */
.watson-folders-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.watson-folder-select-button,
.watson-folder-cancel-button {
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.watson-folder-select-button {
    background-color: #3C41E6;
    color: white;
}

.watson-folder-select-button:hover {
    background-color: #2C31D6;
    box-shadow: 0 2px 8px rgba(60, 65, 230, 0.4);
}

.watson-folder-cancel-button {
    background-color: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
}

.watson-folder-cancel-button:hover {
    background-color: #e5e5e5;
}

/* Сообщения об ошибках */
.watson-error {
    padding: 15px;
    background-color: #ffebee;
    color: #c62828;
    border-radius: 5px;
    margin: 20px 0;
    text-align: center;
    font-size: 14px;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .watson-folders-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }
    
    .watson-folder-image {
        height: 100px;
    }
    
    .watson-folders-actions {
        flex-direction: column;
    }
    
    .watson-folder-select-button,
    .watson-folder-cancel-button {
        width: 100%;
    }
}

/* Анимация загрузки */
.watson-loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
}



.watson-loading-spinner p {
    color: #666;
    font-size: 14px;
}

@keyframes watson-spinner {
    to { transform: rotate(360deg); }
}
