/**
 * TOCHKA Glass Performance (v21.1.0) — Silver Glass & Gold Boost Edition
 * Путь: css/feed.css
 * Исправлено: Слипание фильтров, гигантизм карточек, позиционирование флоатера.
 * Интеграция: Atmos Core [2026-03-03] — Фикс блока автора и иерархии Z-index.
 * Анимации: Optimistic UI (v4.5) + Skeleton v19.0 + Gold Shine Overlay.
 */

:root {
    --glass-bg: rgba(22, 23, 26, 0.75);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-blur: blur(25px) saturate(180%);
    --accent-blue: #007AFF;
    --accent-red: #FF3B30;
    --accent-green: #32D74B;
    --accent-gold: #d4af37;
    --text-main: #FFFFFF;
    --text-dim: rgba(255, 255, 255, 0.5);
    --ios-curve: cubic-bezier(0.32, 0.72, 0, 1);
    --card-radius: 32px;
}

/* --- 1. ШАПКА И ФИЛЬТРЫ (Фикс слипания) --- */
.feed-filters-container {
    padding: calc(var(--sat, 20px) + 12px) 16px 8px; /* Учет безопасной зоны iOS */
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(18, 18, 18, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.top-row-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 12px;
}

.radius-segmented-control {
    display: flex;
    background: rgba(255, 255, 255, 0.07);
    padding: 2px;
    border-radius: 12px;
    flex-shrink: 0;
    border: 1px solid var(--glass-border);
}

.radius-btn {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-dim);
    white-space: nowrap;
    transition: all 0.3s var(--ios-curve);
    cursor: pointer;
    border-radius: 10px;
    background: transparent;
    border: none;
    outline: none;
}

.radius-btn.active {
    background: var(--accent-blue);
    color: #fff;
    box-shadow: 0 2px 10px rgba(0, 122, 255, 0.3);
}

.categories-scroll {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    padding: 4px 0 12px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.categories-scroll::-webkit-scrollbar { display: none; }

.filter-btn {
    flex-shrink: 0;
    padding: 8px 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.filter-btn.active {
    background: #fff;
    border-color: #fff;
    color: #000;
}

/* --- 2. ЛЕНТА И КАРТОЧКИ (Фикс гигантизма) --- */
#response-feed {
    display: flex !important;
    flex-direction: column !important;
    gap: 24px;
    padding: 10px 16px calc(var(--sab, 20px) + 80px);
    width: 100% !important;
    max-width: 500px; 
    margin: 0 auto;
    box-sizing: border-box;
}

.feed-card-glass, .point-card {
    width: 100%;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--card-radius);
    overflow: visible; 
    display: flex;
    flex-direction: column;
    transition: transform 0.4s var(--ios-curve), box-shadow 0.4s ease, opacity 0.4s ease, filter 0.4s ease;
    text-decoration: none;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    z-index: 10;
    -webkit-tap-highlight-color: transparent;
}

/* --- BOOST PREMIUM: Золотой статус --- */
.feed-card-glass.is-boosted {
    border: 2px solid transparent !important;
    background-image: linear-gradient(#16171a, #16171a), 
                      linear-gradient(45deg, #d4af37, #f9f295, #b8860b, #f9f295, #d4af37);
    background-origin: border-box;
    background-clip: padding-box, border-box;
    background-size: 400% 400%;
    animation: goldGradientScroll 8s ease-in-out infinite;
    box-shadow: 0 10px 40px rgba(212, 175, 55, 0.15);
}

@keyframes goldGradientScroll {
    0% { background-position: 0% 50%, 0% 50%; }
    50% { background-position: 0% 50%, 100% 50%; }
    100% { background-position: 0% 50%, 0% 50%; }
}

/* Блик поверх BOOST карточки */
.feed-card-glass.is-boosted::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.05) 45%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0.05) 55%, rgba(255,255,255,0) 100%);
    background-size: 200% 200%;
    animation: shineOverlay 4s infinite linear;
    pointer-events: none;
    z-index: 1;
}

@keyframes shineOverlay {
    0% { background-position: -200% -200%; }
    100% { background-position: 200% 200%; }
}

/* --- OPTIMISTIC UI: АНИМАЦИИ УДАЛЕНИЯ --- */
.point-card.is-deleting {
    pointer-events: none;
    transform: scale(0.95);
    filter: blur(4px) grayscale(1);
    opacity: 0.6;
}

.point-card.is-deleting-final {
    transform: scale(0.8) translateX(120%) rotate(5deg);
    opacity: 0;
    margin-bottom: -100px;
    pointer-events: none;
}

.feed-card-glass:active {
    transform: scale(0.97) translateY(2px);
}

/* ВИЗУАЛЬНЫЙ БЛОК */
.card-visual {
    position: relative;
    width: 100%;
    height: 220px; 
    overflow: visible !important; 
    background: #0d0e12;
    border-radius: var(--card-radius) var(--card-radius) 0 0;
    z-index: 2;
}

/* Контейнер Meta Stack внутри карточки */
.card-meta-overlay {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 60;
}

.img-aspect-ratio {
    width: 100%;
    height: 100%;
    border-radius: var(--card-radius) var(--card-radius) 0 0;
    overflow: hidden; 
    position: relative;
}

.main-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1.2s var(--ios-curve);
    z-index: 3;
}

.feed-card-glass:hover .main-img {
    transform: scale(1.05);
}

.card-visual::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 50%, rgba(0,0,0,0.5) 100%);
    pointer-events: none;
    z-index: 4;
    border-radius: var(--card-radius) var(--card-radius) 0 0;
}

/* СИНИЙ ФЛОАТЕР (Иконка категории) */
.category-icon-floater {
    position: absolute;
    bottom: -22px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    border: 4px solid #16171a; 
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
    z-index: 50;
    background: var(--accent-blue);
    padding: 7px;
    box-sizing: border-box;
}

.cat-icon-render {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
}

/* --- 3. ИНФОРМАЦИЯ И БЛОК АВТОРА --- */
.card-body { 
    padding: 34px 20px 20px; 
    position: relative;
    z-index: 1;
}

.card-title {
    color: var(--text-main);
    font-size: 20px;
    font-weight: 800;
    margin: 0 0 14px;
    line-height: 1.25;
    letter-spacing: -0.5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.location-row {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-dim);
    font-size: 13px;
    margin-bottom: 16px;
}

.location-row svg {
    width: 14px;
    height: 14px;
    color: var(--accent-blue); /* Согласовано с ios-дизайном */
    flex-shrink: 0;
}

.card-footer-flex {
    margin-top: 10px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.author-pill {
    text-decoration: none !important;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05); 
    padding: 4px 12px 4px 4px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.03);
    transition: all 0.2s ease;
}

.author-pill:hover { background: rgba(255, 255, 255, 0.1); }

.avatar-img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,0.1);
}

.author-name {
    color: #FFFFFF;
    font-size: 12px;
    font-weight: 600;
    opacity: 0.8;
}

/* --- 4. СКЕЛЕТОН (v19.0) --- */
.img-skeleton {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        rgba(26, 27, 30, 1) 25%,
        rgba(37, 38, 43, 1) 50%,
        rgba(26, 27, 30, 1) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
    z-index: 1;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Ценник */
.price-pill {
    position: absolute;
    bottom: 12px;
    left: 12px;
    z-index: 10;
    font-weight: 900;
    letter-spacing: -0.2px;
    background: var(--accent-blue);
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 13px;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.price-pill.is-free {
    background: var(--accent-green);
}

/* Фикс для Safari: заставляет блюр работать корректно */
.feed-card-glass {
    -webkit-mask-image: -webkit-radial-gradient(white, black);
}