/* Simple Photo Gallery Styles */

.simple-photo-gallery-container {
    max-width: 100%;
    margin: 20px 0;
}

.simple-photo-gallery {
    margin: 20px 0;
    max-width: 100%;
}

/* Bootstrap-like Grid System */
.simple-photo-gallery .row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

.simple-photo-gallery .gallery-item {
    position: relative;
    overflow: hidden;
    
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    background: #fff;
    cursor: pointer;
    width: 100%;
    margin: 0 10px 20px 10px;
    display: flex;
    flex-direction: column;
    padding: 0;
}

.simple-photo-gallery .gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.simple-photo-gallery .gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.simple-photo-gallery .gallery-item:hover img {
    transform: scale(1.05);
}

/* Отключаем приближение для карусели */
.simple-photo-gallery.spg-mode-carousel .gallery-item:hover img {
    transform: none;
}

.simple-photo-gallery .gallery-item p {
    padding: 15px;
    margin: 0;
    font-size: 14px;
    color: #333;
    text-align: center;
    background: #fff;
    border-top: 1px solid #f0f0f0;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Bootstrap Grid Classes */
/* Extra Small devices (phones, less than 576px) */
.simple-photo-gallery .col-xs-12 { flex: 0 0 100%; max-width: 100%; }
.simple-photo-gallery .col-xs-6 { flex: 0 0 50%; max-width: 50%; }
.simple-photo-gallery .col-xs-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
.simple-photo-gallery .col-xs-3 { flex: 0 0 25%; max-width: 25%; }
.simple-photo-gallery .col-xs-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) {
    .simple-photo-gallery .col-sm-12 { flex: 0 0 100%; max-width: 100%; }
    .simple-photo-gallery .col-sm-6 { flex: 0 0 50%; max-width: 50%; }
    .simple-photo-gallery .col-sm-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
    .simple-photo-gallery .col-sm-3 { flex: 0 0 25%; max-width: 25%; }
    .simple-photo-gallery .col-sm-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) {
    .simple-photo-gallery .col-md-12 { flex: 0 0 100%; max-width: 100%; }
    .simple-photo-gallery .col-md-6 { flex: 0 0 50%; max-width: 50%; }
    .simple-photo-gallery .col-md-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
    .simple-photo-gallery .col-md-3 { flex: 0 0 25%; max-width: 25%; }
    .simple-photo-gallery .col-md-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
    .simple-photo-gallery .col-lg-12 { flex: 0 0 100%; max-width: 100%; }
    .simple-photo-gallery .col-lg-6 { flex: 0 0 50%; max-width: 50%; }
    .simple-photo-gallery .col-lg-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
    .simple-photo-gallery .col-lg-3 { flex: 0 0 25%; max-width: 25%; }
    .simple-photo-gallery .col-lg-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .simple-photo-gallery .col-xl-12 { flex: 0 0 100%; max-width: 100%; }
    .simple-photo-gallery .col-xl-6 { flex: 0 0 50%; max-width: 50%; }
    .simple-photo-gallery .col-xl-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
    .simple-photo-gallery .col-xl-3 { flex: 0 0 25%; max-width: 25%; }
    .simple-photo-gallery .col-xl-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
}

/* XXL devices (extra large desktops, 1400px and up) */
@media (min-width: 1400px) {
    .simple-photo-gallery .col-xxl-12 { flex: 0 0 100%; max-width: 100%; }
    .simple-photo-gallery .col-xxl-6 { flex: 0 0 50%; max-width: 50%; }
    .simple-photo-gallery .col-xxl-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
    .simple-photo-gallery .col-xxl-3 { flex: 0 0 25%; max-width: 25%; }
    .simple-photo-gallery .col-xxl-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
}

/* Predefined Grid Layouts */
.simple-photo-gallery.grid-1 .gallery-item {
    flex: 0 0 100%;
    max-width: 100%;
}

.simple-photo-gallery.grid-2 .gallery-item {
    flex: 0 0 calc(50% - 20px);
    max-width: calc(50% - 20px);
}

.simple-photo-gallery.grid-3 .gallery-item {
    flex: 0 0 calc(33.333333% - 20px);
    max-width: calc(33.333333% - 20px);
}

.simple-photo-gallery.grid-4 .gallery-item {
    flex: 0 0 calc(25% - 20px);
    max-width: calc(25% - 20px);
}

.simple-photo-gallery.grid-5 .gallery-item {
    flex: 0 0 calc(20% - 20px);
    max-width: calc(20% - 20px);
}

.simple-photo-gallery.grid-6 .gallery-item {
    flex: 0 0 calc(16.666667% - 20px);
    max-width: calc(16.666667% - 20px);
}

/* Responsive adjustments for predefined grids */
@media (max-width: 768px) {
    .simple-photo-gallery.grid-2 .gallery-item,
    .simple-photo-gallery.grid-3 .gallery-item,
    .simple-photo-gallery.grid-4 .gallery-item,
    .simple-photo-gallery.grid-5 .gallery-item,
    .simple-photo-gallery.grid-6 .gallery-item {
        flex: 0 0 calc(50% - 20px);
        max-width: calc(50% - 20px);
    }
}

@media (max-width: 480px) {
    .simple-photo-gallery.grid-2 .gallery-item,
    .simple-photo-gallery.grid-3 .gallery-item,
    .simple-photo-gallery.grid-4 .gallery-item,
    .simple-photo-gallery.grid-5 .gallery-item,
    .simple-photo-gallery.grid-6 .gallery-item {
        flex: 0 0 calc(100% - 20px);
        max-width: calc(100% - 20px);
    }
}

/* Адаптивность изображений */
@media (max-width: 768px) {
    .simple-photo-gallery .gallery-item img {
        height: 200px;
    }
}

@media (max-width: 480px) {
    .simple-photo-gallery .gallery-item img {
        height: 180px;
    }
}

/* Теги изображений */
.spg-image-tags {
    padding: 10px 15px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    flex-shrink: 0;
}

.spg-tag {
    display: inline-block;
    background: #007bff;
    color: white;
    padding: 2px 8px;
    margin: 2px;
    
    font-size: 11px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    user-select: none;
}

.spg-tag-more {
    background: #6c757d;
    font-style: italic;
    cursor: default;
}

.spg-no-tags {
    color: #6c757d;
    font-style: italic;
    font-size: 11px;
}

/* Название для отображения */
.spg-display-title {
    font-weight: 600;
    color: #333;
    margin: 0;
    padding: 10px 15px;
    background: #fff;
    border-top: 1px solid #f0f0f0;
    flex-shrink: 0;
}

/* Ссылка на статью */
.spg-article-link {
    display: block;
    padding: 8px 15px;
    background: #28a745;
    color: white;
    text-decoration: none;
    text-align: center;
    font-size: 12px;
    font-weight: 500;
    transition: background 0.3s ease;
    flex-shrink: 0;
}

.spg-article-link:hover {
    background: #218838;
    color: white;
    text-decoration: none;
}

/* Фильтр по тегам - мультивыбор */
.spg-tag-filter {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    
}

.spg-tag-filter h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #333;
}

.spg-tag-selection {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.spg-tag-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
    background: #fff;
    
    border: 1px solid #e9ecef;
}

.spg-tag-checkbox {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 13px;
    color: #495057;
    user-select: none;
}

.spg-tag-checkbox:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.spg-tag-checkbox input[type="checkbox"] {
    margin-right: 8px;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.spg-tag-checkbox input[type="checkbox"]:checked + .spg-tag-label {
    color: #007bff;
    font-weight: 600;
}

.spg-tag-checkbox:has(input[type="checkbox"]:checked) {
    background: #e3f2fd;
    border-color: #007bff;
}

.spg-tag-label {
    display: flex;
    align-items: center;
    gap: 5px;
}

.spg-tag-count {
    font-size: 11px;
    opacity: 0.7;
    background: #6c757d;
    color: #fff;
    padding: 2px 6px;
    
    font-weight: normal;
}

.spg-filter-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.spg-filter-controls button {
    padding: 8px 16px;
    border: none;
    
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.spg-select-all {
    background: #28a745;
    color: #fff;
}

.spg-select-all:hover {
    background: #218838;
}

.spg-clear-selection {
    background: #dc3545;
    color: #fff;
}

.spg-clear-selection:hover {
    background: #c82333;
}

.spg-invert-selection {
    background: #6c757d;
    color: #fff;
}

.spg-invert-selection:hover {
    background: #5a6268;
}

.spg-selected-tags {
    font-size: 13px;
    color: #666;
    padding: 10px;
    background: #fff;
    
    border: 1px solid #e9ecef;
}

.spg-selected-tags-list {
    font-weight: bold;
    color: #007bff;
    margin-left: 5px;
}

/* Адаптивность фильтра тегов */
@media (max-width: 768px) {
    .spg-tag-filter {
        padding: 12px;
    }
    
    .spg-tag-checkboxes {
        gap: 8px;
        max-height: 150px;
    }
    
    .spg-tag-checkbox {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .spg-filter-controls {
        gap: 8px;
    }
    
    .spg-filter-controls button {
        padding: 6px 12px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .spg-tag-filter {
        padding: 10px;
    }
    
    .spg-tag-filter h3 {
        font-size: 14px;
        margin-bottom: 12px;
    }
    
    .spg-tag-checkboxes {
        gap: 6px;
        max-height: 120px;
        padding: 8px;
    }
    
    .spg-tag-checkbox {
        padding: 5px 8px;
        font-size: 11px;
    }
    
    .spg-tag-checkbox input[type="checkbox"] {
        width: 14px;
        height: 14px;
        margin-right: 6px;
    }
    
    .spg-filter-controls {
        gap: 6px;
    }
    
    .spg-filter-controls button {
        padding: 5px 10px;
        font-size: 11px;
    }
    
    .spg-selected-tags {
        font-size: 12px;
        padding: 8px;
    }
}

/* Предотвращение прокрутки при открытом модальном окне */
body.spg-modal-open {
    overflow: hidden;
}

.spg-tag-input {
    display: none;
}

/* Модальное окно */
.spg-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0px!important;
    box-sizing: border-box;
    text-align: center;
}

.spg-modal-content {
    background: transparent;
    position: relative;
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 600px) {
    .spg-modal-content {
        min-width: 90vw;
        width: 98vw;
        max-width: 98vw;
    }
}

/* Карусель в модальном окне */
.spg-modal-carousel {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.spg-modal-slides {
    position: relative;
    flex: 1;
    overflow: hidden;
    min-height: 400px;
}

.spg-modal-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-sizing: border-box;
    background: transparent;
}

.spg-modal-slide.active {
    display: flex !important;
    z-index: 1;
}

.spg-modal-slide img {
    height: 100vh;
    width: auto;
    max-width: none;
    object-fit: contain;
    display: block;
}

.spg-modal-slide .spg-modal-tags {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: none;
    padding: 0px 14px;
    text-align: center;
}

.spg-modal-slide .spg-modal-tags .spg-tag {
    background: #007bff;
    color: white;
    padding: 2px 6px;
    margin: 2px;
    
    font-size: 12px;
}

.spg-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 24px;
    cursor: pointer;
    color: #ffffff;
    z-index: 10002;
    background: rgb(0 0 0 / 79%);
    width: 30px;
    height: 30px;
    
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding-bottom: 6px;
}

.spg-modal-close:hover {
    background: rgba(255, 255, 255, 1);
    color: #333;
}

.spg-modal-content img {
    max-width: 100%;
    display: block;
    object-fit: contain;
}

.spg-modal-caption {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    color: #fff;
    font-size: 16px;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.55);
    text-align: center;
    z-index: 10001;
}
.spg-modal-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 10px;
}
.spg-modal-tags {
    margin: 10px 0 0 0;
}
.spg-modal-article {
    margin: 20px 0 0 0;
    text-align: center;
    width: 100%;
}
.spg-modal-article .spg-article-link {
    display: block;
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
    padding: 12px 0;
    background: #007bff;
    color: white;
    text-decoration: none;
    
    font-size: 16px;
    font-weight: 500;
    transition: background 0.3s ease;
}
.spg-modal-article .spg-article-link:hover {
    background: #0056b3;
    color: white;
    text-decoration: none;
}

/* Адаптивность модального окна */
@media (max-width: 768px) {
    .spg-modal {
        padding: 10px;
    }
    
    .spg-modal-content {
        max-width: 95%;
        max-height: 95%;
    }
    
    .spg-modal-content img {
        max-height: 70vh;
    }
    
    .spg-modal-close {
        top: 5px;
        right: 10px;
        width: 25px;
        height: 25px;
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .spg-modal {
        padding: 5px;
    }
    
    .spg-modal-content {
        max-width: 98%;
        max-height: 98%;
    }
    
    .spg-modal-content img {
        max-height: 60vh;
    }
    
    .spg-modal-info {
        padding: 10px;
    }
    
    .spg-modal-info h3 {
        font-size: 16px;
    }
    
    .spg-modal-close {
        top: 3px;
        right: 8px;
        width: 22px;
        height: 22px;
        font-size: 16px;
    }
}

.spg-no-images,
.spg-error {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
    background: #f8f9fa;
    
    margin: 20px 0;
}

.spg-loading {
    text-align: center;
    padding: 40px 20px;
    color: #007bff;
    font-weight: 500;
    background: #e8f4fd;
    
    margin: 20px 0;
}

.spg-error {
    color: #dc3545;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
}

/* Состояние загрузки для элементов галереи */
.spg-loading-state {
    opacity: 0.5;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.spg-loading-state img {
    cursor: not-allowed;
}

.spg-loading-state:hover {
    transform: none !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
}

.spg-loading-state:hover img {
    transform: none !important;
}

/* Состояние загрузки для кнопок фильтрации */
.spg-filter-controls button.spg-loading-state {
    opacity: 0.6;
    pointer-events: none;
    cursor: not-allowed;
}

.spg-filter-controls button.spg-loading-state:hover {
    background-color: #007bff !important;
    color: white !important;
}

/* Кнопка "Подгрузить еще" */
.spg-load-more-container {
    text-align: center;
    margin: 30px 0;
    padding: 20px 0;
}

.spg-load-more-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 12px 30px;
    
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.spg-load-more-btn:hover {
    background: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
}

.spg-load-more-btn:active {
    transform: translateY(0);
}

.spg-load-more-btn.spg-loading-state {
    opacity: 0.7;
    pointer-events: none;
    cursor: not-allowed;
}

.spg-load-more-btn.spg-loading-state:hover {
    transform: none;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.spg-load-more-btn.hidden {
    display: none;
}

/* Loading state */
.simple-photo-gallery.loading {
    opacity: 0.6;
    pointer-events: none;
}

.simple-photo-gallery:empty::before {
    content: "Загрузка галереи...";
    display: block;
    text-align: center;
    padding: 40px;
    color: #666;
    font-style: italic;
}

/* Hover effects */
.simple-photo-gallery .gallery-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease;
    z-index: 1;
    pointer-events: none;
}

.simple-photo-gallery .gallery-item:hover::before {
    background: rgba(0, 0, 0, 0.1);
}

/* Masonry Layout (Optional) */
.simple-photo-gallery.masonry {
    columns: 3;
    column-gap: 20px;
}

.simple-photo-gallery.masonry .gallery-item {
    break-inside: avoid;
    margin-bottom: 20px;
    display: block;
}

@media (max-width: 768px) {
    .simple-photo-gallery.masonry {
        columns: 2;
        column-gap: 15px;
    }
}

@media (max-width: 480px) {
    .simple-photo-gallery.masonry {
        columns: 1;
        column-gap: 10px;
    }
}

/* Режим карусель */
.simple-photo-gallery.spg-mode-carousel {
    position: relative;
    overflow: hidden;
    max-width: 100%;
    margin: 20px 0;
}

.spg-carousel-container {
    display: flex;
    transition: transform 0.5s ease-in-out;
    width: 100%;
}

.spg-mode-carousel .gallery-item {
    flex: 0 0 100%;
    min-width: 100%;
    position: relative;
    overflow: hidden;
    
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    background: #fff;
    margin: 0;
}

.spg-mode-carousel .gallery-item img {
    width: 100%;
    height: 80vh;
    object-fit: cover;
    display: block;
}

/* Навигация карусели */
.spg-carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    
    font-size: 18px;
    cursor: pointer;
    z-index: 10;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spg-carousel-nav:hover {
    background: rgba(0, 0, 0, 0.9);
}

.spg-carousel-prev {
    left: 10px;
}

.spg-carousel-next {
    right: 10px;
}

/* Индикаторы карусели */
.spg-carousel-indicators {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 15px;
}

.spg-carousel-indicator {
    width: 12px;
    height: 12px;
    
    background: #ccc;
    cursor: pointer;
    transition: background 0.3s ease;
}

.spg-carousel-indicator.active {
    background: #007bff;
}

.spg-carousel-indicator:hover {
    background: #007bff;
}

/* Адаптивность для карусели */
@media (max-width: 768px) {
    .spg-mode-carousel .gallery-item img {
        height: 300px;
    }
    
    .spg-carousel-nav {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .spg-mode-carousel .gallery-item img {
        height: 250px;
    }
    
    .spg-carousel-nav {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }
    
    .spg-carousel-indicators {
        gap: 6px;
    }
    
    .spg-carousel-indicator {
        width: 10px;
        height: 10px;
    }
}

/* Скрытие фильтра тегов в режиме карусель */
.spg-mode-carousel .spg-tag-filter {
    display: none;
}

/* Анимации для карусели */
.spg-carousel-container {
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.spg-carousel-container.sliding {
    transition: transform 0.3s ease-out;
}

/* Стили для модального окна в карусели */
.spg-modal.spg-carousel-modal .spg-modal-content {
    max-width: 95%;
    max-height: 95%;
}

.spg-modal.spg-carousel-modal .spg-modal-content img {
    max-height: 80vh;
    object-fit: contain;
}

/* Слайды в модальном окне */
.spg-modal-slides {
    position: relative;
    width: 100%;
    height: 100%;
}

.spg-modal-slide {
    display: none!important;
    width: 100%;
    height: 100%;
}
.spg-modal-slide:first-child {
    display: block;
}

.spg-modal-slide img {
    width: 100%;
    height: auto;
    max-height: 84vh;
    object-fit: contain;
    display: block;
}

.spg-modal-slide .spg-modal-info {
    padding: 20px;
    background: white;
}

/* Навигация в модальном окне карусели */
.spg-modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    
    font-size: 24px;
    cursor: pointer;
    z-index: 10001;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spg-modal-nav:hover {
    background: rgba(0, 0, 0, 1);
}

.spg-modal-prev {
    left: 20px;
}

.spg-modal-next {
    right: 20px;
}

/* Индикаторы в модальном окне */
.spg-modal-indicators {
    display: none;
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    gap: 10px;
    z-index: 10001;
}

.spg-modal-indicator {
    width: 15px;
    height: 15px;
    
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background 0.3s ease;
}

.spg-modal-indicator.active {
    background: white;
}

/* Адаптивность для модального окна */
@media (max-width: 768px) {
    .spg-modal-nav {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .spg-modal-prev {
        left: 10px;
    }
    
    .spg-modal-next {
        right: 10px;
    }
    
    .spg-modal-indicators {
        bottom: 10px;
    }
    
    .spg-modal-indicator {
        width: 12px;
        height: 12px;
    }
}

/* ===== Frontend fullscreen modal overrides ===== */
.spg-modal.spg-frontend { background: rgba(0,0,0,0.9); }
.spg-modal.spg-frontend .spg-modal-content {
    background: transparent;
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 0;
    border: none;
    
    box-shadow: none;
    max-width: 100vw;
    max-height: 100vh;
}
.spg-modal.spg-frontend .spg-modal-slides { min-height: 0; }
.spg-modal.spg-frontend .spg-modal-slide { padding: 0; background: transparent; }
.spg-modal.spg-frontend .spg-modal-slide img { height: 100vh; width: inherit; max-width: none; object-fit: contain; }
.spg-modal.spg-frontend .spg-modal-caption {
    top: -4px;
    left: 0;
    right: 0;
    background: none;
    color: #fff;
    font-size: 25px;
}
.spg-modal.spg-frontend .spg-modal-slide .spg-modal-tags {
    bottom: 0;
    left: 0;
    right: 0;
    background: none
}
.spg-modal.spg-frontend .spg-modal-nav { background: rgba(0,0,0,0.6); }
.spg-modal.spg-frontend .spg-modal-nav:hover { background: rgba(0,0,0,0.85); }

/* Стили для спиннера загрузки изображений */
.spg-image-container {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    
}

.spg-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

.spg-image-spinner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    
    z-index: 1;
}

.spg-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #e9ecef;
    border-top: 3px solid #007bff;
    
    animation: spg-spin 1s linear infinite;
}

.spg-error-icon {
    width: 30px;
    height: 30px;
    background: #dc3545;
    color: white;
    
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
}

.spg-image-spinner.spg-error {
    background: #f8d7da;
}

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

/* Адаптивность для спиннера */
@media (max-width: 768px) {
    .spg-image-container {
        height: 150px;
    }
    
    .spg-spinner {
        width: 25px;
        height: 25px;
        border-width: 2px;
    }
    
    .spg-error-icon {
        width: 25px;
        height: 25px;
        font-size: 14px;
    }
} 

@media (max-width: 768px) {
    .spg-image-container {
        height: 200px;
    }
    
    .spg-spinner {
        width: 30px;
        height: 30px;
    }
    
    .spg-error-icon {
        font-size: 24px;
    }
}

/* Стили для модального окна редактирования */
.spg-modal {
    display: none;
    position: fixed;
    z-index: 100000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.spg-modal-content {
    background-color: #fefefe;
    margin: 0 auto;
    padding: 0;
    border: 1px solid #888;
    width: 80%;
    max-width: 800px;
    
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    overflow-y: hidden;
}

.spg-modal-header {
    background-color: #f8f9fa;
    padding: 15px 20px;
    border-bottom: 1px solid #dee2e6;
    
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.spg-modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 18px;
}

/* Кнопка "Читать" в модальном окне */
.spg-modal-link {
    display: inline-block;
    position: absolute;
    background: #28a745;
    color: white;
    text-decoration: none;
    
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    z-index: 10003;
    padding: 8px 20px;
    margin-left: 15px;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.spg-modal-link {
    position: fixed;
    bottom: 60px;
    left: 50%;
    right: auto;
    top: auto;
    transform: translateX(-50%);
    font-size: 14px;
    padding: 4px 20px;
    z-index: 10004;
    box-shadow: 0 4px 20px rgb(255 255 255 / 50%);
    opacity: 0.8;
}

/* Контейнер для кнопки "Читать" */
.spg-modal-read-button-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 0;
    z-index: 10003;
    pointer-events: none;
}

.spg-modal-read-button-container .spg-modal-link {
    pointer-events: auto;
}

.spg-modal-close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.spg-modal-close:hover,
.spg-modal-close:focus {
    color: #000;
    text-decoration: none;
}

.spg-modal-body {
    padding: 20px;
}

.spg-modal-footer {
    background-color: #f8f9fa;
    padding: 15px 20px;
    border-top: 1px solid #dee2e6;
    
    text-align: right;
}

.spg-modal-footer button {
    margin-left: 10px;
}

/* Стили для тегов в модальном окне */
.spg-modal .spg-tags-container {
    margin-top: 10px;
}

.spg-modal .spg-tag-list {
    margin: 10px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.spg-modal .spg-tag {
    display: inline-block;
    background-color: #e9ecef;
    color: #495057;
    padding: 4px 8px;
    
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid #dee2e6;
}

.spg-modal .spg-tag:hover {
    background-color: #007cba;
    color: white;
    border-color: #007cba;
}

.spg-modal .spg-tag.selected {
    background-color: #007cba;
    color: white;
    border-color: #007cba;
}

.spg-modal .spg-tag.selected .remove-tag {
    margin-left: 5px;
    cursor: pointer;
    font-weight: bold;
}

.spg-modal .spg-tag.selected .remove-tag:hover {
    color: #ff6b6b;
}

.spg-modal .spg-new-tag {
    margin-top: 15px;
}

.spg-modal .spg-new-tag input {
    margin-right: 10px;
    width: 200px;
}

.spg-modal .spg-selected-tags-list {
    margin-top: 10px;
    min-height: 30px;
    padding: 5px;
    border: 1px solid #dee2e6;
    
    background-color: #f8f9fa;
}

/* Адаптивность для модального окна */
@media (max-width: 768px) {
    .spg-modal-content {
        width: 95%;
        margin: 10% auto;
        max-height: 80vh;
    }
    
    .spg-modal-header {
        padding: 10px 15px;
    }
    
    .spg-modal-body {
        padding: 15px;
    }
    
    .spg-modal-footer {
        padding: 10px 15px;
    }
    
    .spg-modal .spg-new-tag input {
        width: 100%;
        margin-bottom: 10px;
    }
}

@media (max-width: 480px) {
    .spg-modal-content {
        width: 98%;
        margin: 5% auto;
    }
    
    .spg-modal-header h3 {
        font-size: 16px;
    }
    
    .spg-modal .spg-tag-list {
        gap: 3px;
    }
    
    .spg-modal .spg-tag {
        font-size: 11px;
        padding: 3px 6px;
    }
} 