/* ============================================
   My Generations View Styles v3.0
   Global layout from layout.css
   ============================================ */

/* ============================================
   Profile Header (Instagram-style)
   ============================================ */

.profile-header {
    margin-bottom: 16px;
    padding-bottom: 0;
    border-bottom: none;
}

/* ============================================
   Public Profile Header
   ============================================ */

.public-profile-header {
    padding: 24px 16px 16px 16px;
    text-align: center;
}

.public-profile-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
}

/* Публичные карточки (с кнопкой Попробовать) */
.generation-card.public-card .generation-preview {
    border-radius: 16px 16px 0 0;
    overflow: hidden;
    cursor: pointer;
}

.generation-card.public-card .generation-preview img {
    width: 100%;
    height: auto;
    display: block;
}

/* Кнопка "Попробовать" для публичных карточек - белая с градиентным свечением */
.generation-card.public-card .action-btn-try {
    width: 100%;
    position: relative;
    background: white;
    border: none;
    border-radius: 16px;
    color: #1a1a1a;
    font-size: 17px;
    font-weight: 700;
    padding: 14px 20px;
    overflow: hidden;
    z-index: 1;
}

/* Градиентное свечение под кнопкой (анимированная подложка) */
.generation-card.public-card .action-btn-try::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(
        45deg,
        #667eea,
        #764ba2,
        #f093fb,
        #4facfe,
        #667eea
    );
    background-size: 300% 300%;
    border-radius: inherit;
    z-index: -1;
    animation: gradientGlow 4s ease infinite;
    filter: blur(8px);
}

@keyframes gradientGlow {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.generation-card.public-card .action-btn-try:active {
    transform: scale(0.98);
}

.generation-card.public-card .action-btn-try svg {
    width: 16px;
    height: 16px;
    stroke: #1a1a1a;
}

.generation-card.public-card .action-btn-try .action-btn-label {
    color: #1a1a1a;
}

/* ============================================
   Profile Share Section (отдельная секция ниже)
   ============================================ */

.profile-share-section {
    display: flex;
    flex-direction: row;
    gap: 10px;
    padding: 12px 16px 16px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* Приглушённые glassmorphism кнопки профиля */
.profile-glass-btn {
    flex: 0 0 auto;
    width: auto;
    min-width: 145px;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.04);  /* ✅ Бледнее: 0.08 → 0.04 */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);  /* ✅ Бледнее: 0.15 → 0.08 */
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.6);  /* ✅ Бледнее: 0.9 → 0.6 */
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.profile-glass-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.profile-glass-btn:active {
    transform: scale(0.98);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.profile-glass-btn svg {
    flex-shrink: 0;
    stroke: rgba(255, 255, 255, 0.6);  /* ✅ Бледнее вместе с текстом */
}

/* ============================================
   Bio Section под аватаркой
   ============================================ */

.profile-bio-section {
    margin-top: 12px;
    padding: 0 16px;
}

.profile-bio {
    font-size: 14px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 1);  /* ✅ Белый текст */
    margin-bottom: 12px;
    font-weight: 500;
}

/* Кнопка ссылки (ЯРКАЯ, акцентная) */
.profile-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: rgba(255, 255, 255, 0.12);
    border: 2px solid rgba(255, 255, 255, 1);  /* ✅ Белая обводка */
    border-radius: 10px;
    color: rgba(255, 255, 255, 1);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    max-width: 280px;  /* ✅ Ограничение ширины */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-link-btn:active {
    transform: scale(0.96);
    background: rgba(255, 255, 255, 0.18);
}

.profile-link-btn svg {
    flex-shrink: 0;
    stroke: rgba(255, 255, 255, 1);
}

.profile-link-btn span {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================
   Profile Tabs (Фильтрация генераций)
   ============================================ */

.profile-tabs {
    display: flex;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    justify-content: center;
    margin-bottom: var(--spacing-md);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 16px;
}

.tab-btn {
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.08);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.65);
    cursor: pointer;
    transition: var(--transition-fast);
    white-space: nowrap;
}

.tab-btn.active {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.35);
    color: #FFFFFF;
}

.tab-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
}

.tab-count {
    opacity: 0.75;
    font-size: 11px;
    margin-left: 4px;
}

.profile-info-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.profile-avatar-container {
    flex-shrink: 0;
    position: relative;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 2;
}

/* Avatar Color Glow Effect v51.8 */
.profile-avatar-container::before {
    content: '';
    position: absolute;
    inset: -12px;
    border-radius: 32px;  /* ✅ Круглее: 26px → 32px */
    z-index: 1;
    opacity: 0;
    filter: blur(16px);
    transition: opacity 0.3s ease;
    pointer-events: none;
    background: var(--avatar-glow-bg, transparent);
    overflow: visible;  /* ✅ Не обрезается */
}

.profile-avatar-container.has-glow::before {
    opacity: 0.35;
}

.profile-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    justify-content: center;
}

.profile-username {
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    line-height: 1.2;
}

.profile-stats {
    display: flex;
    gap: 20px;
    margin-top: 10px;
}

.profile-stat {
    display: flex;
    align-items: center;
    gap: 8px;
}

.profile-stat-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

.profile-stat-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.profile-stat-value {
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1;
}

.profile-stat-label {
    font-size: 12px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1;
}

/* Список генераций - прямо в view, без контейнера */
.generations-list {
    display: flex;
    flex-direction: column;
    gap: 32px;  /* Увеличен отступ между карточками (было 20px) */
    margin-top: 20px;
}

/* Loader использует общий стиль из loader.css */

/* Empty state */
.empty-state {
    text-align: center;
    padding: 80px 20px;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.empty-title {
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 8px;
}

.empty-subtitle {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.5);
}


/* Карточка генерации - без фона, максимум пространства */
.generation-card {
    overflow: visible;
    contain: layout style; /* ✅ Оптимизация: изменения внутри карточки не влияют на остальной список */
}

/* Контейнер: изображение + кнопки на нижней границе */
.card-content {
    position: relative;
    width: 100%;
}

/* Миниатюры входных фото — левая граница карточки */
.input-thumbs-strip {
    position: absolute;
    left: -16px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 5;
    pointer-events: none;
}

.input-thumb {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.85);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    flex-shrink: 0;
    background: #1a1a1a;
}

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

/* Превью изображения - полная ширина, кнопки поверх */
.generation-preview {
    position: relative;
    width: 100%;
    border-radius: 28px; /* Еще более закругленные углы */
    overflow: hidden; /* Обрезаем изображение */
    cursor: pointer;
    background: rgba(255, 255, 255, 0.05);
    min-height: 200px; /* Минимальная высота для предотвращения layout shift */
}

/* ✨ Shine effect - быстрый блеск при появлении изображения */
@keyframes shine {
    0% {
        transform: translateX(-100%) skewX(-15deg);
    }
    100% {
        transform: translateX(200%) skewX(-15deg);
    }
}

.generation-preview.shine-effect::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    animation: shine 0.6s ease-out;
    pointer-events: none;
    z-index: 10;
}

.generation-preview img {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
    border-radius: 24px; /* Сильнее закругление */
}

/* Loading состояние изображения */
.generation-preview.loading-img {
    background: rgba(255, 255, 255, 0.05);
}

.generation-preview.loading-img img {
    opacity: 0;
    transition: opacity 0.3s ease-in;
}

/* Loaded состояние */
.generation-preview:not(.loading-img) img {
    opacity: 1;
}

/* Error состояние */
.generation-preview.error-img {
    background: rgba(255, 0, 0, 0.1);
}

.generation-preview.error-img::after {
    content: '⚠️ Ошибка загрузки';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
}

/* Badge со стилем */
.style-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
}

.style-badge img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Контейнер для бейджей ВВЕРХУ СПРАВА */
.generation-badges {
    position: absolute;
    top: 10px;  /* Вверху */
    right: 10px;  /* Справа */
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 20;
    pointer-events: none;
}

/* Badge модели - едва заметный белый glassmorphism */
.model-badge {
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: none;
    border-radius: 8px;
    font-size: 9px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

/* Model badge для pending/failed - едва заметный */
.generation-preview.pending .model-badge,
.generation-preview.failed .model-badge {
    position: absolute;
    bottom: 8px;
    left: 8px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: none;
    border-radius: 6px;
    font-size: 8px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* Pending: превью + модель в верхнем левом углу */
.pending-top-left {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 10;
}

.pending-preview-thumb {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: cover;
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.pending-model-name {
    font-size: 9px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Мини-иконка профиля (если был использован) */
.profile-badge-mini {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 2px solid rgba(88, 101, 242, 0.4);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

/* ❌ УДАЛЕНО: .generation-time - время не показываем */

/* Кнопки действий - ниже карточки с большим отступом */
.generation-actions {
    position: absolute;
    bottom: -20px;  /* Опущены ниже для лучшей видимости */
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: row;
    gap: 10px;
    z-index: 10;
}

/* Квадратные glassmorphism кнопки (яркие, заметные) */
.action-btn {
    flex: 1 1 0;
    min-width: 76px;
    height: 58px;

    /* Ярче glassmorphism для лучшей видимости */
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    box-shadow:
        0 6px 16px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);

    border-radius: 18px;

    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px 8px;
    gap: 3px;
}

.action-btn img {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    filter: brightness(0) saturate(100%) invert(100%);
    opacity: 0.9;
}

.action-btn-label {
    font-size: 9px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    line-height: 1.1;
    white-space: nowrap;
}

/* Hover эффект */
.action-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.18);
    transform: scale(1.02);
}

/* Active эффект */
.action-btn:active {
    transform: scale(0.98);
    background: rgba(255, 255, 255, 0.15);
}

.action-btn:active img {
    opacity: 1;
}

/* Кнопка опубликовать - МАКСИМАЛЬНЫЙ акцент */
@keyframes shimmer-border {
    0% {
        border-color: rgba(0, 122, 255, 0.5);
        box-shadow: 0 0 12px rgba(0, 122, 255, 0.4);
    }
    50% {
        border-color: rgba(0, 122, 255, 0.8);
        box-shadow: 0 0 24px rgba(0, 122, 255, 0.6);
    }
    100% {
        border-color: rgba(0, 122, 255, 0.5);
        box-shadow: 0 0 12px rgba(0, 122, 255, 0.4);
    }
}

.action-btn-publish {
    background: rgba(0, 122, 255, 0.35);  /* Ярче фон */
    border-color: rgba(0, 122, 255, 0.5);
    border-width: 2px;  /* Толще бордер */
    animation: shimmer-border 2s ease-in-out infinite;
}

.action-btn-publish:hover {
    background: rgba(0, 122, 255, 0.45);
    border-color: rgba(0, 122, 255, 0.7);
    animation: none;
}

/* ⭐ Кнопка "Мод" (админ) */
.action-btn-mod {
    background: rgba(255, 159, 10, 0.2);
    border-color: rgba(255, 159, 10, 0.35);
}

.action-btn-mod:hover {
    background: rgba(255, 159, 10, 0.3);
    border-color: rgba(255, 159, 10, 0.5);
}

.action-btn-mod-active {
    background: rgba(255, 159, 10, 0.4);
    border-color: rgba(255, 159, 10, 0.6);
    color: #ffb340;
}

.action-btn-mod-active:hover {
    background: rgba(255, 159, 10, 0.5);
    border-color: rgba(255, 159, 10, 0.7);
}

/* Mod Icon Picker */
.mod-icon-picker-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.mod-icon-picker {
    background: #1c1c1e;
    border-radius: 20px;
    padding: 20px;
    max-width: 340px;
    width: 100%;
    max-height: 70vh;
    overflow-y: auto;
}

.mod-icon-picker-title {
    font-size: 15px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    margin-bottom: 16px;
}

.mod-icon-picker-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.mod-icon-picker-btn {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    -webkit-tap-highlight-color: transparent;
    padding: 0;
}

.mod-icon-picker-btn:active {
    transform: scale(0.9);
    background: rgba(255, 159, 10, 0.3);
    color: #ffb340;
}

/* Красная кнопка "Не публиковать" */
.action-btn-unpublish {
    background: rgba(255, 59, 48, 0.25);  /* Ярче */
    border-color: rgba(255, 59, 48, 0.4);  /* Ярче */
}

.action-btn-unpublish:hover {
    background: rgba(255, 59, 48, 0.35);  /* Ярче */
    border-color: rgba(255, 59, 48, 0.6);  /* Ярче */
}

/* 🟠 Оранжевая кнопка "На проверке..." (moderation pending) */
.action-btn-moderation {
    background: rgba(255, 149, 0, 0.25);
    border-color: rgba(255, 149, 0, 0.4);
    border-width: 2px;
    cursor: not-allowed;
    opacity: 0.9;
    animation: pulse-orange 2s ease-in-out infinite;
}

.action-btn-moderation:disabled {
    opacity: 0.9;
}

/* Серая кнопка "Опубликовать" (moderation rejected) */
.action-btn-rejected {
    background: rgba(142, 142, 147, 0.25);
    border-color: rgba(142, 142, 147, 0.4);
}

.action-btn-rejected:hover {
    background: rgba(142, 142, 147, 0.35);
    border-color: rgba(142, 142, 147, 0.6);
}

/* Анимация пульсации для кнопки модерации */
@keyframes pulse-orange {
    0%, 100% {
        border-color: rgba(255, 149, 0, 0.4);
        box-shadow: 0 0 0 0 rgba(255, 149, 0, 0.4);
    }
    50% {
        border-color: rgba(255, 149, 0, 0.6);
        box-shadow: 0 0 0 4px rgba(255, 149, 0, 0.1);
    }
}

/* Bottom sheet для подтверждения снятия с публикации */
.unpublish-sheet-content {
    padding: 24px;
    text-align: center;
}

.unpublish-sheet-title {
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 8px;
}

.unpublish-sheet-text {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 24px;
}

.unpublish-sheet-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.unpublish-btn {
    width: 100%;
    height: 52px;
    border: none;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.unpublish-btn-confirm {
    background: rgba(255, 59, 48, 0.15);
    color: #ff3b30;
    border: 1px solid rgba(255, 59, 48, 0.3);
}

.unpublish-btn-confirm:active {
    background: rgba(255, 59, 48, 0.25);
    transform: scale(0.98);
}

.unpublish-btn-cancel {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.unpublish-btn-cancel:active {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(0.98);
}

/* ❌ LEGACY MODAL REMOVED - используется image-viewer.css (Portal Zone) */

/* ✨ Анимированная обводка для pending-карточки */
@property --gradient-angle {
    syntax: "<angle>";
    inherits: false;
    initial-value: 0deg;
}

/* ⚡ Pending карточка с анимированной обводкой через ::before */
.generation-preview.pending {
    position: relative;
    aspect-ratio: 3 / 4;
    min-height: 200px;
    border-radius: 20px;
    overflow: hidden;
}

/* Анимированная обводка как псевдоэлемент - ПОД контентом */
.generation-preview.pending::before {
    content: '';
    position: absolute;
    inset: 0;
    padding: 2px;
    background: conic-gradient(
        from var(--gradient-angle),
        rgba(106, 44, 255, 0.1) 0deg,
        rgba(106, 44, 255, 0.1) 60deg,
        rgba(148, 87, 235, 0.9) 120deg,
        rgba(106, 44, 255, 0.1) 180deg,
        rgba(106, 44, 255, 0.1) 240deg,
        rgba(148, 87, 235, 0.9) 300deg,
        rgba(106, 44, 255, 0.1) 360deg
    );
    border-radius: 20px;
    mask: conic-gradient(#000 0 0) content-box exclude, conic-gradient(#000 0 0);
    -webkit-mask: conic-gradient(#000 0 0) content-box exclude, conic-gradient(#000 0 0);
    animation: borderSpin 1.5s linear infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes borderSpin {
    0% {
        --gradient-angle: 0deg;
    }
    100% {
        --gradient-angle: 360deg;
    }
}

/* Внутренний контейнер с контентом - с отступом для обводки */
.pending-inner {
    position: absolute;
    inset: 2px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #0a0a14 0%, #14101c 100%);
    border-radius: 18px;
    overflow: hidden;
    z-index: 1;
}

/* Размытое градиентное движение внутри карточки */
.pending-inner::before {
    content: '';
    position: absolute;
    width: 150%;
    height: 150%;
    background: radial-gradient(
        circle at 50% 50%,
        rgba(148, 87, 235, 0.3) 0%,
        rgba(106, 44, 255, 0.2) 30%,
        transparent 60%
    );
    filter: blur(40px);
    animation: gradientMove 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes gradientMove {
    0%, 100% {
        transform: translate(-25%, -25%) scale(1);
        opacity: 0.6;
    }
    50% {
        transform: translate(0%, 0%) scale(1.1);
        opacity: 0.8;
    }
}

/* Lottie loader контейнер - поверх градиентного движения */
.lottie-container {
    width: 80px;
    height: 80px;
    position: relative;
    z-index: 2;
}

/* Fallback CSS - легкая пульсация звезд (только opacity) */
.star {
    animation: pulseStar 2s ease-in-out infinite;
}

.star-1 {
    animation-delay: 0s;
}

.star-2 {
    animation-delay: 0.4s;
}

.star-3 {
    animation-delay: 0.8s;
}

@keyframes pulseStar {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
}

/* Текст с шиммером через прозрачность - поверх градиентного движения */
.loading-text-shimmer {
    position: relative;
    padding: 0 10px;
    z-index: 2;
}

.shimmer-text {
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 1);
    animation: shimmerOpacity 1.5s ease-in-out infinite;
}

@keyframes shimmerOpacity {
    0%, 100% {
        opacity: 0.3;
    }
    50% {
        opacity: 1;
    }
}

/* Animation in animations.css */

/* ⚡ SKELETON PREVIEW: Для генераций без preview_url */
.skeleton-preview {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.05) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.05) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.0s infinite;
    aspect-ratio: 3 / 4;
    min-height: 200px;
    border-radius: 12px;
}

/* ⚡ SHINE EFFECT: Для новых completed генераций */
.new-generation-shine {
    position: relative;
    overflow: hidden;
}

.new-generation-shine::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.6) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    animation: shineSlide 2s ease-out;
    pointer-events: none;
    z-index: 10;
}

@keyframes shineSlide {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Failed generation */
.generation-preview.failed {
    background: rgba(255, 59, 48, 0.1);
    border: 1px solid rgba(255, 59, 48, 0.3);
    aspect-ratio: 3 / 4;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.generation-preview.failed .error-icon {
    font-size: 64px;
    margin-bottom: 12px;
    z-index: 1;
}

.generation-preview.failed .error-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    z-index: 1;
}

.generation-preview.failed .error-subtext {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    font-weight: 400;
    text-align: center;
    line-height: 1.4;
    z-index: 1;
}

.generation-preview.failed .support-link {
    display: inline-block;
    margin-top: 12px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 11px;
    font-weight: 500;
    text-decoration: none;
    z-index: 1;
    transition: all 0.2s ease;
}

.generation-preview.failed .support-link:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.15);
}

/* Fullscreen Loader */
#fullscreen-loader {
    display: none;
    position: fixed;
    inset: 0;
    background: #0a0a0a;
    z-index: 9999;
    overflow: hidden;
}

#fullscreen-loader.active {
    display: block;
}

.animation-container {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 1000px;
}

.photo-stack {
    position: relative;
    width: 200px;
    height: 200px;
}

.flying-photo {
    position: absolute;
    width: 160px;
    height: 160px;
    border-radius: 24px;
    object-fit: cover;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    opacity: 0;
}

@keyframes flyIn {
    0% {
        opacity: 0;
        transform: translate(var(--start-x), var(--start-y)) rotate(var(--start-rotate)) scale(0.5);
    }
    40% {
        opacity: 1;
        transform: translate(0, 0) rotate(var(--mid-rotate)) scale(1);
    }
    70% {
        opacity: 1;
        transform: translate(0, 0) rotate(0deg) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(0, -100px) scale(2) translateZ(400px);
        filter: blur(10px);
    }
}

.flying-photo.animate {
    animation: flyIn 2.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

.success-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    opacity: 0;
    animation: fadeInMessage 0.5s ease 2.2s forwards;
}

@keyframes fadeInMessage {
    to {
        opacity: 1;
    }
}

.success-icon {
    font-size: 64px;
    margin-bottom: 16px;
    animation: bounce 0.6s ease 2.2s;
}

@keyframes bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.success-text {
    font-size: 24px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 8px;
}

.success-subtext {
    font-size: 16px;
    color: #999;
}

/* ============================================
   STALE GENERATION WARNING (Зависшие генерации)
   ============================================ */

/* Затемнение фона для зависших генераций */
.generation-preview.pending.stale {
    position: relative;
    opacity: 0.7;
}

.generation-preview.pending.stale::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 152, 0, 0.1);
    border-radius: inherit;
    pointer-events: none;
    z-index: 0;
}

/* Предупреждение о зависшей генерации */
.stale-warning {
    position: absolute;
    bottom: 12px;
    left: 12px;
    right: 12px;
    background: rgba(255, 152, 0, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 152, 0, 0.4);
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 10;
    animation: pulseWarning 2s ease-in-out infinite;
}

@keyframes pulseWarning {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.85;
        transform: scale(0.98);
    }
}

.stale-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.stale-text {
    font-size: 12px;
    font-weight: 600;
    color: #ff9800;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Кнопка обновления статуса */
.stale-refresh-btn {
    background: rgba(255, 152, 0, 0.3);
    border: 1px solid rgba(255, 152, 0, 0.5);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 14px;
    color: #ff9800;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.stale-refresh-btn:hover {
    background: rgba(255, 152, 0, 0.5);
    transform: scale(1.1) rotate(180deg);
}

.stale-refresh-btn:active {
    transform: scale(0.95) rotate(180deg);
}

/* GPU Acceleration */
.stale-warning,
.stale-refresh-btn {
    will-change: transform, opacity;
    backface-visibility: hidden;
}

/* ============================================
   Bottom Sheet для шаринга профиля
   ============================================ */

.bottom-sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: flex-end;
    transition: opacity 0.3s ease;
}

.bottom-sheet-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.bottom-sheet {
    width: 100%;
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px 24px 0 0;
    padding: 20px;
    transform: translateY(0);
    transition: transform 0.3s ease;
}

.bottom-sheet-overlay.hidden .bottom-sheet {
    transform: translateY(100%);
}

.bottom-sheet-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.bottom-sheet-handle {
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    margin-bottom: 16px;
}

.bottom-sheet-header h3 {
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.bottom-sheet-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.share-copy-btn {
    width: 100%;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.share-copy-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.share-copy-btn:active {
    transform: scale(0.98);
}

.share-copy-btn svg {
    flex-shrink: 0;
    stroke: #ffffff;
}
