/**
 * idx-personal-sidebar.css
 * Your Corner - personal sidebar for index.html (landing)
 * Shows live matches, upcoming, recent scores, my stats
 */

/* Main layout: grid for predictable two-column desktop, single column mobile */
.idx-personal-sidebar-wrap {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 1.5rem;
  align-items: start;
}

.idx-personal-sidebar-wrap .idx-main-content {
  min-width: 0;
}

@media (max-width: 1199px) {
  .idx-personal-sidebar-wrap {
    grid-template-columns: 1fr;
  }

  .idx-personal-sidebar-wrap #idx-personal-sidebar {
    padding-top: 0;
    padding-bottom: 0;
    max-height: none;
    display: flex;
    flex-direction: column;
    overflow: visible;
  }

  #idx-personal-sidebar .idx-ps-collapse-btn {
    display: flex !important;
    width: 100%;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    background: var(--idx-surface-alt, #262626);
    border: none;
    border-radius: 6px 6px 0 0;
    color: var(--idx-fg, #fff);
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
  }

  #idx-personal-sidebar .idx-ps-collapse-btn:hover {
    background: var(--idx-muted, #333);
  }

  #idx-personal-sidebar .idx-ps-collapse-icon {
    transition: transform 0.2s ease;
  }

  #idx-personal-sidebar.idx-ps-collapsed .idx-ps-collapse-icon {
    transform: rotate(-90deg);
  }

  #idx-personal-sidebar #idx-personal-sidebar-body {
    flex: 0 1 auto;
    min-height: 0;
    max-height: 40vh;
    overflow-y: auto;
    padding: 0.75rem 1rem 1rem;
  }

  #idx-personal-sidebar.idx-ps-collapsed #idx-personal-sidebar-body {
    display: none;
  }

  #idx-personal-sidebar.idx-ps-collapsed {
    max-height: none;
    min-height: 0;
  }

  /* Compact when empty or minimal content */
  #idx-personal-sidebar.idx-ps-slim {
    padding: 0.5rem 1rem;
    max-height: 35vh;
  }

  #idx-personal-sidebar.idx-ps-slim .idx-ps-header {
    margin-bottom: 0.25rem;
    font-size: 1rem;
  }

  #idx-personal-sidebar.idx-ps-slim .idx-ps-empty {
    padding: 0.25rem 0;
    font-size: 0.85rem;
  }

  #idx-personal-sidebar.idx-ps-slim .idx-ps-empty p {
    margin-bottom: 0.25rem;
  }
}

/* Sidebar panel */
#idx-personal-sidebar {
  background: var(--idx-surface, #1a1a1a);
  border-radius: 8px;
  border: 1px solid var(--idx-border, #2a2a2a);
  padding: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  flex-shrink: 0;
}

#idx-personal-sidebar.d-none {
  display: none !important;
}

/* Header */
.idx-ps-header {
  font-family: 'Oswald', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--espn-red, #e31837);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--idx-border, #2a2a2a);
}

/* Loading state */
.idx-ps-loading {
  color: var(--idx-muted, #999);
  font-size: 0.9rem;
  padding: 0.5rem 0;
}

.idx-ps-loading .fa-spinner {
  margin-right: 0.5rem;
}

.idx-ps-loading .fa-spinner.fa-spin {
  color: var(--espn-red, #e31837);
}

/* Block sections */
.idx-ps-block {
  margin-bottom: 1rem;
}

.idx-ps-block:last-child {
  margin-bottom: 0;
}

.idx-ps-block-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--idx-muted, #999);
  margin-bottom: 0.5rem;
}

.idx-ps-block-title .fa {
  margin-right: 0.35rem;
  opacity: 0.9;
}

/* Live Now items */
.idx-ps-live-item {
  display: block;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--idx-border, #2a2a2a);
  color: var(--idx-fg, #fff);
  text-decoration: none;
  transition: background 0.15s ease;
}

.idx-ps-live-item:last-child {
  border-bottom: none;
}

.idx-ps-live-item:hover {
  background: var(--idx-surface-alt, #262626);
  color: var(--idx-fg, #fff);
}

.idx-ps-live-teams {
  font-weight: 600;
  font-size: 0.9rem;
}

.idx-ps-live-score {
  color: var(--espn-red, #e31837);
  font-weight: 700;
}

.idx-ps-live-item small {
  color: var(--idx-muted, #999);
  font-size: 0.8rem;
}

/* YOU badge - when user is playing */
.idx-ps-my-badge {
  display: inline-block;
  background: var(--espn-red, #e31837);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  margin-right: 0.35rem;
}

/* Fave badge - favorite team/player (not user's own) */
.idx-ps-fave-badge {
  display: inline-block;
  color: var(--espn-red, #e31837);
  font-size: 0.9rem;
  margin-right: 0.25rem;
}

/* Upcoming items */
.idx-ps-upcoming-item {
  display: block;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--idx-border, #2a2a2a);
  color: var(--idx-fg, #fff);
  text-decoration: none;
  font-size: 0.9rem;
}

.idx-ps-upcoming-item:last-child {
  border-bottom: none;
}

.idx-ps-upcoming-item:hover {
  color: var(--espn-red, #e31837);
}

.idx-ps-upcoming-label {
  font-weight: 600;
}

.idx-ps-upcoming-date {
  color: var(--idx-muted, #999);
  font-size: 0.85rem;
}

.idx-ps-live-badge {
  font-size: 0.7rem;
  color: var(--espn-red, #e31837);
  font-weight: 600;
}

/* Recent scores */
.idx-ps-score-item {
  display: block;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--idx-border, #2a2a2a);
  font-size: 0.9rem;
  color: var(--idx-fg, #fff);
  text-decoration: none;
}

.idx-ps-score-item:last-child {
  border-bottom: none;
}

.idx-ps-score-item.idx-ps-score-link:hover {
  color: var(--espn-red, #e31837);
}

.idx-ps-score-wl {
  color: var(--espn-red, #e31837);
  font-weight: 600;
}

.idx-ps-score-item small {
  color: var(--idx-muted, #999);
}

/* My Stats link */
.idx-ps-mystats-link {
  display: inline-block;
  color: var(--espn-red, #e31837);
  font-weight: 600;
  font-size: 0.9rem;
}

.idx-ps-mystats-link:hover {
  text-decoration: underline;
}

/* Empty state */
.idx-ps-empty {
  padding: 0.5rem 0;
  color: var(--idx-muted, #999);
  font-size: 0.9rem;
}

.idx-ps-empty p {
  margin-bottom: 0.5rem;
}

.idx-ps-empty a {
  color: var(--espn-red, #e31837);
}

.idx-ps-empty a:hover {
  text-decoration: underline;
}

/* Per-section empty line under a block title */
.idx-ps-section-empty {
  padding: 0.25rem 0 0.35rem;
  margin: 0;
  color: var(--idx-muted, #999);
  font-size: 0.85rem;
  line-height: 1.35;
}

/* Pool News RSS items - headlines with optional thumbnails */
.idx-ps-rss-item {
  display: block;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--idx-border, #2a2a2a);
  color: var(--idx-fg, #fff);
  text-decoration: none;
  font-size: 0.85rem;
  line-height: 1.3;
}

.idx-ps-rss-item:last-child {
  border-bottom: none;
}

.idx-ps-rss-item:hover {
  color: var(--idx-fg, #fff);
}

.idx-ps-rss-item:hover .idx-ps-rss-headline {
  color: var(--espn-red, #e31837);
}

.idx-ps-rss-has-img {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

/* Thumbnail column: image with date directly beneath */
.idx-ps-rss-img-col {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  width: 56px;
}

.idx-ps-rss-img-col .idx-ps-rss-date {
  text-align: center;
  max-width: 100%;
  line-height: 1.15;
  white-space: nowrap;
}

.idx-ps-rss-img {
  flex-shrink: 0;
  width: 56px;
  height: 42px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--idx-surface-alt, #262626);
}

.idx-ps-rss-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.idx-ps-rss-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.idx-ps-rss-item:not(.idx-ps-rss-has-img) .idx-ps-rss-body {
  width: 100%;
}

.idx-ps-rss-headline {
  display: block;
  min-width: 0;
}

.idx-ps-rss-date {
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--idx-muted, #999);
  line-height: 1.2;
  letter-spacing: 0.01em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Admin-configurable support / promo (Chalksta newsfeed config) */
.idx-ps-rss-ads {
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--idx-muted, #999);
  padding: 0.35rem 0 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.idx-ps-rss-ads.idx-ps-rss-ads-after {
  border-bottom: none;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 0.5rem;
  margin-top: 0.25rem;
}

.idx-ps-support-msg a.idx-ps-support-link {
  display: inline-block;
  margin-top: 0.25rem;
  color: var(--espn-red, #e31837);
  font-size: 0.75rem;
}
