/**
 * feed.css - Activity Feed Styles
 * Shared styles for My Activity and Friends Activity tabs
 */

/* ================================================================ */
/* VISIBILITY INDICATOR STANDARDS                                    */
/* Use these classes consistently across the app                     */
/* ================================================================ */

/* Row background colors (pastel/light) */
.feed-visibility-private {
    background-color: rgba(248, 215, 218, 0.4) !important;  /* light pink */
}
.feed-visibility-friends {
    background-color: rgba(255, 243, 205, 0.4) !important;  /* light yellow */
}
.feed-visibility-public {
    background-color: rgba(212, 237, 218, 0.4) !important;  /* light green */
}

/* Icon colors */
.visibility-icon-private { color: #842029; }   /* dark red */
.visibility-icon-friends { color: #664d03; }   /* dark yellow/amber */
.visibility-icon-public { color: #0f5132; }    /* dark green */

/* ================================================================ */
/* VISIBILITY LEGEND                                                 */
/* ================================================================ */

.feed-visibility-legend {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

.feed-visibility-legend .legend-items {
    display: flex;
    gap: 1.5rem;
}

.feed-visibility-legend .legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.feed-visibility-legend .legend-item i {
    font-size: 1rem;
}

.feed-visibility-legend .settings-link {
    font-size: 0.85rem;
}

/* ================================================================ */
/* FILTER BAR                                                        */
/* ================================================================ */

.feed-filters {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.feed-filters .form-select {
    width: auto;
    min-width: 140px;
}

.feed-filters .filter-label {
    font-size: 0.85rem;
    color: #6c757d;
}

/* ================================================================ */
/* FEED CONTAINER - Compact Grid Layout                              */
/* ================================================================ */

.feed-container {
    max-width: 100%;
}

/* Grid layout for feed items - 2 columns by default */
#myFeedList,
#friendsFeedList {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

@media (max-width: 992px) {
    #myFeedList,
    #friendsFeedList {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 1400px) {
    #myFeedList,
    #friendsFeedList {
        grid-template-columns: repeat(3, 1fr);
    }
}

.feed-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.feed-empty i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.feed-loading {
    text-align: center;
    padding: 2rem;
}

/* ================================================================ */
/* FEED ITEM CARD                                                    */
/* ================================================================ */

.feed-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    border: 1px solid #e9ecef;
    transition: background-color 0.2s, box-shadow 0.2s;
}

.feed-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Visibility icon column */
.feed-item-visibility {
    flex-shrink: 0;
    width: 24px;
    text-align: center;
    padding-top: 2px;
}

.feed-item-visibility i {
    font-size: 0.9rem;
}

/* Poster column */
.feed-item-poster {
    flex-shrink: 0;
}

.feed-item-poster img {
    width: 45px;
    height: 67px;
    object-fit: cover;
    border-radius: 4px;
    background: var(--mv-border-color);
}

.feed-item-poster .poster-placeholder {
    width: 45px;
    height: 67px;
    background: var(--mv-border-color);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #adb5bd;
}

/* Sports game placeholder (wider) */
.feed-item-poster .game-placeholder {
    width: 60px;
    height: 45px;
    background: var(--mv-border-color);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #adb5bd;
    font-size: 1.25rem;
}

/* Content column */
.feed-item-content {
    flex: 1;
    min-width: 0;
}

.feed-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.feed-item-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: #212529;
}

.feed-item-title a {
    color: inherit;
    text-decoration: none;
}

.feed-item-title a:hover {
    color: #0d6efd;
    text-decoration: underline;
}

.feed-item-time {
    font-size: 0.8rem;
    color: #6c757d;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Right column - display name and time stacked */
.feed-item-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.15rem;
    flex-shrink: 0;
}

.feed-item-from {
    font-size: 0.8rem;
    color: #0d6efd;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.feed-item-from i {
    font-size: 0.75rem;
}

.feed-item-action {
    font-size: 0.9rem;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.feed-item-action i {
    font-size: 0.85rem;
}

.feed-item-action .action-icon {
    margin-right: 0.25rem;
}

/* Action type colors */
.feed-action-viewed { color: #0d6efd; }
.feed-action-abandoned { color: #dc3545; }
.feed-action-rated { color: #ffc107; }
.feed-action-watchlist { color: #6f42c1; }
.feed-action-review { color: #fd7e14; }
.feed-action-owned { color: #20c997; }
.feed-action-suggestion { color: #e83e8c; }
.feed-action-sports { color: #17a2b8; }
.feed-action-videogame { color: #198754; }
.feed-action-boardgame { color: #6f42c1; }
.feed-action-book { color: #0dcaf0; }
.feed-action-concert { color: #e83e8c; }
.feed-action-pick { color: #0d6efd; }

/* Entity review subtitle (author, platform, venue) */
.feed-item-subtitle {
    font-size: 0.78rem;
    color: #6c757d;
    margin-top: -1px;
    margin-bottom: 2px;
    line-height: 1.2;
}

/* Secondary info (partner, service, etc.) */
.feed-item-meta {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

.feed-item-meta i {
    font-size: 0.75rem;
}

/* Review excerpt */
.feed-item-excerpt {
    font-size: 0.85rem;
    color: #495057;
    margin-top: 0.35rem;
    padding: 0.5rem;
    background: rgba(0,0,0,0.03);
    border-radius: 4px;
    font-style: italic;
}

.feed-item-excerpt .read-more {
    font-style: normal;
    color: #0d6efd;
    cursor: pointer;
}

/* Rating display */
.feed-item-rating {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.feed-item-rating .stars {
    color: #ffc107;
}

/* ================================================================ */
/* FRIENDS TAB SPECIFIC                                              */
/* ================================================================ */

.feed-item-user {
    font-size: 0.85rem;
    color: #0d6efd;
    font-weight: 500;
    margin-bottom: 0.15rem;
}

.feed-item-user i {
    font-size: 0.8rem;
}

/* Friend filter dropdown */
.friend-filter-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ================================================================ */
/* INFINITE SCROLL                                                   */
/* ================================================================ */

.feed-load-more {
    text-align: center;
    padding: 1.5rem;
}

.feed-load-more .spinner-border {
    width: 1.5rem;
    height: 1.5rem;
}

.feed-end-message {
    text-align: center;
    padding: 1rem;
    color: #6c757d;
    font-size: 0.85rem;
}

/* ================================================================ */
/* COLLAPSIBLE FILTERS (Mobile Pattern)                              */
/* ================================================================ */

/* Primary filters row - always visible */
.feed-filters-primary {
    display: contents;  /* Desktop: items flow into parent flex */
}

/* Advanced filters - desktop: visible inline */
.feed-filters-advanced {
    display: contents;  /* Desktop: items flow into parent flex */
}

/* Advanced toggle button - hidden on desktop by default via d-sm-none */
.feed-advanced-toggle.active {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
}

/* ================================================================ */
/* RESPONSIVE                                                        */
/* ================================================================ */

@media (max-width: 576px) {
    /* Visibility legend - single row with gear */
    .feed-visibility-legend {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
        align-items: center;
    }

    .feed-visibility-legend .legend-items {
        display: flex;
        flex-wrap: wrap;
        gap: 0.75rem;
        align-items: center;
        width: 100%;
    }

    .feed-visibility-legend .settings-link {
        margin-left: auto;
    }

    /* Feed filters container */
    .feed-filters {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    /* Primary filters - row layout */
    .feed-filters-primary {
        display: flex;
        gap: 0.5rem;
        align-items: center;
    }

    .feed-filters-primary .form-select {
        flex: 1;
    }

    .feed-filters-primary .feed-advanced-toggle {
        flex-shrink: 0;
    }

    /* Advanced filters - hidden by default on mobile */
    .feed-filters-advanced {
        display: none;
        flex-direction: column;
        gap: 0.5rem;
        padding-top: 0.5rem;
        border-top: 1px solid #e9ecef;
        margin-top: 0.25rem;
    }

    .feed-filters-advanced.show {
        display: flex;
    }

    .feed-filters-advanced .form-select {
        width: 100%;
    }

    /* Feed items */
    .feed-item {
        padding: 0.5rem;
    }

    .feed-item-poster img {
        width: 40px;
        height: 60px;
    }

    .feed-item-visibility {
        width: 20px;
    }

    .feed-item-header {
        flex-direction: column;
        gap: 0.15rem;
    }

    .feed-item-time {
        font-size: 0.75rem;
    }
}

/* ================================================================ */
/* CLICKABLE ITEMS                                                   */
/* ================================================================ */

.feed-item-clickable {
    cursor: pointer;
}

.feed-item-clickable:hover {
    background-color: rgba(13, 110, 253, 0.08) !important;
    border-color: rgba(13, 110, 253, 0.3);
}

.click-hint {
    font-size: 0.75rem;
    color: #0d6efd;
    font-style: italic;
}

/* ================================================================ */
/* FACEOFF BATTLES                                                   */
/* ================================================================ */

.feed-item-faceoff {
    padding: 0.5rem;
}

.faceoff-battle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.faceoff-winner,
.faceoff-loser {
    position: relative;
    flex-shrink: 0;
}

.faceoff-winner img,
.faceoff-loser img {
    width: 50px;
    height: 75px;
    object-fit: cover;
    border-radius: 4px;
    transition: transform 0.2s;
}

.faceoff-winner img:hover,
.faceoff-loser img:hover {
    transform: scale(1.05);
}

.faceoff-winner img {
    border: 2px solid #ffc107;
    box-shadow: 0 0 8px rgba(255, 193, 7, 0.4);
}

.faceoff-result {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    background: #ffc107;
    color: #212529;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
}

.faceoff-vs {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.25rem;
}

.faceoff-vs .vs-text {
    font-size: 0.7rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
}

.faceoff-info {
    flex: 1;
    min-width: 0;
}

.faceoff-titles {
    font-size: 0.85rem;
    line-height: 1.3;
}

.faceoff-titles a {
    color: inherit;
    text-decoration: none;
}

.faceoff-titles a:hover {
    text-decoration: underline;
    color: #0d6efd;
}

.faceoff-titles .winner-title {
    font-weight: 600;
    color: #212529;
}

.faceoff-titles .beat-text {
    color: #6c757d;
    font-size: 0.75rem;
    margin: 0 0.25rem;
}

.faceoff-titles .loser-title {
    color: #495057;
}

/* ================================================================ */
/* RIYL (Recommend If You Like)                                      */
/* ================================================================ */

.feed-item-riyl {
    display: flex;
    align-items: stretch;
}

.riyl-layout {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 0.5rem;
}

.riyl-source,
.riyl-rec {
    text-align: center;
    flex-shrink: 0;
}

.riyl-source img,
.riyl-rec img {
    width: 50px;
    height: 75px;
    object-fit: cover;
    border-radius: 4px;
    transition: transform 0.2s;
}

.riyl-source img:hover,
.riyl-rec img:hover {
    transform: scale(1.05);
}

.riyl-source img {
    border: 2px solid #6c757d;
}

.riyl-rec img {
    border: 2px solid #0d6efd;
    box-shadow: 0 0 6px rgba(13, 110, 253, 0.3);
}

.riyl-label {
    font-size: 0.65rem;
    color: #6c757d;
    margin-top: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.riyl-arrow {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    color: #6c757d;
    font-size: 1.25rem;
}

.riyl-vote {
    font-size: 1rem;
}

.riyl-content {
    flex: 1;
    min-width: 0;
}

.riyl-rec-link {
    color: #6c757d;
    font-size: 0.85rem;
}

.riyl-rec-link a {
    color: #0d6efd;
    text-decoration: none;
}

.riyl-rec-link a:hover {
    text-decoration: underline;
}

/* ================================================================ */
/* SPORTS VIEWING                                                    */
/* ================================================================ */

.feed-item-sports {
    padding: 0.5rem;
}

.sports-matchup {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

.sports-team {
    display: flex;
    align-items: center;
    justify-content: center;
}

.sports-team .team-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    background: white;
    border-radius: 4px;
    padding: 2px;
}

.sports-team .team-placeholder {
    width: 40px;
    height: 40px;
    background: var(--mv-border-color);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: #495057;
}

.sports-vs {
    font-size: 0.7rem;
    color: #6c757d;
    font-weight: 500;
}

.league-badge {
    font-size: 0.75rem;
    color: #6c757d;
    background: rgba(0,0,0,0.05);
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
}

/* ================================================================ */
/* FEED EMPTY STATE - SPAN FULL GRID                                 */
/* ================================================================ */

.feed-empty {
    grid-column: 1 / -1;
}

.feed-end-message {
    grid-column: 1 / -1;
}

/* ================================================================ */
/* ACTIVITY SUMMARY PILLS (inline with filters)                      */
/* ================================================================ */

.feed-summary {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-left: auto;
    padding-left: 0.5rem;
}

.feed-summary-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.1rem 0.4rem;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: opacity 0.15s, box-shadow 0.15s;
}

.feed-summary-pill:hover {
    opacity: 0.8;
}

.feed-summary-pill.pill-active {
    box-shadow: 0 0 0 2px #0d6efd;
}

.feed-summary-pill i {
    font-size: 0.65rem;
}

/* Hide labels on mobile, show on large screens */
.feed-summary-pill .pill-label {
    display: none;
}

@media (min-width: 1200px) {
    .feed-summary-pill .pill-label {
        display: inline;
        font-weight: 500;
    }
}

.feed-summary-primary { background: rgba(13, 110, 253, 0.15); color: #0d6efd; }
.feed-summary-info { background: rgba(13, 202, 240, 0.15); color: #0dcaf0; }
.feed-summary-warning { background: rgba(255, 193, 7, 0.2); color: #997404; }
.feed-summary-orange { background: rgba(253, 126, 20, 0.15); color: #fd7e14; }
.feed-summary-purple { background: rgba(111, 66, 193, 0.15); color: #6f42c1; }
.feed-summary-danger { background: rgba(220, 53, 69, 0.15); color: #dc3545; }
.feed-summary-success { background: rgba(25, 135, 84, 0.15); color: #198754; }

/* ================================================================ */
/* SPORTS SCORE                                                      */
/* ================================================================ */

.sports-score {
    font-weight: 700;
    font-size: 0.85rem;
    color: #212529;
    background: rgba(255, 193, 7, 0.2);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
}

/* Wrapper for matchup + date */
.sports-matchup-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    margin-right: 0.5rem;
}

/* Game date displayed under the matchup */
.sports-game-date {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 0.25rem;
    white-space: nowrap;
    text-align: center;
}

/* League badge positioned at bottom left of card */
.feed-item-sports {
    position: relative;
}

.sports-league-badge {
    position: absolute;
    bottom: 4px;
    left: 4px;
}

.sports-league-badge .league-logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
    opacity: 0.8;
}

.sports-league-badge .league-abbr {
    font-size: 0.65rem;
    color: #adb5bd;
    font-weight: 600;
}

/* Center the vs section content */
.sports-vs {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* Team names displayed on separate rows */
.sports-team-names {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.sports-visitor-name,
.sports-home-name {
    font-size: 0.85rem;
    line-height: 1.2;
}

.sports-visitor-name {
    color: #495057;
}

.sports-home-name {
    color: #495057;
}

/* ================================================================ */
/* DARK MODE OVERRIDES                                               */
/* ================================================================ */

/* Visibility legend */
[data-bs-theme="dark"] .feed-visibility-legend {
    background: var(--mv-bg-surface);
}

/* Visibility row backgrounds - keep but darken */
[data-bs-theme="dark"] .feed-visibility-private {
    background-color: rgba(220, 53, 69, 0.15) !important;
}
[data-bs-theme="dark"] .feed-visibility-friends {
    background-color: rgba(255, 193, 7, 0.12) !important;
}
[data-bs-theme="dark"] .feed-visibility-public {
    background-color: rgba(25, 135, 84, 0.12) !important;
}

/* Filter labels */
[data-bs-theme="dark"] .feed-filters .filter-label {
    color: var(--mv-text-muted);
}

/* Feed items */
[data-bs-theme="dark"] .feed-item {
    border-color: var(--mv-border-light);
}

[data-bs-theme="dark"] .feed-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

[data-bs-theme="dark"] .feed-item-clickable:hover {
    background-color: var(--mv-bg-highlight) !important;
    border-color: rgba(13, 110, 253, 0.3);
}

/* Poster placeholders */
[data-bs-theme="dark"] .feed-item-poster img {
    background: var(--mv-bg-surface);
}

[data-bs-theme="dark"] .feed-item-poster .poster-placeholder,
[data-bs-theme="dark"] .feed-item-poster .game-placeholder {
    background: var(--mv-bg-surface);
    color: var(--mv-text-muted);
}

/* Text colors */
[data-bs-theme="dark"] .feed-item-title {
    color: var(--mv-text-primary);
}

[data-bs-theme="dark"] .feed-item-time,
[data-bs-theme="dark"] .feed-item-subtitle,
[data-bs-theme="dark"] .feed-item-meta,
[data-bs-theme="dark"] .feed-empty,
[data-bs-theme="dark"] .feed-end-message {
    color: var(--mv-text-muted);
}

[data-bs-theme="dark"] .feed-item-action {
    color: var(--mv-text-secondary);
}

/* Review excerpt */
[data-bs-theme="dark"] .feed-item-excerpt {
    color: var(--mv-text-secondary);
    background: rgba(255, 255, 255, 0.05);
}

[data-bs-theme="dark"] .feed-item-excerpt .read-more,
[data-bs-theme="dark"] .click-hint {
    color: var(--mv-text-link);
}

/* Advanced filters mobile border */
@media (max-width: 576px) {
    [data-bs-theme="dark"] .feed-filters-advanced {
        border-top-color: var(--mv-border-light);
    }
}

/* Faceoff */
[data-bs-theme="dark"] .faceoff-titles .winner-title {
    color: var(--mv-text-primary);
}

[data-bs-theme="dark"] .faceoff-titles .beat-text,
[data-bs-theme="dark"] .faceoff-vs .vs-text {
    color: var(--mv-text-muted);
}

[data-bs-theme="dark"] .faceoff-titles .loser-title {
    color: var(--mv-text-secondary);
}

/* RIYL */
[data-bs-theme="dark"] .riyl-label,
[data-bs-theme="dark"] .riyl-arrow,
[data-bs-theme="dark"] .riyl-rec-link {
    color: var(--mv-text-muted);
}

[data-bs-theme="dark"] .riyl-rec-link a {
    color: var(--mv-text-link);
}

/* Sports */
[data-bs-theme="dark"] .sports-team .team-logo {
    background: var(--mv-bg-surface);
}

[data-bs-theme="dark"] .sports-team .team-placeholder {
    background: var(--mv-bg-surface);
    color: var(--mv-text-muted);
}

[data-bs-theme="dark"] .sports-vs {
    color: var(--mv-text-muted);
}

[data-bs-theme="dark"] .league-badge {
    color: var(--mv-text-muted);
    background: rgba(255, 255, 255, 0.08);
}

[data-bs-theme="dark"] .sports-score {
    color: var(--mv-text-primary);
    background: rgba(255, 193, 7, 0.15);
}

[data-bs-theme="dark"] .sports-game-date {
    color: var(--mv-text-muted);
}

[data-bs-theme="dark"] .sports-visitor-name,
[data-bs-theme="dark"] .sports-home-name {
    color: var(--mv-text-secondary);
}

[data-bs-theme="dark"] .sports-league-badge .league-abbr {
    color: var(--mv-text-muted);
}
