/**
 * BLOCKS v5.0 — Premium Cards & Layout
 */

/* ─── КАРТОЧКИ ─────────────────────────────────────── */
.block-card {
    background: var(--card-bg);
    border-radius: var(--radius-card);
    box-shadow: var(--card-shadow);
    padding: 14px 16px;
    margin-bottom: 10px;
    border: 1px solid var(--card-border);
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

/* ─── ЗАГОЛОВКИ БЛОКОВ ─────────────────────────────── */
.block-header {
    font-size: 10px;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

/* ─── СКРОЛЛБАР ЧАТА ───────────────────────────────── */
.feed-container::-webkit-scrollbar {
    width: 3px;
}

.feed-container::-webkit-scrollbar-track {
    background: transparent;
}

.feed-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

/* ─── ДЕТАЛИ (summary/details) ─────────────────────── */
details>summary {
    list-style: none;
}

details>summary::-webkit-details-marker {
    display: none;
}

/* ─── ЦВЕТНЫЕ ПОЛОСКИ СЛЕВА (АКЦЕНТ КАРТОЧКИ) - УСТАРЕЛО ──────── */
.block-card.legacy-border>div:first-child[class*="bg-"] {
    border-radius: var(--radius-card) 0 0 var(--radius-card);
}

/* ─── НОВЫЕ ПРЕМИУМ-КАРТОЧКИ И СЕТКА ────────────────── */
.card-premium {
    background: var(--card-bg);
    border-radius: var(--radius-card);
    box-shadow: var(--card-shadow);
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid var(--card-border);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ─── НАВИГАЦИЯ: ПИЛЮЛИ (ПЕРЕКЛЮЧАТЕЛЬ КОНТЕКСТА) ───── */
.context-pills {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    margin-bottom: 16px;
    /* Скрываем скроллбар для эстетики */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.context-pills::-webkit-scrollbar {
    display: none;
}

.pill {
    padding: 6px 12px;
    border-radius: 20px;
    background: white;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    border: 1px solid var(--card-border);
    transition: all 0.2s ease;
}

.pill.active {
    background: var(--pia-navy);
    color: white;
    border-color: var(--pia-navy);
    box-shadow: 0 2px 4px rgba(29, 42, 69, 0.2);
}

/* ─── ЧАТ И STICKY FOOTER ───────────────────────────── */
.chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 80px);
    /* Примерная высота с учетом шапки */
    position: relative;
}

.chat-panel {
    flex-grow: 1;
    overflow-y: auto;
    padding: 16px;
    background: var(--bg-app);
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-bottom: 24px;
}

.chat-bubble {
    padding: 10px 14px;
    border-radius: 12px;
    max-width: 85%;
    font-size: 13px;
    line-height: 1.4;
    position: relative;
}

.chat-bubble-bot {
    background: white;
    border: 1px solid var(--card-border);
    border-bottom-left-radius: 4px;
    align-self: flex-start;
}

.chat-bubble-client {
    background: var(--pia-gold-soft);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-bottom-right-radius: 4px;
    align-self: flex-end;
}

.chat-timestamp {
    font-size: 10px;
    color: var(--text-secondary);
    /* Улучшенный контраст */
    margin-top: 4px;
    text-align: right;
}

.chat-input-sticky {
    position: sticky;
    bottom: 0;
    background: white;
    padding: 12px 16px;
    border-top: 1px solid var(--card-border);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.03);
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0 -16px;
    /* Компенсация паддингов родителя если надо */
}

.chat-textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-button);
    padding: 12px;
    font-family: inherit;
    font-size: 13px;
    resize: none;
    min-height: 60px;
    transition: border-color 0.2s;
}

.chat-textarea:focus {
    outline: none;
    border-color: var(--pia-navy);
}

/* Плавный аккордеон */
details summary {
    cursor: pointer;
    transition: margin 0.2s ease;
}

details[open] summary {
    margin-bottom: 10px;
}

details summary svg {
    transition: transform 0.2s ease;
}

details[open] summary svg {
    transform: rotate(180deg);
}