/* modules/feed/style.css */

.feed-surface {
    background: transparent;
    border: none;
    border-radius: 0;
    overflow: visible;
    max-width: 720px;
    margin: 0 auto;
}

.feed {
    background: transparent;
    border: none;
    border-radius: 0;
    overflow: visible;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-bottom: 80px;
}

.feed-home-search {
    margin-bottom: 16px;
}

.feed-home-search .search-box {
    padding: 12px;
}

.feed-home-search .input-wrap {
    position: relative;
}

.feed-home-search-suggestions {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 30;
    background: #fff;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 12px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 320px;
    overflow-y: auto;
}

.feed-home-search-suggestions[hidden] {
    display: none !important;
}

.feed-home-search-suggestion {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: none;
    background: transparent;
    border-radius: 10px;
    color: #0f172a;
    text-align: left;
    cursor: pointer;
}

.feed-home-search-suggestion:hover,
.feed-home-search-suggestion.is-active {
    background: #f8fafc;
}

.feed-home-search-suggestion:focus-visible {
    outline: 2px solid #93c5fd;
    outline-offset: 1px;
}

.feed-home-search-suggestion-icon {
    color: #94a3b8;
    font-size: 14px;
    line-height: 1;
    flex: 0 0 auto;
}

.feed-home-search-suggestion-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    line-height: 1.3;
}

.feed-home-search .input {
    padding-right: 40px;
}

.feed-home-search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: #64748b;
    border-radius: 999px;
    cursor: pointer;
}

.feed-home-search-clear[hidden] {
    display: none !important;
}

.feed-home-search-clear:hover {
    background: #f1f5f9;
    color: #334155;
}

.feed-home-search-clear:focus-visible {
    outline: 2px solid #93c5fd;
    outline-offset: 1px;
}

@media (max-width: 900px) {
    .feed-home-search {
        margin-bottom: 10px;
    }

    .feed-home-search .search-box {
        padding: 10px;
    }

    .feed-home-search-suggestions {
        top: calc(100% + 6px);
        border-radius: 10px;
        max-height: 280px;
    }
}

@media (max-width: 720px) {
    body.view-home>.mobile-spaces-bar {
        display: none !important;
    }

    body.view-home #homeMobileSpacesMount>.mobile-spaces-bar {
        display: block !important;
    }

    .feed-surface {
        max-width: 100%;
    }

    .feed {
        gap: 12px;
    }

    .feed-home-search-suggestions {
        left: -2px;
        right: -2px;
        border-radius: 12px;
        padding: 6px;
    }

    .feed-home-search-suggestion {
        min-height: 46px;
        padding: 11px 12px;
    }

    #homeMobileSpacesMount {
        margin-bottom: 8px;
    }

    #homeMobileSpacesMount .mobile-spaces-bar {
        border-radius: 12px;
        border: 1px solid var(--border);
        border-bottom-width: 1px;
        overflow: hidden;
    }
}

.feed-end-message {
    text-align: center;
    padding: 40px 20px;
    color: var(--muted);
    font-size: 14px;
}

.feed-skeleton-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.feed-skeleton-card {
    background: #fff;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 16px;
    padding: 18px 20px;
}

.feed-skeleton-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.feed-skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 999px;
    background: #e5e7eb;
    flex: 0 0 auto;
    animation: feed-skeleton-pulse 1.25s ease-in-out infinite;
}

.feed-skeleton-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.feed-skeleton-line {
    display: block;
    height: 12px;
    border-radius: 999px;
    background: linear-gradient(90deg, #f1f5f9 20%, #e2e8f0 40%, #f1f5f9 60%);
    background-size: 220% 100%;
    animation: feed-skeleton-shimmer 1.2s linear infinite;
}

.feed-skeleton-line-title {
    width: 36%;
    min-width: 140px;
}

.feed-skeleton-line-sub {
    width: 54%;
    min-width: 180px;
}

.feed-skeleton-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.feed-skeleton-line-full {
    width: 100%;
}

.feed-skeleton-line-short {
    width: 72%;
}

.feed-skeleton-foot {
    display: flex;
    gap: 12px;
}

.feed-skeleton-pill {
    width: 84px;
    height: 12px;
    border-radius: 999px;
    background: #e2e8f0;
    animation: feed-skeleton-pulse 1.25s ease-in-out infinite;
}

@keyframes feed-skeleton-shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

@keyframes feed-skeleton-pulse {
    0%, 100% {
        opacity: 0.8;
    }
    50% {
        opacity: 0.45;
    }
}

@media (prefers-reduced-motion: reduce) {
    .feed-skeleton-avatar,
    .feed-skeleton-line,
    .feed-skeleton-pill {
        animation: none;
    }
}
