/* Галерея фотографий - Современный дизайн */

.gallery-section {
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    padding: 80px 20px 40px;
}

.gallery-container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Заголовок */
.gallery-header {
    text-align: left;
    margin-bottom: 50px;
}

.gallery-title {
    color: #fff;
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #ff5e00 0%, #ff8c42 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gallery-subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.2rem;
}

/* Контролы (фильтры и поиск) */
.gallery-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.filters-form {
    display: flex;
    gap: 15px;
    flex: 1;
    flex-wrap: wrap;
}

/* Поиск */
.search-box {
    display: flex;
    gap: 10px;
    flex: 1;
    min-width: 250px;
}

.search-input {
    flex: 1;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0;
    color: #fff;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #ff5e00;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 3px rgba(255, 94, 0, 0.1);
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.search-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #ff5e00 0%, #ff8c42 100%);
    border: none;
    border-radius: 0;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255, 94, 0, 0.4);
}

/* Фильтр */
.filter-box {
    min-width: 300px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-label {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    font-weight: 500;
    white-space: nowrap;
}

.filter-select {
    flex: 1;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-select:focus {
    outline: none;
    border-color: #ff5e00;
    background: rgba(255, 255, 255, 0.15);
}

.filter-select option {
    background: #2d2d2d;
    color: #fff;
}

.reset-filters-btn {
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0;
    color: #fff;
    text-decoration: none;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.reset-filters-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: #ff5e00;
}

/* Статистика */
.gallery-stats {
    display: flex;
    gap: 20px;
    align-items: center;
}

.stat-item {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
    white-space: nowrap;
}

.stat-link {
    text-decoration: none;
    transition: color 0.3s ease;
}

.stat-link:hover {
    color: #ff5e00;
}

/* ── Заголовок альбома ── */
.album-block { margin-bottom: 2.5rem; }
.album-block h3 {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .8125rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: rgba(255,255,255,.45);
    margin: 0 0 .75rem 0;
    padding-bottom: .5rem;
    border-bottom: 1px solid rgba(255,255,255,.07);
}
.album-block h3 .icon { opacity: .6; }

/* ══════════════════════════════════════════════
   MASONRY GRID — CSS Grid + JS span calculation
   (Pinterest / Unsplash technique)
   ══════════════════════════════════════════════ */

.photos-grid,
.album-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    /* Маленький row-unit: JS рассчитает span для каждой карточки */
    grid-auto-rows: 4px;
    gap: 0 4px;
}

@media (max-width: 900px) {
    .photos-grid,
    .album-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .photos-grid,
    .album-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0 3px;
    }
}

/* Карточка — align-self: start обязателен для masonry */
.photo-card {
    align-self: start;    /* не растягивать на всю ячейку! */
    position: relative;
    overflow: hidden;
    background: #0d0d0d;
    cursor: pointer;
    outline-offset: -2px;
    /* нижний margin = gap между рядами */
    margin-bottom: 4px;
}

@media (max-width: 480px) {
    .photo-card { margin-bottom: 3px; }
}

.photo-card.selected {
    outline: 2px solid var(--neon);
}

/* Обёртка — пусть фото задаёт высоту (никаких padding-top: %) */
.photo-image-wrapper {
    position: relative;
    overflow: hidden;
    background: #0d0d0d;
    line-height: 0;      /* убирает gap под img */
    cursor: pointer;
    display: block;
}

/* Само изображение — ширина 100%, высота натуральная */
.photo-image {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    /* Сброс старых position: absolute и object-fit: cover */
    position: static;
    object-fit: unset;
    transition: transform .5s cubic-bezier(.25,.46,.45,.94);
    will-change: transform;
}

.photo-card:hover .photo-image {
    transform: scale(1.04);
}

/* Оверлей с кнопками — появляется при наведении */
.photo-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0,0,0,0) 40%,
        rgba(0,0,0,.72) 100%
    );
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: .6rem;
    opacity: 0;
    transition: opacity .25s;
    z-index: 3;
}
.photo-card:hover .photo-overlay { opacity: 1; }

.photo-actions {
    display: flex;
    gap: 6px;
}

/* Кнопки — компактные, круглые */
.action-btn {
    width: 34px;
    height: 34px;
    padding: 0;
    background: rgba(0,0,0,.65);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    transition: background .2s, transform .2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.action-btn:hover {
    background: rgba(255,94,0,.85);
    border-color: transparent;
    transform: scale(1.1);
}
.action-btn .icon { pointer-events: none; }

.favorite-btn.active {
    background: rgba(255,94,0,.7);
    border-color: rgba(255,94,0,.8);
}
.favorite-btn.active .heart-icon { animation: heartBeat .3s ease; }

@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

.download-btn:hover {
    background: rgba(34,197,94,.85);
}

/* Бейдж "Куплено" — маленький pill сверху справа */
.purchased-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    width: auto;
    max-width: max-content;
    padding: 3px 8px;
    background: rgba(34, 197, 94, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(8px);
    border-radius: 999px;
    color: #fff;
    font-weight: 700;
    font-size: 0.62rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1;
    z-index: 5;
    pointer-events: none;
}

/* photo-info — скрываем (текст под карточкой не нужен) */
.photo-info { display: none; }

/* Оставляем event-badge на случай отображения снаружи */
.event-badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: 4px 10px;
    background: rgba(255, 94, 0, 0.18);
    border: 1px solid rgba(255, 94, 0, 0.28);
    color: #ff8c42;
    font-size: 0.78rem;
    font-weight: 500;
}

/* Пустое состояние */
.empty-state {
    text-align: center;
    padding: 80px 20px;
}

.empty-icon {
    font-size: 5rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-title {
    color: #fff;
    font-size: 2rem;
    margin-bottom: 15px;
}

.empty-text {
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.1rem;
    line-height: 1.6;
    max-width: 500px;
    margin: 0 auto 30px;
}

.empty-btn {
    display: inline-block;
    padding: 12px 30px;
    background: linear-gradient(135deg, #ff5e00 0%, #ff8c42 100%);
    border-radius: 0;
    color: white;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.empty-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255, 94, 0, 0.4);
}

/* Уведомления */
.notification {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 15px 25px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    color: #1a1a1a;
    font-weight: 500;
    z-index: 1000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
}

.notification.show {
    transform: translateX(0);
}

.notification-success {
    border-left: 4px solid #22c55e;
}

.notification-error {
    border-left: 4px solid #ef4444;
}

.notification-info {
    border-left: 4px solid #3b82f6;
}

/* Адаптивность */
@media (max-width: 1200px) {
    .photos-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .gallery-title {
        font-size: 2rem;
    }

    .gallery-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .filters-form {
        flex-direction: column;
    }

    .search-box {
        min-width: 100%;
    }

    .filter-box {
        min-width: 100%;
    }

    .gallery-stats {
        justify-content: center;
    }

    .photos-grid {
        grid-template-columns: 1fr;
    }

    .watermark {
        font-size: 2rem;
    }

    .photo-actions {
        flex-direction: column;
        width: 80%;
    }

    .action-btn {
        width: 100%;
        justify-content: center;
    }

    .notification {
        right: 20px;
        left: 20px;
        bottom: 20px;
    }
}

/* ============================================
   ПРЕВЬЮ ГАЛЕРЕИ ДЛЯ НЕЗАРЕГИСТРИРОВАННЫХ
   ============================================ */

.preview-gallery-wrapper {
    position: relative;
    margin-bottom: 60px;
}

/* Сетка превью с размытием */
.photos-grid-preview {
    position: relative;
    pointer-events: none;
    user-select: none;
}

.photo-card-preview {
    cursor: default;
}

.photo-image-blurred {
    filter: blur(8px);
    transform: scale(1.1);
}

.preview-lock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.lock-icon {
    font-size: 3rem;
    opacity: 0.8;
    animation: lockPulse 2s ease-in-out infinite;
}

@keyframes lockPulse {
    0%, 100% { 
        transform: scale(1);
        opacity: 0.8;
    }
    50% { 
        transform: scale(1.1);
        opacity: 1;
    }
}

/* Призыв к регистрации */
.register-cta {
    margin-top: 60px;
    padding: 60px 40px;
    background: linear-gradient(
        135deg,
        rgba(255, 94, 0, 0.1) 0%,
        rgba(255, 140, 66, 0.05) 100%
    );
    border: 2px solid rgba(255, 94, 0, 0.3);
    border-radius: 0;
    text-align: center;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.register-cta::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 94, 0, 0.1) 50%,
        transparent 70%
    );
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.cta-content {
    position: relative;
    z-index: 1;
}

.cta-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.cta-title {
    font-size: 2.5rem;
    font-weight: 900;
    color: #fff;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 20px rgba(255, 94, 0, 0.5);
}

.cta-text {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 40px;
    line-height: 1.6;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.cta-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.cta-btn {
    padding: 18px 40px;
    font-size: 1.2rem;
    font-weight: 700;
    border-radius: 0;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.cta-btn-primary {
    background: linear-gradient(135deg, #ff5e00 0%, #ff8c42 100%);
    color: white;
    border: none;
}

.cta-btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(255, 94, 0, 0.5);
    color: white;
}

.cta-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.cta-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-3px);
    color: white;
}

.cta-features {
    display: flex;
    gap: 30px;
    justify-content: center;
    flex-wrap: wrap;
}

.feature-item {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    padding: 10px 20px;
    background: rgba(255, 94, 0, 0.2);
    border-radius: 0;
    border: 1px solid rgba(255, 94, 0, 0.3);
}

/* Адаптивность для превью */
@media (max-width: 768px) {
    .register-cta {
        padding: 40px 20px;
        margin-top: 40px;
    }

    .cta-icon {
        font-size: 3rem;
    }

    .cta-title {
        font-size: 1.8rem;
    }

    .cta-text {
        font-size: 1.1rem;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .cta-btn {
        width: 100%;
        justify-content: center;
    }

    .cta-features {
        flex-direction: column;
        gap: 15px;
    }

    .photo-image-blurred {
        filter: blur(6px);
    }
}

/* ===============================================
   КАРУСЕЛЬ В СТИЛЕ ТИЛЬДЫ для незарегистрированных
   =============================================== */

.tilda-gallery-preview {
    position: relative;
    width: 100%;
    height: 80vh;
    min-height: 600px;
    overflow: hidden;
    border-radius: 0;
}

/* Карусель как фон */
.carousel-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.carousel-track {
    display: flex;
    width: fit-content;
    animation: scroll 40s linear infinite;
}

.carousel-slide {
    flex-shrink: 0;
    width: 500px;
    height: 80vh;
    min-height: 600px;
    padding: 0 10px;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(80%) brightness(0.6);
    transition: filter 0.5s ease;
}

.carousel-slide:hover img {
    filter: grayscale(0%) brightness(1);
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* Оверлей с текстом */
.tilda-cta-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg, 
        rgba(0, 0, 0, 0.8) 0%, 
        rgba(255, 94, 0, 0.3) 100%
    );
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.tilda-cta-content {
    text-align: center;
    max-width: 800px;
    padding: 40px;
    animation: fadeInUp 1s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Огромный заголовок в стиле Тильды */
.tilda-big-title {
    font-size: clamp(2rem, 6vw, 4rem);
    font-weight: 900;
    color: #fff;
    margin: 0 0 30px 0;
    line-height: 1;
    letter-spacing: -1px;
    text-transform: uppercase;
    background: linear-gradient(135deg, #ff5e00 0%, #fff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
}

.tilda-subtitle {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    color: rgba(255, 255, 255, 0.9);
    margin: 0 0 50px 0;
    font-weight: 300;
    letter-spacing: 0.5px;
}

/* Кнопки в стиле Тильды */
.tilda-cta-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.tilda-btn {
    padding: 20px 50px;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 0;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-block;
}

.tilda-btn-primary {
    background: linear-gradient(135deg, #ff5e00 0%, #ff8c42 100%);
    color: #fff;
    box-shadow: 0 10px 30px rgba(255, 94, 0, 0.4);
}

.tilda-btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(255, 94, 0, 0.6);
}

.tilda-btn-ghost {
    background: transparent;
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.tilda-btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-3px);
}

/* Адаптивность */
@media (max-width: 768px) {
    .tilda-gallery-preview {
        height: 70vh;
        min-height: 500px;
    }
    
    .carousel-slide {
        width: 300px;
        height: 70vh;
        min-height: 500px;
    }
    
    .tilda-big-title {
        font-size: 3rem;
    }
    
    .tilda-subtitle {
        font-size: 1.2rem;
    }
    
    .tilda-cta-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .tilda-btn {
        padding: 18px 40px;
        font-size: 1rem;
    }
}


