/* ===== СТИЛИ ДЛЯ ГАЛЕРЕИ ===== */

.gallery-page {
    padding: 40px 0;
    min-height: calc(100vh - 200px);
}

.gallery-page-header {
    text-align: center;
    margin-bottom: 40px;
}

.gallery-page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 16px;
    color: var(--dark);
}

.gallery-page-header p {
    color: var(--gray);
    font-size: 1.1rem;
    margin-bottom: 24px;
}

.gallery-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.gallery-filters select {
    padding: 10px 20px;
    border: 2px solid var(--gray-light);
    border-radius: var(--border-radius);
    background: white;
    font-size: 1rem;
    cursor: pointer;
}


/* Сетка галереи */

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.gallery-item {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.gallery-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: var(--transition);
}

.gallery-item:hover .gallery-image {
    transform: scale(1.05);
}

.gallery-info {
    padding: 16px;
}

.gallery-author {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.author-avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.gallery-rating {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #FFC107;
    font-weight: 600;
}

.gallery-date {
    font-size: 0.8rem;
    color: var(--gray);
    margin-top: 8px;
}


/* Модальное окно фото */

.photo-modal-content {
    max-width: 900px;
    width: 95%;
    padding: 0;
    overflow: hidden;
}

.photo-modal-content img {
    width: 100%;
    max-height: 70vh;
    object-fit: contain;
    background: #000;
}

.photo-modal-content .modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
}

.photo-info {
    padding: 20px;
    background: white;
}

.photo-author {
    font-size: 1.1rem;
    margin-bottom: 16px;
}


/* Пустое состояние */

.empty-gallery {
    text-align: center;
    padding: 60px;
    color: var(--gray);
}

.empty-gallery i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.3;
}

.gallery-card:hover {
    transform: translateY(-5px);
}

.btn-small {
    padding: 5px 12px;
    font-size: 0.85rem;
}

.btn-outline {
    background: transparent;
    border: 2px solid #2E7D32;
    color: #2E7D32;
    text-decoration: none;
    display: inline-block;
}

.btn-outline:hover {
    background: #2E7D32;
    color: white;
}

.btn-outline.active {
    background: #2E7D32;
    color: white;
}

.delete-btn:hover {
    background: #dc3545 !important;
    transform: scale(1.05);
}

.form-control {
    border: 2px solid #E8F5E9;
    border-radius: 12px;
    padding: 10px;
}

.form-control:focus {
    outline: none;
    border-color: #2E7D32;
}

.success-message,
.error-message {
    animation: fadeOut 5s forwards;
}

@keyframes fadeOut {
    0% {
        opacity: 1;
    }

    70% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        visibility: hidden;
    }
}

/* Единый ряд звезд для рейтинга и голосования */
.star-rating {
    display: inline-flex;
    flex-direction: row;
    gap: 3px;
    cursor: pointer;
}

.star-rating i {
    font-size: 18px;
    color: #ddd;
    transition: color 0.2s;
}

.star-rating i.filled,
.star-rating i.hover,
.star-rating i.selected {
    color: #FFC107;
}

.star-rating i.disabled {
    cursor: default;
}

.rating-container {
    margin-top: 8px;
}

.rating-message {
    font-size: 12px;
    margin-top: 5px;
}

.rating-message.success {
    color: #2E7D32;
}

.rating-message.error {
    color: #C62828;
}

.vote-count {
    font-size: 11px;
    color: #999;
    margin-left: 5px;
}

/* Адаптивность */

@media (max-width: 768px) {
    .gallery-page-header h1 {
        font-size: 2rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .gallery-image {
        height: 180px;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .gallery-image {
        height: 250px;
    }
}