/* ==========================================================================
   Carousel Groups & Double Buffering Styles
   ========================================================================== */

.saved-groups-deck {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.saved-group-card {
  background: rgba(14, 21, 46, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.saved-group-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 159, 67, 0.4);
  box-shadow: 0 8px 24px rgba(255, 159, 67, 0.15), inset 0 0 10px rgba(255, 159, 67, 0.05);
}

.saved-group-card.playing {
  border-color: var(--primary);
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.25);
  background: rgba(0, 242, 254, 0.05);
}

.group-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  width: 100%;
}

.group-title-area {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.group-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  line-height: 1.4;
  word-break: break-all;
}

.group-spec {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 4px;
}

.group-spec-badge {
  background: rgba(255, 255, 255, 0.05);
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  font-family: var(--font-mono);
}

.group-spec-badge.interval {
  color: var(--amber);
  border-color: rgba(255, 159, 67, 0.25);
  background: rgba(255, 159, 67, 0.05);
}

.group-route-visual {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 6px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.route-step {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 8px;
  border-radius: 4px;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-arrow {
  color: rgba(255, 255, 255, 0.25);
  font-size: 10px;
}

.group-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.3);
  font-family: var(--font-mono);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 8px;
}

/* Double-buffered Viewport */
.carousel-walls-viewport {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  border-radius: 6px;
  background: #000;
}

.carousel-wall-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  z-index: 1;
  pointer-events: none;
  transition: opacity 0.5s ease-in-out;
  display: flex;
  flex-direction: column;
}

.carousel-wall-wrapper.active {
  opacity: 1;
  z-index: 10;
  pointer-events: auto;
}

/* Playback Control Bar */
.carousel-control-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(7, 11, 25, 0.85) !important;
  border: 1px solid rgba(0, 242, 254, 0.25) !important;
  box-shadow: 0 4px 20px rgba(0, 242, 254, 0.15) !important;
  border-radius: 4px;
  padding: 4px 12px;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 6px;
  position: relative;
  overflow: hidden;
}

.carousel-control-bar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--primary);
  box-shadow: 0 0 8px var(--primary-glow);
}

.carousel-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.carousel-status-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
}

.carousel-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 8px var(--primary-glow);
  animation: pulse-live 1.5s infinite alternate;
}

.carousel-status-dot.paused {
  background: var(--amber);
  box-shadow: 0 0 8px rgba(255, 159, 67, 0.6);
  animation: none;
}

.carousel-title {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}

.carousel-title .active-panel-desc {
  color: var(--primary);
  margin-left: 6px;
  font-weight: 600;
}

.carousel-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.carousel-nav-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  padding: 0;
}

.carousel-nav-btn:hover {
  background: rgba(0, 242, 254, 0.15);
  border-color: var(--primary);
  color: var(--primary);
  transform: scale(1.05);
}

.carousel-nav-btn.pause {
  background: rgba(255, 159, 67, 0.1);
  border-color: rgba(255, 159, 67, 0.3);
  color: var(--amber);
}

.carousel-nav-btn.pause:hover {
  background: rgba(255, 159, 67, 0.25);
  border-color: var(--amber);
  color: #fff;
}

.carousel-nav-btn.stop {
  background: rgba(255, 71, 87, 0.1);
  border-color: rgba(255, 71, 87, 0.3);
  color: var(--red);
  width: auto;
  height: 24px;
  border-radius: 4px;
  padding: 0 10px;
  font-size: 10px;
  font-weight: 600;
}

.carousel-nav-btn.stop:hover {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  box-shadow: 0 0 10px rgba(255, 71, 87, 0.4);
}

.carousel-timer-badge {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  height: 24px;
  padding: 0 8px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 76px;
  justify-content: center;
  box-sizing: border-box;
}

.carousel-timer-badge.preload-alert {
  color: var(--amber);
  border-color: rgba(255, 159, 67, 0.3);
  text-shadow: 0 0 5px rgba(255, 159, 67, 0.4);
}

/* Progress bar inside control bar */
.carousel-progress-track {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: rgba(255, 255, 255, 0.05);
}

.carousel-progress-bar {
  height: 100%;
  background: var(--primary);
  box-shadow: 0 0 8px var(--primary-glow);
  transition: width 1s linear;
}

/* Modal Form Styles */
.modal-columns {
  display: flex;
  gap: 20px;
  height: 280px;
  margin-top: 4px;
}

.modal-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 10px;
  box-sizing: border-box;
}

.column-header {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 6px;
  margin-bottom: 2px;
}

.column-body {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 4px;
}

.column-body::-webkit-scrollbar {
  width: 4px;
}
.column-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
}

.panel-select-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  padding: 6px 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.panel-select-item:hover {
  background: rgba(0, 242, 254, 0.08);
  border-color: rgba(0, 242, 254, 0.25);
}

.panel-select-name {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 140px;
}

.panel-select-btn {
  background: transparent;
  border: none;
  color: var(--primary);
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  padding: 0 4px;
}

.panel-order-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 242, 254, 0.05);
  border: 1px solid rgba(0, 242, 254, 0.15);
  border-radius: 4px;
  padding: 6px 10px;
  box-sizing: border-box;
}

.panel-order-name {
  font-size: 12px;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 110px;
}

.panel-order-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.panel-order-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  font-size: 11px;
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.panel-order-btn:hover {
  color: #fff;
}

.panel-order-btn.remove {
  color: rgba(255, 71, 87, 0.7);
  margin-left: 2px;
}

.panel-order-btn.remove:hover {
  color: #ff4757;
}

.empty-column-state {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: rgba(255, 255, 255, 0.2);
  font-size: 11px;
  text-align: center;
  padding: 20px;
  line-height: 1.5;
}


