/* assets/css/schedule-widget.css */
/* Dark theme, centered card, mobile-friendly platform row */

:root {
  --ap-accent: #2864d4;
  --ap-panel: #1a1a1a;
  --ap-text: #ffffff;
  --ap-dim: #aaaaaa;
  --ap-border: rgba(255, 255, 255, 0.08);
}

.ap-schedule {
  color: var(--ap-text);
  /* Center the whole panel */
  display: flex;
  justify-content: center;
  padding: 0 12px;
}

.ap-schedule .ap-card {
  background: var(--ap-panel);
  border-top: 6px solid var(--ap-accent);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 16px 32px rgba(0, 0, 0, .35);
  /* Responsive centered width */
  width: min(680px, 100%);
  max-width: 920px;
  margin: 0 auto;
}

/* Platforms bar */
#ap-platforms {
  display: block;
  margin-bottom: .6rem;
  text-align: center;
}

#ap-platforms .ap-prefix {
  color: var(--ap-dim);
  font-weight: 600;
  display: block;
  margin: 0 0 .25rem;
}

#ap-platforms .ap-plat-row {
  display: flex;
  flex-wrap: nowrap;
  white-space: nowrap;
  gap: .4rem;
  align-items: center;
  justify-content: center;

  /* Fallback: allow horizontal scroll if still too tight */
  overflow-x: auto;
  -ms-overflow-style: none;
  /* IE/Edge */
  scrollbar-width: none;
  /* Firefox */
}

#ap-platforms .ap-plat-row::-webkit-scrollbar {
  display: none;
}

#ap-platforms .ap-chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .25rem .5rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  text-decoration: none;
  color: var(--ap-text);
  font-weight: 600;
}

#ap-platforms .ap-chip:hover {
  background: rgba(255, 255, 255, .1);
}

#ap-platforms .ap-chip img {
  width: 20px;
  height: 20px;
  object-fit: cover;
  border-radius: 4px;
}

/* Next line */
#ap-next {
  font-size: clamp(1rem, 1.2vw + .7rem, 1.35rem);
  line-height: 1.5;
  margin: .2rem 0 .9rem;
  text-align: left;
}

/* New flex layout for next stream row */
#ap-next .ap-next-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

#ap-next .ap-next-text {
  flex: 1 1 auto;
  min-width: 0;
}

#ap-next .ap-when {
  font-weight: 800;
}

#ap-next .ap-in {
  margin-top: .25rem;
  color: var(--ap-dim);
}

#ap-next .ap-next-title {
  font-weight: 800;
}

#ap-next .ap-next-when {
  margin-top: .15rem;
  color: var(--ap-dim);
}

#ap-next .ap-next-game {
  display: inline-block;
  margin-top: .25rem;
  font-weight: 700;
  font-size: 1.15rem;
}

/* Game cover icon (generic helper) */
.ap-game-with-icon {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
}

/* Generic icon */
.ap-game-icon {
  height: 32px;
  width: auto;
  border-radius: 4px;
  object-fit: contain;
  flex-shrink: 0;
}

/* Bigger for top cover */
#ap-next .ap-next-cover .ap-game-icon {
  height: 84px;
  border-radius: 6px;
}

/* Right column container */
#ap-next .ap-next-cover {
  flex: 0 0 auto;
}


/* Button */
#ap-toggle {
  display: inline-block;
  width: 100%;
  background: var(--ap-accent);
  color: #fff;
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 800;
  letter-spacing: .2px;
  font-size: clamp(.95rem, .8vw + .6rem, 1.05rem);
  transition: filter .2s ease;
}

#ap-toggle:hover {
  filter: brightness(1.08);
}

/* List */
#ap-list {
  margin: .8rem 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--ap-border);
}

#ap-list .ap-li {
  padding: .6rem 0;
  border-bottom: 1px solid var(--ap-border);
}

/* Whole row: left text + right cover */
#ap-list .ap-li-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}

/* Main left column */
#ap-list .ap-li-main {
  flex: 1 1 auto;
  min-width: 0;
}

/* First line: date, time, estimation */
#ap-list .ap-li-topline {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: .4rem;    /* smaller gap between date and estimation */
  flex-wrap: wrap;
}

#ap-list .ap-li-when {
  font-weight: 800;
  white-space: nowrap;
}

#ap-list .ap-li-in {
  color: var(--ap-dim);
  white-space: nowrap;
  margin-left: .25rem;
}

/* Second line: game name */
#ap-list .ap-li-game {
  margin-top: .15rem;
  font-weight: 700;
  font-size: 1.05rem;   /* slightly larger than body text */
  opacity: .98;
}

/* Right column: big cover, right-aligned */
#ap-list .ap-li-right {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
}

#ap-list .ap-li-right .ap-game-icon {
  height: 64px;          /* bigger, like Discord list */
  width: auto;           /* preserve cover ratio */
  border-radius: 6px;
  object-fit: contain;
}

/* Note + error */
.ap-note {
  margin-top: .75rem;
  color: var(--ap-dim);
  font-size: .95rem;
}

#ap-error {
  color: #ff8080;
  margin-top: .5rem;
}

/* ---------- Mobile tweaks ---------- */
@media (max-width: 520px) {
  .ap-schedule .ap-card {
    border-radius: 14px;
    padding: 14px;
  }

  #ap-toggle {
    border-radius: 12px;
  }

  /* Let platform chips wrap to two lines and tighten spacing */
  #ap-platforms .ap-plat-row {
    flex-wrap: wrap;
    row-gap: .35rem;
  }

  #ap-platforms .ap-chip {
    padding: .2rem .45rem;
    font-size: .95rem;
  }

  #ap-platforms .ap-chip img {
    width: 18px;
    height: 18px;
  }

  /* Base icon size on mobile */
  .ap-game-icon {
    height: 40px;
  }

  /* Same large covers for top + list on mobile */
  #ap-list .ap-li-right .ap-game-icon,
  #ap-list .ap-li-right .ap-game-icon,
  #ap-next .ap-next-cover .ap-game-icon {
    height: 72px;
  }
}

/* Even tighter for very small phones */
@media (max-width: 360px) {
  #ap-platforms .ap-chip {
    padding: .18rem .4rem;
    font-size: .9rem;
  }

  #ap-platforms .ap-chip img {
    width: 16px;
    height: 16px;
  }

  .ap-game-icon {
    height: 36px;
  }

  #ap-list .ap-li-right .ap-game-icon,
  #ap-list .ap-li-right .ap-game-icon,
  #ap-next .ap-next-cover .ap-game-icon {
    height: 58px;
  }
}


/* === AngeloPab Glass Card with Rotating Background Rectangle (full panel) === */
.ap-schedule .ap-card {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  padding: 18px;
  border-top: 6px solid var(--ap-accent);
  /* glass + tint */
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(8, 10, 16, 0.78);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.55);
  /* keep your responsive behavior */
  width: min(680px, 100%);
  max-width: 920px;
  margin: 0 auto;
  transform: translateY(0);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

/* rotating gradient rectangle behind the glass card */
.ap-schedule .ap-card::before {
  content: "";
  position: absolute;
  inset: -30%;
  background: linear-gradient(135deg,
      #2f73ff,
      #9c5bff,
      #ff4f8b,
      #ff7a00);
  transform-origin: center;
  animation: ap-bg-rotate 28s linear infinite;
  z-index: -2;
}

/* dark overlay to keep content readable */
.ap-schedule .ap-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(to bottom,
      rgba(8, 10, 16, 0.85),
      rgba(8, 10, 16, 0.95));
  z-index: -1;
}

@keyframes ap-bg-rotate {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* Calendar icon for each expanded schedule row */
#ap-list .ap-li-when {
  position: relative;
  padding-left: 1.4rem; /* space for the emoji */
  font-weight: 800;
  white-space: nowrap;
}

#ap-list .ap-li-when::before {
  content: "📅";
  position: absolute;
  left: 0;
  top: 0;
}
