/* Feed-first homepage — platform discovery layout */

body.ms-page-home-feed {
    --ms-platform-content-max: 2400px;
}

.ms-page-home-feed .ms-marketing-free-banner {
    display: none;
}

/* Feed shell — uses ms-platform-layout from public-header-platform.css */
.ms-home-feed.ms-platform-layout,
.ms-platform-layout.ms-home-feed {
    padding: 0 8px 32px;
    max-width: var(--ms-platform-content-max, 1920px);
}

.ms-feed-sidebar {
    /* layout shell is ms-platform-layout__sidebar */
}

.ms-feed-sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ms-feed-sidebar__link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.78);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease;
}

.ms-feed-sidebar__link:hover,
.ms-feed-sidebar__link.is-active {
    background: rgba(124, 58, 237, 0.18);
    color: #fff;
    text-decoration: none;
}

.ms-feed-sidebar__link i {
    width: 18px;
    text-align: center;
    color: rgba(0, 212, 255, 0.85);
    font-size: 0.875rem;
}

.ms-feed-sidebar__download-badge {
    margin-top: 0.45rem;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.18), rgba(56, 189, 248, 0.14));
    border: 1px solid rgba(74, 222, 128, 0.35);
    color: #ecfdf5;
    font-weight: 600;
}

.ms-feed-sidebar__download-badge:hover,
.ms-feed-sidebar__download-badge.is-active {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.28), rgba(56, 189, 248, 0.2));
    border-color: rgba(74, 222, 128, 0.55);
    color: #fff;
}

.ms-feed-sidebar__download-badge i {
    color: #4ade80;
}

.ms-feed-sidebar__badge-pill {
    margin-left: auto;
    padding: 0.12rem 0.45rem;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: rgba(34, 197, 94, 0.95);
    color: #052e16;
    line-height: 1.3;
}

html.light body .ms-feed-sidebar__download-badge,
body.light-mode .ms-feed-sidebar__download-badge {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.12), rgba(14, 165, 233, 0.1));
    border-color: rgba(22, 163, 74, 0.35);
    color: #14532d;
}

html.light body .ms-feed-sidebar__download-badge:hover,
html.light body .ms-feed-sidebar__download-badge.is-active,
body.light-mode .ms-feed-sidebar__download-badge:hover,
body.light-mode .ms-feed-sidebar__download-badge.is-active {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(14, 165, 233, 0.14));
    color: #052e16;
}

.ms-home-feed__main {
    flex: 1 1 auto;
    min-width: 0;
}

/* Category chips — tight under header */
.ms-feed-chips {
    position: sticky;
    top: var(--ms-platform-header-h, 60px);
    z-index: 15;
    margin: 0 0 6px;
    padding: 4px 0 6px;
    background: linear-gradient(180deg, rgba(6, 8, 14, 0.98) 75%, rgba(6, 8, 14, 0));
    backdrop-filter: blur(8px);
}

.ms-feed-chips__track {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
}

.ms-feed-chips__track::-webkit-scrollbar {
    display: none;
}

.ms-feed-chip {
    flex: 0 0 auto;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.ms-feed-chip.is-active,
.ms-feed-chip:hover {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.35), rgba(0, 212, 255, 0.2));
    border-color: rgba(168, 85, 247, 0.45);
    color: #fff;
    text-decoration: none;
}

/* Buttons (empty state, CTA, marketplace) */
.ms-home-feed-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.ms-home-feed-btn--primary {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.95), rgba(0, 212, 255, 0.75));
    color: #fff;
    box-shadow: 0 8px 28px rgba(124, 58, 237, 0.25);
}

.ms-home-feed-btn--ghost {
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.9);
}

.ms-home-feed-btn:hover {
    transform: translateY(-1px);
    color: #fff;
    text-decoration: none;
}

/* Section heads */
.ms-home-feed-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.ms-home-feed-section-head--compact {
    margin-bottom: 8px;
}

.ms-home-feed-section-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ms-home-feed-section-link {
    color: rgba(0, 212, 255, 0.9);
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.ms-home-feed-section-link:hover {
    text-decoration: underline;
}

/* Production grid */
.ms-home-feed-grid-section--primary {
    margin-top: 0;
    margin-bottom: 24px;
}

.ms-home-feed-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px 10px;
}

.ms-home-feed-grid--continued {
    margin-top: 12px;
}

.ms-feed-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.ms-feed-card__thumb-link {
    display: block;
    text-decoration: none;
}

.ms-feed-card__thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.ms-feed-card__video,
.ms-feed-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ms-feed-card__audio {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.25), rgba(0, 212, 255, 0.12));
    color: rgba(255, 255, 255, 0.8);
    font-size: 2rem;
}

.ms-feed-card__duration,
.ms-feed-card__badge {
    position: absolute;
    bottom: 6px;
    padding: 2px 6px;
    border-radius: 5px;
    font-size: 0.6875rem;
    font-weight: 700;
    background: rgba(0, 0, 0, 0.72);
    color: #fff;
}

.ms-feed-card__duration {
    right: 6px;
}

.ms-feed-card__badge {
    left: 6px;
    max-width: calc(100% - 64px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ms-feed-card__body {
    display: grid;
    grid-template-columns: 28px 1fr;
    gap: 6px 8px;
    align-items: start;
}

.ms-feed-card__avatar,
.ms-feed-card__avatar--initials {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(124, 58, 237, 0.35);
    color: #fff;
    font-size: 0.625rem;
    font-weight: 700;
}

.ms-feed-card__meta {
    min-width: 0;
    line-height: 1.2;
}

.ms-feed-card__title {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ms-feed-card__title a {
    color: #fff;
    text-decoration: none;
}

.ms-feed-card__title a:hover {
    color: #c4b5fd;
}

.ms-feed-card__creator,
.ms-feed-card__stats,
.ms-feed-card__model {
    margin: 0;
    font-size: 0.6875rem;
    line-height: 1.25;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 400;
}

.ms-feed-card__creator + .ms-feed-card__stats,
.ms-feed-card__creator + .ms-feed-card__model,
.ms-feed-card__stats + .ms-feed-card__model {
    margin-top: 2px;
}

.ms-feed-card__creator a {
    color: rgba(255, 255, 255, 0.58);
    text-decoration: none;
    font-weight: 500;
    font-size: inherit;
}

.ms-feed-card__creator a:hover {
    color: rgba(255, 255, 255, 0.78);
}

.ms-feed-card__model {
    color: rgba(255, 255, 255, 0.42);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Beat marketing shell defaults on homepage feed cards */
.ms-page-home-feed .ms-feed-card__title {
    font-size: 0.875rem;
}

.ms-page-home-feed .ms-feed-card__creator,
.ms-page-home-feed .ms-feed-card__stats,
.ms-page-home-feed .ms-feed-card__model {
    font-size: 0.6875rem !important;
    line-height: 1.25 !important;
}

/* Shorts row (after first grid rows) */
.ms-home-feed-shorts {
    margin: 16px 0 12px;
}

.ms-home-feed-shorts__track {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 4px;
    scrollbar-width: thin;
}

.ms-feed-shorts-card {
    flex: 0 0 132px;
    scroll-snap-align: start;
}

.ms-feed-shorts-card__link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.ms-feed-shorts-card__media {
    aspect-ratio: 9 / 16;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.ms-feed-shorts-card__media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ms-feed-shorts-card__title {
    margin: 6px 0 0;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ms-feed-shorts-card__creator,
.ms-feed-shorts-card__views {
    margin: 2px 0 0;
    font-size: 0.6875rem;
    color: rgba(255, 255, 255, 0.55);
}

/* Creators */
.ms-home-feed-creators {
    margin-bottom: 24px;
}

.ms-page-home-feed .ms-home-feed-creators.ms-community-featured {
    max-width: none;
    margin: 0 0 24px;
    padding: 0;
}

.ms-page-home-feed .ms-home-feed-creators .ms-community-featured__track {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

@media (min-width: 640px) {
    .ms-page-home-feed .ms-home-feed-creators .ms-community-featured__track {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1100px) {
    .ms-page-home-feed .ms-home-feed-creators .ms-community-featured__track {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.ms-page-home-feed .ms-community-featured-card__name {
    font-size: 0.9375rem;
}

.ms-page-home-feed .ms-community-featured-card__handle,
.ms-page-home-feed .ms-community-featured-card__stat,
.ms-page-home-feed .ms-community-featured-card__badge {
    font-size: 0.75rem;
}

.ms-page-home-feed .ms-community-featured-card--showcase-creator .ms-community-featured-card__name {
    color: #fff;
}

.ms-home-feed-creators__head {
    margin-bottom: 0;
}

.ms-home-feed-creators__head .ms-community-featured__title {
    font-size: 1rem;
    margin-bottom: 8px;
}

/* Marketplace */
.ms-home-feed-marketplace {
    margin-bottom: 28px;
}

.ms-home-feed-marketplace__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.ms-home-feed-market-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    text-decoration: none;
    color: #fff;
}

.ms-home-feed-market-card:hover {
    border-color: rgba(168, 85, 247, 0.4);
    text-decoration: none;
}

.ms-home-feed-market-card__price {
    color: rgba(0, 212, 255, 0.9);
    font-weight: 700;
    font-size: 0.875rem;
}

.ms-home-feed-marketplace__placeholder {
    padding: 20px;
    border-radius: 12px;
    border: 1px dashed rgba(255, 255, 255, 0.12);
    text-align: center;
    color: rgba(255, 255, 255, 0.65);
}

.ms-home-feed-marketplace__placeholder p {
    margin: 0 0 10px;
}

/* Bottom CTA only */
.ms-home-feed-cta {
    text-align: center;
    padding: 24px 16px;
    border-radius: 16px;
    border: 1px solid rgba(124, 58, 237, 0.25);
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.12), rgba(0, 212, 255, 0.06));
    margin-bottom: 8px;
}

.ms-home-feed-cta__title {
    margin: 0 0 12px;
    font-size: 1.125rem;
    font-weight: 700;
    color: #fff;
}

.ms-home-feed-cta__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

/* Empty */
.ms-home-feed-empty {
    text-align: center;
    padding: 32px 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.ms-home-feed-empty__icon {
    font-size: 1.75rem;
    color: rgba(168, 85, 247, 0.8);
    margin-bottom: 10px;
}

.ms-home-feed-empty h3 {
    margin: 0 0 6px;
    color: #fff;
    font-size: 1rem;
}

.ms-home-feed-empty p {
    margin: 0 0 12px;
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.875rem;
}

.ms-home-feed-empty__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

/* Responsive */
@media (min-width: 640px) {
    .ms-home-feed-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ms-home-feed-marketplace__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .ms-home-feed.ms-platform-layout,
    .ms-platform-layout.ms-home-feed {
        padding: 0 16px 32px;
    }

    .ms-home-feed-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 16px 14px;
    }
}

@media (min-width: 1440px) {
    .ms-home-feed.ms-platform-layout,
    .ms-platform-layout.ms-home-feed {
        padding: 0 20px 36px;
    }

    .ms-home-feed-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 20px 18px;
    }

    .ms-feed-card__thumb {
        border-radius: 14px;
    }

    .ms-feed-card__body {
        grid-template-columns: 36px 1fr;
        gap: 8px 12px;
    }

    .ms-feed-card__avatar,
    .ms-feed-card__avatar--initials {
        width: 36px;
        height: 36px;
        font-size: 0.75rem;
    }

    .ms-page-home-feed .ms-feed-card__title {
        font-size: 1rem;
    }

    .ms-page-home-feed .ms-feed-card__creator,
    .ms-page-home-feed .ms-feed-card__stats,
    .ms-page-home-feed .ms-feed-card__model {
        font-size: 0.75rem !important;
    }
}

@media (max-width: 1023px) {
    .ms-feed-chips {
        top: calc(var(--ms-platform-header-h, 60px) + 44px);
    }
}

@media (max-width: 767px) {
    .ms-page-home-feed .cinematic-saas-footer,
    .ms-page-home-feed .index-footer {
        padding-top: 20px;
        padding-bottom: 20px;
    }
}
