/* ─── Papers side panel ─── */
#panel-overlay {
  position: fixed;
  top: 60px;
  right: 0;
  bottom: 0;
  width: 300px;
  max-width: 90vw;
  background: rgba(19, 41, 75, 0.6);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-left: 1px solid rgba(44, 78, 138, 0.4);
  z-index: 500;
  transform: translateX(100%);
  transition: transform .35s cubic-bezier(.4, 1, .2, 1);
  display: flex;
  flex-direction: column;
  box-shadow: -6px 0 30px rgba(0, 0, 0, .35);
}

#panel-overlay.open {
  transform: translateX(0);
}

#panel-header {
  padding: 12px 14px 10px;
  border-bottom: 1px solid rgba(44, 78, 138, 0.4);
  flex-shrink: 0;
}

#panel-header h2 {
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

#panel-header h2 .room-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--teal));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  color: #fff;
}

#panel-header .meta {
  font-size: .75rem;
  color: var(--text-dim);
  margin-top: 4px;
}

#panel-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all .2s;
}

#panel-close:hover {
  background: var(--border);
  color: var(--text);
}

/* Day filter pills */
#day-filters {
  display: flex;
  gap: 4px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  flex-shrink: 0;
}

.day-pill {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: .7rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  transition: all .2s;
}

.day-pill:hover {
  border-color: var(--accent-2);
  color: var(--accent-2);
}

.day-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Paper list */
#paper-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
}

#paper-list::-webkit-scrollbar {
  width: 6px;
}

#paper-list::-webkit-scrollbar-track {
  background: transparent;
}

#paper-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.paper-card {
  padding: 10px 12px;
  margin-bottom: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all .2s;
  position: relative;
}

.paper-card:hover {
  border-color: var(--accent);
  background: #1f2338;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .3);
}

.paper-card .paper-time {
  font-size: .6rem;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 3px;
  letter-spacing: .3px;
}

.paper-card .paper-title {
  font-size: .72rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 4px;
}

.paper-card .paper-authors {
  font-size: .62rem;
  color: var(--text-dim);
  line-height: 1.4;
}

.paper-card .paper-domain {
  display: inline-block;
  margin-top: 6px;
  font-size: .6rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(255, 95, 5, .15);
  color: var(--accent-2);
}

.paper-card .paper-award {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: .85rem;
}

/* ─── Add-to-book button on paper cards ─── */
.paper-card-add-btn {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 95, 5, .4);
  background: rgba(255, 95, 5, .1);
  color: var(--accent);
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .18s;
  opacity: 0;
  pointer-events: none;
  line-height: 1;
}
.paper-card:hover .paper-card-add-btn,
.paper-card-add-btn.added {
  opacity: 1;
  pointer-events: all;
}
.paper-card-add-btn:hover {
  background: rgba(255, 95, 5, .25);
  border-color: var(--accent);
  transform: scale(1.15);
}
.paper-card-add-btn.added {
  background: rgba(40, 180, 80, .2);
  border-color: rgba(40, 180, 80, .5);
  color: #4ade80;
  pointer-events: none;
}

/* ─── Conflict highlight on Calendar Book cards ─── */
.ride-slot-card.book-conflict {
  animation: book-conflict-pulse 1.5s ease-in-out 3;
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
@keyframes book-conflict-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(252, 179, 22, .2); }
  50%      { box-shadow: 0 0 0 8px rgba(252, 179, 22, .35), 0 0 20px rgba(252, 179, 22, .2); }
}

/* ─── Conflict banner in book panel ─── */
.book-conflict-banner {
  background: rgba(252, 179, 22, .12);
  border: 1px solid rgba(252, 179, 22, .35);
  border-radius: 8px;
  padding: 8px 14px;
  margin-bottom: 10px;
  font-size: .72rem;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ─── Grouped / archived paper slots ─── */
.ride-slot-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-left: 2px solid rgba(255, 255, 255, .08);
  padding-left: 0;
  border-radius: 2px;
}
.ride-slot-group > .ride-slot:first-child {
  /* attending paper — no extra indent */
}
.ride-slot.archived-slot {
  margin-left: 132px;  /* 96px time + 12px gap + 24px extra indent */
  opacity: .72;
  transition: opacity .2s;
}
.ride-slot.archived-slot:hover {
  opacity: 1;
}
.ride-slot-card.archived-card {
  border-left-color: rgba(255, 255, 255, .18) !important;
  background: rgba(255, 255, 255, .03);
  border-color: rgba(255, 255, 255, .1);
}
.ride-slot-card.archived-card:hover {
  background: rgba(255, 255, 255, .06);
}
.ride-slot-card.archived-card .ride-slot-title {
  font-size: .68rem;
}
.archived-badge {
  font-size: .55rem;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, .08);
  color: var(--text-dim);
  white-space: nowrap;
}
.promote-btn {
  font-size: .55rem;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid rgba(255, 95, 5, .3);
  background: rgba(255, 95, 5, .08);
  color: var(--accent);
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  white-space: nowrap;
  transition: all .15s;
  margin-left: auto;
}
.promote-btn:hover {
  background: rgba(255, 95, 5, .2);
  border-color: var(--accent);
}
