/* =================================================================== */
/* --- empty_state.css УНИВЕРСАЛЬНЫЕ ПУСТЫЕ ЭКРАНЫ (CYBERPUNK EMPTY STATES)        --- */
/* =================================================================== */

/* 1. Настройка родительских контейнеров */
/* Обязательно даем им relative, чтобы отсчет 50% для пустых экранов шел от их границ */
.generation-space,
#music-view,
#video-history-view {
    position: relative !important;
}

/* Принудительно делаем окна Видео и Музыки гибкими (Flexbox) */
#video-history-view, 
#music-view {
    display: flex !important;
    flex-direction: column;
}

/* Защита от конфликта Flexbox и JS (прячем, если JS задал display: none) */
#video-history-view[style*="display: none"], 
#music-view[style*="display: none"] {
    display: none !important;
}

/* 2. Главный контейнер пустого экрана */
.cyber-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    
    /* Жестко центрируем окно по центру родителя */
    position: absolute !important;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    
    padding: 20px;
    z-index: 10;
}

/* 3. Контейнер неоновой иконки */
.cyber-empty-icon-wrap {
    margin: 0 auto 24px auto; /* Жестко по центру по горизонтали */
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 24px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.02);
}

/* Пульсирующее фоновое свечение (цвет задается через инлайн-переменную в HTML) */
.cyber-empty-icon-wrap::before {
    content: '';
    position: absolute;
    inset: -20px;
    background: var(--empty-glow, rgba(250, 191, 60, 0.15));
    filter: blur(25px);
    border-radius: 50%;
    z-index: -1;
    animation: emptyPulse 3s infinite alternate ease-in-out;
}

@keyframes emptyPulse {
    0% { transform: scale(0.85); opacity: 0.5; }
    100% { transform: scale(1.15); opacity: 1; }
}

/* 4. Типографика */
.cyber-empty-title {
    font-family: 'Bowler', sans-serif;
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: 12px;
    letter-spacing: 1px;
}

.cyber-empty-desc {
    color: #94a3b8;
    font-size: 0.95rem;
    max-width: 350px;
    line-height: 1.6;
    margin: 0 auto;
}

/* Unified generation error placeholder */
.generation-error-card {
    --error-accent: #ff5f67;
    --error-soft: rgba(255, 95, 103, 0.12);
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    min-height: 100%;
    padding: 18px;
    border: 1px solid color-mix(in srgb, var(--error-accent) 55%, transparent);
    border-radius: 16px;
    background:
        radial-gradient(circle at 10% 20%, var(--error-soft), transparent 42%),
        linear-gradient(145deg, rgba(18, 18, 21, 0.98), rgba(10, 10, 12, 0.98));
    color: #f8fafc;
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.04), 0 16px 36px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
}

.generation-error-card.generation-error-warning {
    --error-accent: #fabf3c;
    --error-soft: rgba(250, 191, 60, 0.13);
}

.generation-error-icon {
    flex: 0 0 48px;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border: 1px solid color-mix(in srgb, var(--error-accent) 52%, transparent);
    border-radius: 15px;
    background: var(--error-soft);
    color: var(--error-accent);
    font-size: 1.2rem;
}

.generation-error-copy {
    min-width: 0;
    text-align: left;
}

.generation-error-copy strong {
    display: block;
    margin: 0 28px 5px 0;
    color: var(--error-accent);
    font-size: 0.95rem;
    line-height: 1.25;
}

.generation-error-copy p {
    margin: 0;
    color: #cbd5e1;
    font-size: 0.78rem;
    line-height: 1.45;
}

.generation-error-refund {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(52, 211, 153, 0.12);
    color: #6ee7b7;
    font-size: 0.67rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.generation-error-close {
    position: absolute;
    top: 8px;
    right: 8px;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.05);
    color: #94a3b8;
    cursor: pointer;
}

.generation-error-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.tc-bubble .generation-error-card {
    min-height: 0;
    max-width: 620px;
}

/* Image result cards need a denser layout than chat and full-width errors. */
.generation-placeholder .generation-error-card {
    align-items: center;
    gap: 11px;
    padding: 14px;
    border-radius: inherit;
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.04);
}

.generation-placeholder .generation-error-icon {
    flex-basis: 40px;
    width: 40px;
    height: 40px;
    border-radius: 13px;
    font-size: 1rem;
}

.generation-placeholder .generation-error-copy {
    flex: 1;
}

.generation-placeholder .generation-error-copy strong {
    margin-right: 24px;
    font-size: 0.86rem;
}

.generation-placeholder .generation-error-copy p {
    font-size: 0.72rem;
    line-height: 1.4;
}

.generation-placeholder .generation-error-refund {
    margin-top: 8px;
    font-size: 0.64rem;
}

.generation-placeholder .generation-error-close {
    top: 7px;
    right: 7px;
    width: 26px;
    height: 26px;
}

@container (max-width: 210px) {
    .generation-placeholder .generation-error-card {
        flex-direction: column;
        justify-content: center;
        align-items: flex-start;
        gap: 8px;
        padding: 12px;
    }

    .generation-placeholder .generation-error-icon {
        flex-basis: 34px;
        width: 34px;
        height: 34px;
        border-radius: 11px;
        font-size: 0.86rem;
    }

    .generation-placeholder .generation-error-copy strong {
        margin: 0 25px 4px 0;
        font-size: 0.78rem;
        line-height: 1.2;
    }

    .generation-placeholder .generation-error-copy p {
        display: -webkit-box;
        overflow: hidden;
        font-size: 0.65rem;
        line-height: 1.3;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 3;
    }

    .generation-placeholder .generation-error-refund {
        margin-top: 6px;
        padding: 3px 6px;
        font-size: 0.58rem;
    }
}

@container (max-width: 160px) {
    .generation-placeholder .generation-error-copy p {
        display: none;
    }

    .generation-placeholder .generation-error-refund {
        font-size: 0;
        white-space: nowrap;
    }

    .generation-placeholder .generation-error-refund i {
        font-size: 0.62rem;
    }

    .generation-placeholder .generation-error-refund::after {
        content: 'Возврат выполнен';
        font-size: 0.58rem;
    }
}
