/* ============================================
   GENZFLOW — POSTS PAGE
   ============================================ */

/* ---- Filter Tabs ---- */
.posts-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-3);
    gap: var(--space-2);
    flex-wrap: wrap;
}

.posts-filter-tabs {
    display: flex;
    gap: 2px;
    background-color: var(--bg-input);
    border-radius: var(--radius-sm);
    padding: 3px;
    border: 1px solid var(--border-subtle);
}

.posts-filter-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: var(--space-1) var(--space-2);
    font-size: var(--font-size-body);
    font-weight: var(--font-weight-medium);
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    background: none;
    border: none;
}

.posts-filter-tab:hover {
    color: var(--text-primary);
    background-color: var(--bg-hover);
}

.posts-filter-tab.active {
    background-color: var(--primary-accent);
    color: var(--text-on-accent);
    box-shadow: 0 2px 6px hsla(245, 70%, 62%, 0.25);
}

.posts-filter-count {
    font-size: 11px;
    font-weight: var(--font-weight-semibold);
    padding: 1px 6px;
    border-radius: var(--radius-full);
    line-height: 1.4;
}

.posts-filter-tab:not(.active) .posts-filter-count {
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
}

.posts-filter-tab.active .posts-filter-count {
    background-color: rgba(255, 255, 255, 0.2);
    color: var(--text-on-accent);
}

/* ---- Posts Table (page-specific overrides) ---- */
.posts-page-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.posts-page-table thead th {
    font-size: var(--font-size-caption);
    font-weight: var(--font-weight-semibold);
    color: var(--text-muted);
    text-align: left;
    padding: var(--space-1) var(--space-2);
    border-bottom: 1px solid var(--border-subtle);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.posts-page-table tbody tr {
    transition: background-color var(--transition-fast);
}

.posts-page-table tbody tr:hover {
    background-color: var(--bg-hover);
}

.posts-page-table tbody td {
    padding: var(--space-2);
    font-size: var(--font-size-body);
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
}

/* Thumbnail cell */
.pp-thumbnail {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    background-color: var(--bg-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.pp-thumbnail i {
    width: 20px;
    height: 20px;
    stroke-width: 1.75;
    color: var(--text-muted);
}

/* Caption cell */
.pp-caption {
    max-width: 280px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: var(--line-height-normal);
    color: var(--text-primary);
}

/* Platform icons cell */
.pp-platforms {
    display: flex;
    gap: 6px;
}

.pp-platform-icon {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-hover);
    color: var(--text-secondary);
}

.pp-platform-icon i {
    width: 14px;
    height: 14px;
    stroke-width: 1.75;
}

/* Views cell */
.pp-views {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* Time cell */
.pp-time {
    font-size: var(--font-size-caption);
    color: var(--text-secondary);
    white-space: nowrap;
}

/* ---- Action Buttons ---- */
.pp-actions {
    display: flex;
    gap: 4px;
}

.pp-action-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-muted);
    background: none;
    border: none;
}

.pp-action-btn:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
}

.pp-action-btn.danger:hover {
    background-color: var(--error-soft);
    color: var(--error);
}

.pp-action-btn i {
    width: 16px;
    height: 16px;
    stroke-width: 1.75;
}

/* Tooltip on action buttons */
.pp-action-btn {
    position: relative;
}

.pp-action-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%) scale(0.9);
    background-color: var(--bg-surface);
    color: var(--text-primary);
    font-size: 11px;
    font-weight: var(--font-weight-medium);
    padding: 4px 8px;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: all var(--transition-fast);
    border: 1px solid var(--border-default);
    box-shadow: var(--shadow-dropdown);
}

.pp-action-btn:hover::after {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

/* ---- Loading Skeleton ---- */
.posts-skeleton {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.skeleton-row {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2);
    border-bottom: 1px solid var(--border-subtle);
}

.skeleton-block {
    background: linear-gradient(90deg,
            var(--bg-hover) 25%,
            rgba(255, 255, 255, 0.06) 50%,
            var(--bg-hover) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: 6px;
}

.skeleton-thumb {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.skeleton-text-lg {
    height: 14px;
    width: 200px;
}

.skeleton-text-sm {
    height: 12px;
    width: 80px;
}

.skeleton-badge {
    height: 22px;
    width: 64px;
    border-radius: var(--radius-full);
}

.skeleton-circle {
    width: 26px;
    height: 26px;
    border-radius: 6px;
}

@keyframes skeleton-shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ---- Empty State ---- */
.posts-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-6) var(--space-3);
    text-align: center;
}

.posts-empty-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-lg);
    background-color: var(--accent-soft);
    color: var(--primary-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-3);
}

.posts-empty-icon i {
    width: 28px;
    height: 28px;
    stroke-width: 1.5;
}

.posts-empty-title {
    font-size: var(--font-size-h3);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin-bottom: var(--space-1);
}

.posts-empty-text {
    font-size: var(--font-size-body);
    color: var(--text-secondary);
    max-width: 360px;
    margin-bottom: var(--space-3);
    line-height: var(--line-height-normal);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {

    .posts-page-table .col-views,
    .posts-page-table .col-thumb {
        display: none;
    }

    .pp-caption {
        max-width: 200px;
    }
}

@media (max-width: 768px) {
    .posts-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .posts-filter-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .posts-page-table .col-platforms,
    .posts-page-table .col-time {
        display: none;
    }

    .pp-caption {
        max-width: 160px;
    }

    .pp-actions {
        gap: 2px;
    }

    .pp-action-btn {
        width: 28px;
        height: 28px;
    }
}