/* ══════════════════════════════════════════
   Social's Page — Frontend Styles
   ══════════════════════════════════════════ */

.spm-frontend {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    max-width: 100%;
    padding: 0;
}

/* ── Category tabs ── */
.spm-fe-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 24px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 0;
}
.spm-fe-tabs::-webkit-scrollbar { display: none; }

.spm-fe-tab {
    padding: 13px 20px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    white-space: nowrap;
    transition: all .2s;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: -1px;
}
.spm-fe-tab:hover { color: #1f2937; }
.spm-fe-tab.active { color: #4f46e5; border-bottom-color: #4f46e5; }

.spm-fe-count {
    background: #f3f4f6;
    color: #6b7280;
    font-size: 11px;
    padding: 1px 7px;
    border-radius: 20px;
    font-weight: 600;
}
.spm-fe-tab.active .spm-fe-count { background: #ede9fe; color: #4f46e5; }

/* ── Grid ── */
.spm-fe-grid {
    display: grid;
    gap: 18px;
}
.spm-cols-5 { grid-template-columns: repeat(5, 1fr); }
.spm-cols-4 { grid-template-columns: repeat(4, 1fr); }
.spm-cols-3 { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 1200px) {
    .spm-cols-5 { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 960px) {
    .spm-cols-5, .spm-cols-4 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 680px) {
    .spm-cols-5, .spm-cols-4, .spm-cols-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 420px) {
    .spm-cols-5, .spm-cols-4, .spm-cols-3 { grid-template-columns: 1fr; }
}

/* ── Card ── */
.spm-fe-card {
    background: #fff;
    border: 1px solid #d9dce2;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
    overflow: hidden;
    transition: transform .2s, box-shadow .2s, border-color .2s;
    display: flex;
    flex-direction: column;
}
.spm-fe-card:hover {
    transform: translateY(-3px);
    border-color: #c7cbd3;
    box-shadow: 0 8px 28px rgba(0,0,0,.12);
}

/* Card top row */
.spm-card-top {
    display: flex;
    align-items: center;
    padding: 10px 12px 8px;
    gap: 8px;
}
.spm-card-avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; color: #fff;
    flex-shrink: 0;
    text-transform: uppercase;
}
.spm-card-namelines { flex: 1; min-width: 0; }
.spm-name-line {
    font-size: 13px;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.spm-sub-line {
    font-size: 11px;
    color: #9ca3af;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Platform badge */
.spm-plat-badge {
    width: 28px; height: 28px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.spm-plat-badge svg {
    width: 16px; height: 16px;
    fill: #fff;
    display: block;
}
.spm-plat-fallback {
    font-size: 13px;
    font-weight: 800;
    color: #fff;
    text-transform: uppercase;
}
.spm-plat-fb { background: #1877f2; }
.spm-plat-ig { background: linear-gradient(135deg,#f09433 0%,#e6683c 25%,#dc2743 50%,#cc2366 75%,#bc1888 100%); }
.spm-plat-tw { background: #000; }
.spm-plat-li { background: #0a66c2; }
.spm-plat-pi { background: #e60023; }
.spm-plat-tt { background: #010101; }
.spm-plat-yt { background: #ff0000; }
.spm-plat-gen { background: #6b7280; }

/* Category avatar colors (default, overridden per-category by JS) */
.spm-card-avatar[data-cat] { background: #4f46e5; }
.spm-card-avatar-img {
    padding: 0;
    background: #e5e7eb;
    overflow: hidden;
}
.spm-card-avatar-img img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}

/* Card image */
.spm-card-img {
    position: relative;
    width: 100%;
    padding-top: 125%; /* 4:5 */
    background: #f3f4f6;
    overflow: hidden;
}
.spm-card-img img {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    backface-visibility: hidden;
}
.spm-no-img {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 32px; color: #d1d5db;
}

/* Play + views overlay */
.spm-img-overlay {
    position: absolute;
    bottom: 8px; left: 8px;
    display: flex; align-items: center; gap: 6px;
}
.spm-play-btn {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,.93);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,.22);
    flex-shrink: 0;
}
.spm-play-btn svg {
    width: 13px; height: 13px;
    fill: #1f2937;
    margin-left: 2px;
}
.spm-views-pill {
    background: rgba(0,0,0,.58);
    color: #fff;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 20px;
    display: flex; align-items: center; gap: 4px;
    font-weight: 600;
    font-family: -apple-system, sans-serif;
}
.spm-views-pill svg {
    width: 10px; height: 10px;
    fill: #fff;
}

/* Card body */
.spm-card-body {
    padding: 10px 12px 8px;
    flex: 1;
}
.spm-card-caption {
    font-size: 12px;
    color: #374151;
    line-height: 1.45;
    margin: 0 0 6px;
}
.spm-card-caption p {
    margin: 0 0 8px;
}
.spm-card-caption p:last-child {
    margin-bottom: 0;
}
.spm-card-tags {
    font-size: 11px;
    color: #4f46e5;
    line-height: 1.5;
}
.spm-card-tags p {
    margin: 0 0 6px;
}
.spm-card-tags p:last-child {
    margin-bottom: 0;
}
.spm-text-lines { display: flex; flex-direction: column; gap: 5px; }
.spm-tl { height: 6px; background: #e5e7eb; border-radius: 3px; }
.spm-tl:nth-child(2) { width: 84%; }
.spm-tl:nth-child(3) { width: 65%; }

/* Hidden card (filtered out) */
.spm-fe-card.spm-hidden {
    display: none;
}

/* No posts */
.spm-no-posts { color: #6b7280; font-size: 14px; padding: 20px; }
