/* Стили для галереи фотографий */
.photo-gallery-container {
    display: grid;
    gap: 15px;
    margin: 20px 0;
}

/* Количество колонок */
.photo-gallery-container.columns-1 {
    grid-template-columns: 1fr;
}

.photo-gallery-container.columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.photo-gallery-container.columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.photo-gallery-container.columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

.photo-gallery-container.columns-5 {
    grid-template-columns: repeat(5, 1fr);
}

.photo-gallery-container.columns-6 {
    grid-template-columns: repeat(6, 1fr);
}

/* Элементы галереи */
.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: #f8f9fa;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.gallery-item a {
    display: block;
    text-decoration: none;
}

.gallery-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
    border-radius: 8px;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* Лайтбокс стили */
.gallery-item a[data-lightbox] {
    cursor: pointer;
}

/* Адаптивные стили */
@media (max-width: 768px) {
    .photo-gallery-container.columns-3,
    .photo-gallery-container.columns-4,
    .photo-gallery-container.columns-5,
    .photo-gallery-container.columns-6 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .gallery-item img {
        height: 150px;
    }
}

@media (max-width: 480px) {
    .photo-gallery-container {
        grid-template-columns: 1fr !important;
        gap: 10px;
    }
    
    .gallery-item img {
        height: 200px;
    }
}

/* Стили для админки */
#photo-gallery-admin {
    padding: 15px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.gallery-upload-area {
    margin-bottom: 20px;
    padding: 20px;
    border: 2px dashed #ccc;
    border-radius: 5px;
    text-align: center;
    background: white;
}

.gallery-upload-area:hover {
    border-color: #0073aa;
    background: #f0f8ff;
}

#gallery-images-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    margin-top: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.gallery-image-item {
    position: relative;
    border: 2px solid #ddd;
    border-radius: 5px;
    overflow: hidden;
    background: white;
    transition: border-color 0.3s ease;
}

.gallery-image-item:hover {
    border-color: #0073aa;
}

.gallery-image-item img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    display: block;
}

.delete-image {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-image-item:hover .delete-image {
    opacity: 1;
}

.delete-image:hover {
    background: #c82333;
}

/* Кнопки выбора медиабиблиотеки */
.media-library-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.select-from-library {
    background: #0073aa;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
}

.select-from-library:hover {
    background: #005a87;
}

.upload-new-images {
    background: #00a32a;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
}

.upload-new-images:hover {
    background: #008a20;
}

/* Простой лайтбокс */
.photo-lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    animation: fadeIn 0.3s;
}

.photo-lightbox.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
}

.lightbox-content img {
    width: 100%;
    height: auto;
    border-radius: 5px;
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    line-height: 1;
}

.lightbox-close:hover {
    color: #ccc;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    font-size: 24px;
    padding: 15px 20px;
    cursor: pointer;
    border-radius: 5px;
    transition: background 0.3s ease;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.3);
}

.lightbox-prev {
    left: -60px;
}

.lightbox-next {
    right: -60px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Загрузочный индикатор */
.gallery-loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.gallery-loading:before {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #ccc;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Сообщение об отсутствии изображений */
.no-images-message {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
    background: #f8f9fa;
    border-radius: 5px;
    border: 1px dashed #ccc;
} 