/* =========================================
ФОТОАЛЬБОМ (/pictures)
========================================= */

.pictures-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.pictures-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.pictures-title {
    color: #fd87f3;
    font-size: 1.8em;
    margin: 0;
}

.pictures-upload-btn {
    background: #6a0e72;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    transition: background 0.2s;
}

.pictures-upload-btn:hover {
    background: #8a1e92;
}

/* Сетка превью */
.pictures-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.pictures-loading {
    grid-column: 1 / -1;
    text-align: center;
    color: #aaa;
    padding: 40px;
}

/* Карточка картинки */
.picture-card {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    background: #1a0a18;
    border: 1px solid #3a1a38;
    transition: transform 0.2s, box-shadow 0.2s;
}

.picture-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(253, 135, 243, 0.2);
}

.picture-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Спойлер */
.picture-card.spoiler img {
    filter: blur(15px);
}

.picture-card.spoiler .spoiler-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-weight: bold;
    font-size: 0.9em;
    pointer-events: none;
}

/* Кнопка "Добавить в альбом" (только для чужих картинок) */
.picture-add-btn {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s;
}

.picture-card:hover .picture-add-btn {
    opacity: 1;
}

.picture-add-btn:hover {
    background: rgba(106, 14, 114, 0.8);
}

.picture-add-btn.added {
    background: rgba(74, 222, 128, 0.8);
    opacity: 1;
}

/* Кнопка удаления (только для своих) */
.picture-delete-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(231, 76, 60, 0.7);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1em;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.picture-card:hover .picture-delete-btn {
    opacity: 1;
}

.picture-delete-btn:hover {
    background: rgba(231, 76, 60, 1);
}

/* Модальное окно просмотра */
.picture-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.picture-modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
}

.picture-modal-content img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
}

.picture-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 2em;
    cursor: pointer;
}

.picture-modal-info {
    color: white;
    text-align: center;
    margin-top: 10px;
    font-size: 0.9em;
}

.picture-modal-info a {
    color: #fd87f3;
    text-decoration: none;
}

/* Модальное окно загрузки */
.upload-modal-content {
    background: #220c20;
    border: 1px solid #4a1a45;
    border-radius: 12px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
}

.upload-modal-content h3 {
    color: #fd87f3;
    margin-top: 0;
}

.upload-file-input {
    width: 100%;
    padding: 10px;
    background: #1a0a18;
    border: 1px solid #3a1a38;
    border-radius: 6px;
    color: #fff;
    margin-top: 10px;
}

.upload-modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: flex-end;
}

.pictures-btn {
    background: #4a1a45;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
}

.pictures-btn-primary {
    background: #6a0e72;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
}

.pictures-load-more-btn {
    background: #4a1a45;
    color: #fd87f3;
    border: 1px solid #6a0e72;
    padding: 10px 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
}

.pictures-load-more-btn:hover {
    background: #6a0e72;
    color: white;
}

/* Адаптивность */
@media (max-width: 768px) {
    .pictures-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }
    
    .pictures-title {
        font-size: 1.4em;
    }
}
/* Кнопка "Добавить в альбом" внутри модального окна */
.picture-modal-content .picture-add-btn {
    opacity: 1; /* Всегда видна */
    background: rgba(0, 0, 0, 0.6);
    width: 40px;
    height: 40px;
    font-size: 1.5em;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    transition: all 0.2s ease;
}

.picture-modal-content .picture-add-btn:hover {
    background: rgba(106, 14, 114, 0.9);
    transform: scale(1.1);
}

/* Состояние "Уже добавлено" */
.picture-modal-content .picture-add-btn.added {
    background: rgba(74, 222, 128, 0.9);
    opacity: 1;
}

/* Анимация удаления карточки */
.picture-card.removing {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease;
}

/* Кнопка админского удаления в модалке */
.picture-modal-content .picture-admin-delete-btn {
    position: absolute;
    top: 10px;
    right: 50px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(231, 76, 60, 0.9);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 10px rgba(231, 76, 60, 0.5);
    z-index: 10;
}

.picture-modal-content .picture-admin-delete-btn:hover {
    background: rgba(231, 76, 60, 1);
    transform: scale(1.1);
}

/* Кнопка админского удаления в карточке превью */
.picture-card .picture-admin-delete-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(231, 76, 60, 0.8);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1em;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s;
    z-index: 5;
}

.picture-card:hover .picture-admin-delete-btn {
    opacity: 1;
}

.picture-admin-delete-btn:hover {
    background: rgba(231, 76, 60, 1);
}