/* ═══════════════════════════════════════════════════
   AutoSMM User Posts List — page styles
   BEM naming: up- prefix (user-posts)
   Reuses sh- design system variables
   ═══════════════════════════════════════════════════ */

:root {
    --sh-primary: #0F33EF;
    --sh-primary-light: #4A6CF7;
    --sh-primary-bg: #f0f4ff;
    --sh-success: #22c55e;
    --sh-warning: #f59e0b;
    --sh-danger: #ef4444;
    --sh-text: #1a1a1a;
    --sh-text-muted: #6c757d;
    --sh-text-secondary: #8b95a5;
    --sh-border: #e5e7eb;
    --sh-bg: #f8f9fb;
    --sh-card-bg: #ffffff;
    --sh-radius: 16px;
    --sh-radius-sm: 10px;
    --sh-radius-xs: 8px;
    --sh-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    --sh-shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.12);
    --sh-transition: 0.2s ease;
}

/* ─── Page Layout ─── */

.up-page {
    min-height: 100vh;
    background: var(--sh-bg);
    padding: 0;
}

.up-container {
    max-width: 1060px;
    margin: 0 auto;
    padding: 20px 24px 40px;
}

/* ─── Header ─── */

.up-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 12px;
}

.up-header__left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.up-header__title {
    font-family: 'Unbounded', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--sh-text);
    margin: 0;
}

.up-header__title span {
    color: var(--sh-primary);
}

/* ─── Filter Tabs ─── */

.up-filters {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--sh-border);
    margin-bottom: 24px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.up-filters::-webkit-scrollbar {
    display: none;
}

.up-filter {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border: none;
    background: none;
    color: var(--sh-text-muted);
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color var(--sh-transition), border-color var(--sh-transition);
    white-space: nowrap;
    text-decoration: none;
}

.up-filter:hover {
    color: var(--sh-text);
}

.up-filter--active {
    color: var(--sh-primary);
    border-bottom-color: var(--sh-primary);
    font-weight: 600;
}

.up-filter i {
    font-size: 13px;
}

/* ─── Buttons ─── */

.up-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--sh-radius-sm);
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform var(--sh-transition), box-shadow var(--sh-transition), opacity var(--sh-transition);
    text-decoration: none;
    line-height: 1.4;
}

.up-btn:hover {
    transform: translateY(-1px);
}

.up-btn:active {
    transform: translateY(0);
}

.up-btn--primary {
    background: linear-gradient(135deg, var(--sh-primary) 0%, var(--sh-primary-light) 100%);
    color: #fff;
}

.up-btn--primary:hover {
    box-shadow: 0 4px 16px rgba(15, 51, 239, 0.3);
}

.up-btn--secondary {
    background: var(--sh-card-bg);
    color: var(--sh-text);
    border: 1px solid var(--sh-border);
}

.up-btn--sm {
    padding: 7px 14px;
    font-size: 13px;
}

.up-btn--lg {
    padding: 14px 28px;
    font-size: 15px;
}

/* ─── Post Card ─── */

.up-card {
    background: var(--sh-card-bg);
    border-radius: var(--sh-radius);
    padding: 10px 24px 20px;
    box-shadow: var(--sh-shadow);
    border: 1px solid var(--sh-border);
    margin-bottom: 16px;
    transition: box-shadow var(--sh-transition);
}

.up-card:hover {
    box-shadow: var(--sh-shadow-hover);
}

.up-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.up-card__title {
    font-size: 15px;
    font-weight: 600;
    color: #6b6b6b;
    margin: 0;
    flex: 1;
    min-width: 0;
}

.up-card__title a {
    color: inherit;
    text-decoration: none;
}

.up-card__title a:hover {
    color: var(--sh-primary);
}

.up-card__meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    flex-wrap: wrap;
    padding-bottom: 8px;
    margin-left: -24px;
    margin-right: -24px;
    padding-left: 24px;
    padding-right: 24px;
    border-bottom: none;
    background-image: linear-gradient(to right, #e8eaee 0%, #e8eaee 60%, transparent 100%);
    background-size: 100% 1px;
    background-position: bottom;
    background-repeat: no-repeat;
}

/* ─── Badges ─── */

.up-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.up-badge--muted {
    background: #f3f4f6;
    color: var(--sh-text-muted);
}

.up-badge--primary {
    background: var(--sh-primary-bg);
    color: var(--sh-primary);
}

.up-badge--date {
    background: transparent;
    color: var(--sh-text-secondary);
    padding: 0;
    font-weight: 500;
    font-size: 12px;
    gap: 5px;
}

.up-badge--date i {
    font-size: 12px;
}

/* ─── Collapsible Text ─── */

.up-card__text-wrap {
    position: relative;
    margin: 0 0 14px;
}

.up-card__text {
    font-size: 14px;
    color: var(--sh-text);
    line-height: 1.6;
    overflow: hidden;
    transition: max-height 0.4s ease;
    word-break: break-word;
}

.up-card__text p {
    margin: 0 0 8px;
}

.up-card__text p:last-child {
    margin-bottom: 0;
}

.up-card__text-wrap .fade-overlay {
    pointer-events: none;
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 6em;
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0)   0%,
        rgba(255, 255, 255, 0.3) 30%,
        rgba(255, 255, 255, 0.7) 60%,
        rgba(255, 255, 255, 1)   100%
    );
    z-index: 2;
    opacity: 1;
    transition: opacity 0.4s ease;
}

.up-card__text-wrap.expanded .fade-overlay {
    opacity: 0;
}

.up-card__text-wrap.expanded .up-card__text {
    max-height: none;
}

.up-card__toggle {
    cursor: pointer;
    color: var(--sh-primary);
    font-size: 13px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    position: relative;
    z-index: 3;
    transition: color var(--sh-transition);
    border: none;
    background: none;
    padding: 0;
    font-family: 'Montserrat', sans-serif;
}

.up-card__toggle:hover {
    color: var(--sh-primary-light);
}

.up-card__toggle i {
    font-size: 11px;
    transition: transform 0.3s ease;
}

.up-card__text-wrap.expanded .up-card__toggle i {
    transform: rotate(180deg);
}

/* ─── Carousel Override ─── */

.up-card .carousel-container {
    border-radius: var(--sh-radius-xs);
    background-color: var(--sh-bg);
    margin-bottom: 14px;
}

/* ─── Card Footer ─── */

.up-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 14px;
    border-top: 1px solid var(--sh-border);
    flex-wrap: wrap;
}

.up-card__footer-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ─── Empty State ─── */

.up-empty-state {
    text-align: center;
    padding: 48px 24px;
}

.up-empty-state__icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--sh-primary-bg);
    color: var(--sh-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin: 0 auto 16px;
}

.up-empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--sh-text);
    margin: 0 0 8px;
}

.up-empty-state p {
    font-size: 14px;
    color: var(--sh-text-muted);
    max-width: 440px;
    margin: 0 auto 20px;
    line-height: 1.5;
}

/* ─── Pagination ─── */

.up-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 24px 0 8px;
}

.up-pagination__item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--sh-radius-xs);
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: var(--sh-text-muted);
    text-decoration: none;
    transition: background var(--sh-transition), color var(--sh-transition);
    border: 1px solid transparent;
}

.up-pagination__item:hover {
    background: var(--sh-card-bg);
    border-color: var(--sh-border);
    color: var(--sh-text);
}

.up-pagination__item--active {
    background: var(--sh-primary);
    color: #fff;
    font-weight: 600;
    pointer-events: none;
}

.up-pagination__item--active:hover {
    background: var(--sh-primary);
    color: #fff;
    border-color: transparent;
}

/* ─── Sources Feed subtitle ─── */

.sf-subtitle {
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    color: var(--sh-text-muted);
    margin: 0 0 16px;
    line-height: 1.5;
}

.sf-subtitle a {
    color: var(--sh-primary);
    text-decoration: none;
    font-weight: 600;
}

.sf-subtitle a:hover {
    text-decoration: underline;
}

/* ─── Responsive ─── */

@media (max-width: 992px) {
    .up-container {
        padding: 16px 10px 32px;
    }
}

@media (max-width: 640px) {
    .up-container {
        padding: 12px 6px 28px;
    }

    .up-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .up-header__title {
        font-size: 18px;
    }

    .up-card {
        padding: 16px 18px;
    }

    .up-card__header {
        flex-direction: column;
        gap: 8px;
    }

    .up-card__footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .up-filters {
        gap: 0;
    }

    .up-filter {
        padding: 8px 12px;
        font-size: 12px;
    }
}
