/* ============================================
   References.html Specific Styles
   ============================================ */

/* Header on pages - NO BACKGROUND */
.header {
    padding: 0;
    margin-bottom: 16px;
    background: none !important;
}

/* Заголовок "Попробуй готовые шоты" - без градиента */
.gradient-title {
    color: var(--color-text-primary);
    font-size: 28px;
    font-weight: 700;
    margin: 0;
    text-align: center;
    line-height: 1.2;
}

        .gallery {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 14px 10px;
            width: 100%;
            padding: 50px 0 80px 0;
            box-sizing: border-box;
        }

        /* Desktop: больше gap */
        @media (min-width: 641px) {
            .gallery {
                gap: 20px 16px;
                padding: 60px 0 100px 0;
            }
        }

        .reference-card {
            position: relative;
            border-radius: 24px;
            overflow: hidden;
            cursor: pointer;
            transition: transform 0.2s ease;
            background: var(--color-surface);
            aspect-ratio: 3/4;
            will-change: transform;
            contain: layout style paint;
        }

        /* Style card container needs relative positioning для NEW badge */
        .style-card-container {
            position: relative;
        }

        /* NEW badge ПОВЕРХ карточки (не внутри) */
        .style-card-container .new-badge {
            position: absolute;
            top: -6px;
            right: 8px;
            z-index: 10;

            display: inline-flex;
            align-items: center;
            gap: 3px;

            background: #EFFD53;
            color: #000000;

            font-size: 9px;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: 0.5px;

            padding: 3px 6px;
            border-radius: 6px;

            box-shadow: 0 2px 8px rgba(239, 253, 83, 0.6);

            /* Shake анимация при появлении */
            animation: newBadgeShake 0.6s ease-out 0.3s 1;
            pointer-events: none;
        }

        .new-badge-icon {
            width: 8px;
            height: 8px;
            filter: brightness(0);
            flex-shrink: 0;
        }

        .new-badge-text {
            position: relative;
            overflow: hidden;
        }

        /* Шиммер на буквах раз в 3 секунды */
        .new-badge-text::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(
                90deg,
                transparent 0%,
                rgba(255, 255, 255, 0.8) 50%,
                transparent 100%
            );
            animation: newBadgeTextShimmer 3s ease-in-out infinite;
        }

        @keyframes newBadgeTextShimmer {
            0% {
                left: -100%;
            }
            12% {
                left: 100%;
            }
            100% {
                left: 100%;
            }
        }

        @keyframes newBadgeShake {
            0%, 100% {
                transform: translateX(0);
            }
            10%, 30%, 50%, 70% {
                transform: translateX(-4px);
            }
            20%, 40%, 60% {
                transform: translateX(4px);
            }
            80% {
                transform: translateX(-2px);
            }
            90% {
                transform: translateX(2px);
            }
        }

        .reference-card.selected {
            position: relative;
            border-radius: 24px;
            transform: scale(1.02);
            box-shadow: 0 0 30px rgba(106, 44, 255, 0.7),
                        0 0 60px rgba(181, 101, 216, 0.4);
            filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
        }

        .reference-card.selected::before {
            content: '';
            position: absolute;
            inset: 0;
            border-radius: 24px;
            padding: 3px;
            background: linear-gradient(135deg, #6A2CFF, #B565D8, #00C8FF);
            -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
            -webkit-mask-composite: xor;
            mask-composite: exclude;
            pointer-events: none;
            z-index: 1;
        }

        .tools-section {
            margin-bottom: 24px;
            padding: 28px 0;
            display: flex;
            gap: 12px;
            justify-content: center;
            overflow: visible;
        }

        .divider-section {
            margin-top: 24px;
            margin-bottom: 24px;
            text-align: center;
        }

        .divider-text {
            font-size: 14px;
            font-weight: 500;
            color: rgba(255, 255, 255, 0.4);
            text-transform: uppercase;
        }


        .reference-card:active {
            transform: scale(0.98);
        }

        .reference-card img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
            border-radius: 24px;
        }

        .overlay {
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            padding: 40px 12px 10px 12px;
            z-index: 2;
            -webkit-mask-image: linear-gradient(to top, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0.95) 30%, rgba(0, 0, 0, 0.7) 60%, rgba(0, 0, 0, 0) 100%);
            mask-image: linear-gradient(to top, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0.95) 30%, rgba(0, 0, 0, 0.7) 60%, rgba(0, 0, 0, 0) 100%);
        }

        .name {
            font-size: 14px;
            font-weight: 400;
            color: #FFFFFF;
            text-shadow: 0 2px 8px rgba(0,0,0,0.9), 0 1px 3px rgba(0,0,0,0.8);
        }

        /* Wrapper для карточки + creator badge */
        .style-card-container {
            display: flex;
            flex-direction: column;
            max-width: 300px; /* 300px × 2 (retina) = 600px миниатюры */
        }

        /* Специфичные стили для references.html */
        .gallery .creator-badge {
            margin-top: 6px;
            padding: 0 2px;
        }

        .profile-info {
            font-size: 11px;
            font-weight: 400;
            color: #B0B0B0;
            margin-top: 2px;
            text-shadow: 0 1px 5px rgba(0,0,0,0.9), 0 1px 2px rgba(0,0,0,0.7);
        }

        .reference-card.selected::after {
            content: '✓';
            position: absolute;
            top: 12px;
            right: 12px;
            width: 40px;
            height: 40px;
            background: linear-gradient(135deg, #6A2CFF 0%, #B565D8 50%, #00C8FF 100%);
            color: #FFFFFF;
            border-radius: 16px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 24px;
            font-weight: bold;
            box-shadow: 0 4px 20px rgba(181, 101, 216, 0.7), 0 2px 10px rgba(106, 44, 255, 0.5);
            border: 2px solid rgba(255, 255, 255, 0.4);
            z-index: 3;
        }

        /* Кнопка "Загрузить новые фото" */
        .upload-new-card {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 12px;
            background: linear-gradient(135deg, #6A2CFF 0%, #B565D8 50%, #00C8FF 100%);
            cursor: pointer;
            transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            padding: 20px;
            position: relative;
        }

        .upload-new-card::before {
            content: '';
            position: absolute;
            inset: 8px;
            background: rgba(0, 0, 0, 0.25);
            border-radius: 24px;
        }

        .upload-new-card:active {
            transform: scale(0.98);
        }

        .upload-new-card .icon {
            font-size: 48px;
            position: relative;
            z-index: 1;
            filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .upload-new-card .icon svg {
            width: 48px;
            height: 48px;
            display: block;
        }

        .upload-new-card .text {
            font-size: 15px;
            font-weight: 700;
            text-align: center;
            color: #FFFFFF;
            position: relative;
            z-index: 1;
            text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
            line-height: 1.3;
        }


        /* Skeleton loader - пунктирный бордер с бликом */
        .reference-card.loading-img img {
            opacity: 0;
        }

        .reference-card.loading-img {
            background: transparent;
            border: 2px dashed #3a3a3a;
            box-sizing: border-box;
            position: relative;
            overflow: hidden;
        }

        /* Белый блик волной поверх пунктирного бордера */
        .reference-card.loading-img::before {
            content: '';
            position: absolute;
            inset: -2px; /* Покрывает включая border */
            background: linear-gradient(
                90deg,
                transparent 0%,
                rgba(255, 255, 255, 0.15) 45%,
                rgba(255, 255, 255, 0.25) 50%,
                rgba(255, 255, 255, 0.15) 55%,
                transparent 100%
            );
            background-size: 200% 100%;
            animation: dashedShimmer 1.2s ease-in-out infinite;
            pointer-events: none;
        }

        /* Animation in animations.css */

        /* Staggered animation - только при первой загрузке */
        body:not(.gallery-loaded) .style-card-container {
            opacity: 0;
            animation: fadeInUp 0.4s ease forwards;
        }

        /* При повторном показе (после modal) - сразу видимы */
        body.gallery-loaded .style-card-container {
            opacity: 1;
        }

        body:not(.gallery-loaded) .style-card-container:nth-child(1) { animation-delay: 0.05s; }
        body:not(.gallery-loaded) .style-card-container:nth-child(2) { animation-delay: 0.1s; }
        body:not(.gallery-loaded) .style-card-container:nth-child(3) { animation-delay: 0.15s; }
        body:not(.gallery-loaded) .style-card-container:nth-child(4) { animation-delay: 0.2s; }
        body:not(.gallery-loaded) .style-card-container:nth-child(5) { animation-delay: 0.25s; }
        body:not(.gallery-loaded) .style-card-container:nth-child(6) { animation-delay: 0.3s; }
        body:not(.gallery-loaded) .style-card-container:nth-child(7) { animation-delay: 0.35s; }
        body:not(.gallery-loaded) .style-card-container:nth-child(8) { animation-delay: 0.4s; }
        body:not(.gallery-loaded) .style-card-container:nth-child(n+9) { animation-delay: 0.45s; }


        /* Photo upload loader */
        .photo-loader {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.7);
            display: flex;
            align-items: center;
            justify-content: center;
            backdrop-filter: blur(4px);
            z-index: 10;
        }

        /* Spinner использует стили из loader.css */

        .photo-loaded {
            animation: photoFadeIn 0.3s ease forwards;
        }

        @keyframes photoFadeIn {
            from {
                opacity: 0;
                transform: scale(0.9);
            }
            to {
                opacity: 1;
                transform: scale(1);
            }
        }

        /* ✅ Удалено - используется глобальный .btn-action-primary и .buttons-container из common.css */


/* Profiles Slider styles in components.css */


/* ============================================
   Upload Progress Overlay (v24.334 - Centered White)
   ============================================ */

/* Overlay поверх shimmer карточки - СТРОГО ПО ЦЕНТРУ */
.upload-progress-overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
    z-index: 100;
}

/* Контейнер для loader - относительное позиционирование для процентов */
.upload-progress-overlay .circular-loader-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
}

/* Круговой прогресс SVG */
.upload-progress-overlay .circular-progress {
    display: block;
    width: 60px;
    height: 60px;
    filter: drop-shadow(0 4px 16px rgba(255, 255, 255, 0.25));
}

/* Плавная анимация заполнения круга */
.upload-progress-overlay .progress-circle-fill {
    transition: stroke-dashoffset 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Проценты СТРОГО внутри круга */
.upload-progress-overlay .progress-percent-overlay {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    color: #ffffff !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    z-index: 101 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
}

/* Кнопка "Создай стиль" */
/* Кнопка "Создай стиль" - УЛУЧШЕННАЯ */
.custom-prompt-btn {
    --round: 1.5rem;  /* ✅ Сильнее закруглено */
    cursor: pointer;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: all 0.25s ease;
    border-radius: var(--round);
    border: none;
    outline: none;
    padding: 18px 24px;  /* ✅ Выше (было 12px 18px) */
    width: 100%;
    max-width: 260px;
    margin: 0 auto;

    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;

    /* Фон */
    background:
        radial-gradient(65.28% 65.28% at 50% 100%,
            rgba(223, 113, 255, 0.8) 0%,
            rgba(223, 113, 255, 0) 100%),
        linear-gradient(0deg, #7a5af8, #7a5af8);

    /* ✅ Очень широкая мягкая тень (кнопка парит далеко от фона) */
    animation: smooth-shadow-flow 8s ease-in-out infinite;
}

@keyframes smooth-shadow-flow {
    0% {
        box-shadow:
            0 0 80px rgba(122, 90, 248, 0.18),
            0 0 120px rgba(223, 113, 255, 0.15),
            0 0 150px rgba(122, 90, 248, 0.12),
            -10px -10px 120px rgba(122, 90, 248, 0.15),
            10px 10px 120px rgba(223, 113, 255, 0.15);
    }
    16% {
        box-shadow:
            0 0 80px rgba(223, 113, 255, 0.18),
            0 0 120px rgba(122, 90, 248, 0.15),
            0 0 150px rgba(223, 113, 255, 0.12),
            8px -12px 120px rgba(223, 113, 255, 0.16),
            -8px 10px 120px rgba(122, 90, 248, 0.15);
    }
    33% {
        box-shadow:
            0 0 80px rgba(122, 90, 248, 0.18),
            0 0 120px rgba(223, 113, 255, 0.15),
            0 0 150px rgba(122, 90, 248, 0.12),
            12px 8px 120px rgba(122, 90, 248, 0.16),
            -10px -8px 120px rgba(223, 113, 255, 0.15);
    }
    50% {
        box-shadow:
            0 0 80px rgba(223, 113, 255, 0.18),
            0 0 120px rgba(122, 90, 248, 0.15),
            0 0 150px rgba(223, 113, 255, 0.12),
            -12px 10px 120px rgba(223, 113, 255, 0.16),
            10px -10px 120px rgba(122, 90, 248, 0.15);
    }
    66% {
        box-shadow:
            0 0 80px rgba(122, 90, 248, 0.18),
            0 0 120px rgba(223, 113, 255, 0.15),
            0 0 150px rgba(122, 90, 248, 0.12),
            -8px -12px 120px rgba(122, 90, 248, 0.16),
            8px 12px 120px rgba(223, 113, 255, 0.15);
    }
    83% {
        box-shadow:
            0 0 80px rgba(223, 113, 255, 0.18),
            0 0 120px rgba(122, 90, 248, 0.15),
            0 0 150px rgba(223, 113, 255, 0.12),
            10px -8px 120px rgba(223, 113, 255, 0.16),
            -12px 8px 120px rgba(122, 90, 248, 0.15);
    }
    100% {
        box-shadow:
            0 0 80px rgba(122, 90, 248, 0.18),
            0 0 120px rgba(223, 113, 255, 0.15),
            0 0 150px rgba(122, 90, 248, 0.12),
            -10px -10px 120px rgba(122, 90, 248, 0.15),
            10px 10px 120px rgba(223, 113, 255, 0.15);
    }
}

.custom-prompt-btn::before {
    content: "";
    position: absolute;
    inset: 0;
    transition: all 0.5s ease-in-out;
    border-radius: calc(var(--round) - 1px);
    z-index: 0;
    background: linear-gradient(177.95deg,
        rgba(255, 255, 255, 0.19) 0%,
        rgba(255, 255, 255, 0) 100%);
}

.custom-prompt-btn::after {
    content: "";
    position: absolute;
    inset: 2px;
    transition: all 0.5s ease-in-out;
    border-radius: calc(var(--round) - 2px);
    z-index: -1;
    background:
        radial-gradient(65.28% 65.28% at 50% 100%,
            rgba(223, 113, 255, 0.8) 0%,
            rgba(223, 113, 255, 0) 100%),
        linear-gradient(0deg, #7a5af8, #7a5af8);
}

.custom-prompt-btn:active {
    transform: scale(0.95);
}


.custom-prompt-btn .points_wrapper {
    overflow: hidden;
    width: 100%;
    height: 100%;
    pointer-events: none;
    position: absolute;
    z-index: 1;
}

.custom-prompt-btn .points_wrapper .point {
    bottom: -10px;
    position: absolute;
    animation: floating-points infinite ease-in-out;
    pointer-events: none;
    width: 2px;
    height: 2px;
    background-color: #fff;
    border-radius: 9999px;
}

@keyframes floating-points {
    0% {
        transform: translateY(0);
    }
    85% {
        opacity: 0;
    }
    100% {
        transform: translateY(-55px);
        opacity: 0;
    }
}

.custom-prompt-btn .points_wrapper .point:nth-child(1) {
    left: 10%;
    opacity: 1;
    animation-duration: 2.35s;
    animation-delay: 0.2s;
}

.custom-prompt-btn .points_wrapper .point:nth-child(2) {
    left: 30%;
    opacity: 0.7;
    animation-duration: 2.5s;
    animation-delay: 0.5s;
}

.custom-prompt-btn .points_wrapper .point:nth-child(3) {
    left: 25%;
    opacity: 0.8;
    animation-duration: 2.2s;
    animation-delay: 0.1s;
}

.custom-prompt-btn .points_wrapper .point:nth-child(4) {
    left: 44%;
    opacity: 0.6;
    animation-duration: 2.05s;
}

.custom-prompt-btn .points_wrapper .point:nth-child(5) {
    left: 50%;
    opacity: 1;
    animation-duration: 1.9s;
}

.custom-prompt-btn .points_wrapper .point:nth-child(6) {
    left: 75%;
    opacity: 0.5;
    animation-duration: 1.5s;
    animation-delay: 1.5s;
}

.custom-prompt-btn .points_wrapper .point:nth-child(7) {
    left: 88%;
    opacity: 0.9;
    animation-duration: 2.2s;
    animation-delay: 0.2s;
}

.custom-prompt-btn .points_wrapper .point:nth-child(8) {
    left: 58%;
    opacity: 0.8;
    animation-duration: 2.25s;
    animation-delay: 0.2s;
}

.custom-prompt-btn .points_wrapper .point:nth-child(9) {
    left: 98%;
    opacity: 0.6;
    animation-duration: 2.6s;
    animation-delay: 0.1s;
}

.custom-prompt-btn .points_wrapper .point:nth-child(10) {
    left: 65%;
    opacity: 1;
    animation-duration: 2.5s;
    animation-delay: 0.2s;
}

.custom-prompt-btn .points_wrapper .point:nth-child(11) {
    left: 15%;
    opacity: 0.7;
    animation-duration: 2.1s;
    animation-delay: 0.8s;
}

.custom-prompt-btn .points_wrapper .point:nth-child(12) {
    left: 35%;
    opacity: 0.9;
    animation-duration: 2.3s;
    animation-delay: 0.3s;
}

.custom-prompt-btn .points_wrapper .point:nth-child(13) {
    left: 55%;
    opacity: 0.6;
    animation-duration: 1.8s;
    animation-delay: 1.2s;
}

.custom-prompt-btn .points_wrapper .point:nth-child(14) {
    left: 70%;
    opacity: 0.8;
    animation-duration: 2.4s;
    animation-delay: 0.4s;
}

.custom-prompt-btn .points_wrapper .point:nth-child(15) {
    left: 82%;
    opacity: 0.7;
    animation-duration: 2.0s;
    animation-delay: 0.6s;
}

.custom-prompt-btn .points_wrapper .point:nth-child(16) {
    left: 48%;
    opacity: 1;
    animation-duration: 2.2s;
    animation-delay: 0.1s;
}

.custom-prompt-btn .points_wrapper .point:nth-child(17) {
    left: 92%;
    opacity: 0.5;
    animation-duration: 1.9s;
    animation-delay: 1.0s;
}

.custom-prompt-btn .points_wrapper .point:nth-child(18) {
    left: 38%;
    opacity: 0.8;
    animation-duration: 2.6s;
    animation-delay: 0.2s;
}

.custom-prompt-btn .points_wrapper .point:nth-child(19) {
    left: 62%;
    opacity: 0.9;
    animation-duration: 2.1s;
    animation-delay: 0.7s;
}

.custom-prompt-btn .points_wrapper .point:nth-child(20) {
    left: 78%;
    opacity: 0.6;
    animation-duration: 2.3s;
    animation-delay: 0.5s;
}

.custom-prompt-btn .inner {
    z-index: 1;
    gap: 6px;
    position: relative;
    width: 100%;
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.5;
    transition: color 0.2s ease-in-out;

    /* ✅ Белое свечение текста */
    text-shadow:
        0 0 8px rgba(255, 255, 255, 0.6),
        0 0 12px rgba(255, 255, 255, 0.4);
}

.custom-prompt-btn .inner svg.icon {
    width: 18px;
    height: 18px;
    transition: fill 0.1s linear;
    filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.5));
}

