/* Modern VGP Styles */
:root {
  --bg-color: #050505;
  --text-color: #f0f0f0;
  --accent-color: #ffffff;
  --glass-bg: rgba(20, 20, 20, 0.4);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-blur: blur(12px);
  --dock-bg: rgba(10, 10, 10, 0.6);
  --btn-hover: rgba(255, 255, 255, 0.15);
  --font-main: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

body {
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  background-color: var(--bg-color);
  color: var(--text-color);
  min-height: 100vh;
  font-family: var(--font-main);
  overflow: hidden;
  transition: background-color 0.3s ease;
}

body.dragging {
  background-color: #1a1a1a;
}

/* Typography & Instructions */
#drag-instructions {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
  transition: opacity 0.5s ease;
  z-index: 10;
}

#drag-instructions h1 {
  font-weight: 200;
  font-size: 3rem;
  letter-spacing: 0.2rem;
  margin-bottom: 1rem;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.8);
}

#drag-instructions p {
  font-weight: 300;
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 2rem;
}

.shortcuts {
  display: flex;
  gap: 2rem;
  justify-content: center;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.3);
}

.shortcuts span {
  padding: 0.5rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

/* Video Container */
.video-container {
  position: relative;
  overflow: hidden;
  background: black;
  transition: width 0.3s ease, height 0.3s ease;
}

video {
  width: 100%;
  height: 100%;
  display: block;
  /* object-fit handled by JS toggle */
}

/* Close Button (Video) */
.close-button {
  position: absolute;
  top: 15px;
  left: 15px;
  /* Always on left */
  right: auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.3s ease, background 0.2s, transform 0.2s;
  z-index: 20;
}

.video-container:hover .close-button {
  opacity: 1;
}

.close-button:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

/* Smart Position for Right Edge - REMOVED (Always Left) */
/* .video-container.right-edge .close-button {
  right: auto;
  left: 15px;
} */

/* Dragging Reorder Styles */
.video-container.dragging-item {
  opacity: 0.5;
  border: 2px dashed rgba(255, 255, 255, 0.3);
  transform: scale(0.95);
}

.video-container.drag-over {
  border: 2px solid var(--accent-color);
  transform: scale(1.02);
}

/* Dock */
#dock {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--dock-bg);
  backdrop-filter: var(--glass-blur);
  padding: 15px 10px;
  border-radius: 16px;
  border: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  gap: 15px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  z-index: 100;
  transition: opacity 0.5s ease;
}

#dock button {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.5rem;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s ease;
  padding: 8px;
  /* Add padding for SVGs */
}

#dock button svg {
  width: 100%;
  height: 100%;
}

#dock button:hover {
  color: #fff;
  background: var(--btn-hover);
  transform: scale(1.1);
}

/* Vertical Slider */
.slider-container {
  height: 100px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 10px 0;
}

#volumeSlider {
  writing-mode: vertical-lr;
  /* Vertical slider */
  -webkit-appearance: none;
  appearance: none;
  width: 6px;
  height: 100%;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
  transform: rotate(180deg);
}

#volumeSlider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
  transition: box-shadow 0.2s;
}

#volumeSlider::-webkit-slider-thumb:hover {
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.8);
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease;
}

/* Modal Content */
.modal-content {
  background: rgba(20, 20, 20, 0.95);
  border: 1px solid var(--glass-border);
  padding: 40px;
  border-radius: 16px;
  text-align: center;
  position: relative;
  min-width: 300px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  animation: scaleUp 0.3s ease;
}

.modal-content h3 {
  margin-top: 0;
  font-weight: 400;
  letter-spacing: 1px;
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  font-size: 1.2rem;
  transition: color 0.2s;
}

.modal-close:hover {
  color: #fff;
}

.modal-select {
  width: 100%;
  padding: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  border-radius: 6px;
  font-size: 1rem;
  outline: none;
  cursor: pointer;
}

.modal-select:focus {
  border-color: rgba(255, 255, 255, 0.3);
}

.modal-select option {
  background: #111;
  color: #fff;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes scaleUp {
  from {
    transform: scale(0.95);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Custom Video Controls overlay */
.video-controls {
  position: absolute;
  bottom: 15px;
  left: 15px;
  right: 15px;
  background: var(--dock-bg);
  backdrop-filter: var(--glass-blur);
  padding: 8px 15px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 15px;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  border: 1px solid var(--glass-border);
  z-index: 20;
  transform: translateY(10px);
}

.video-container:hover .video-controls {
  opacity: 1;
  transform: translateY(0);
}

.control-btn {
  background: transparent;
  border: none;
  color: white;
  font-size: 1.1rem;
  cursor: pointer;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  transition: transform 0.2s;
}

.control-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.control-btn:hover {
  transform: scale(1.1);
  color: var(--accent-color);
}

.video-progress {
  flex-grow: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 2px;
  /* Slimmer */
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  cursor: pointer;
  background-image: linear-gradient(#fff, #fff);
  background-repeat: no-repeat;
  background-size: 0% 100%;
  transform: none;
  writing-mode: horizontal-tb;
  transition: height 0.2s;
}

.video-progress:hover {
  height: 4px;
}

.video-progress::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 10px;
  width: 10px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  transition: transform 0.2s;
  /* Remove opacity:0 to ensure visibility */
}

.video-progress::-webkit-slider-thumb:hover {
  transform: scale(1.3);
}

/* Integrated Volume Control */
.volume-container {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.1);
  padding: 0 10px 0 5px;
  border-radius: 20px;
  height: 30px;
  transition: background 0.2s;
}

.volume-container:hover {
  background: rgba(255, 255, 255, 0.2);
}

.volume-btn {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  /* Ensure white */
}

/* Override previous popup styles */
.volume-slider {
  appearance: none;
  -webkit-appearance: none;
  width: 120px;
  /* Longer as requested */
  height: 2px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  cursor: pointer;
  outline: none;
  /* Use standard horizontal layout */
  writing-mode: horizontal-tb;
  transform: none;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: white;
  cursor: pointer;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
  transition: transform 0.2s;
}

.volume-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* Icons White */
.control-btn {
  color: white !important;
}

.control-btn svg {
  fill: white !important;
}

/* Close All Button specific styling */
.close-all-btn:hover {
  background: rgba(255, 50, 50, 0.3) !important;
  color: #ff5555 !important;
}

/* Dock Separator */
.dock-separator {
  width: 20px;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 5px auto;
}



/* Save/Load Group in Dock */
.save-load-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 5px;
}

/* Inline Save Container */
.save-inline-container {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 15px;
}

.save-inline-container .modal-input {
  flex: 2;
  margin-bottom: 0 !important;
  /* Override inline styles if any */
}

.save-inline-container .modal-action-btn {
  flex: 1;
  margin-top: 0;
  width: auto;
  padding: 12px 20px;
  white-space: nowrap;
}

/* Modal Inputs */
.modal-input {
  width: 100%;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: white;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

.modal-input:focus {
  border-color: rgba(255, 255, 255, 0.3);
}

.modal-action-btn {
  width: 100%;
  margin-top: 15px;
  padding: 12px;
  background: white;
  color: black;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.1s, background 0.2s;
}

.modal-action-btn:hover {
  background: #e0e0e0;
  transform: scale(1.02);
}

/* Load Modal - Wider */
.load-modal-content {
  width: 500px;
  max-width: 90vw;
  text-align: left;
}

.load-modal-content h3 {
  text-align: center;
}

/* Tag Pills */
.tags-header {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 15px;
  scrollbar-width: thin;
  white-space: nowrap;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tag-pill {
  padding: 5px 12px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}

.tag-pill:hover {
  background: rgba(255, 255, 255, 0.2);
}

.tag-pill.active {
  background: white;
  color: black;
}



/* Session List */
.session-list {
  max-height: 300px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.session-item {
  background: rgba(255, 255, 255, 0.05);
  padding: 15px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
  border: 1px solid transparent;
}

.session-item:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.1);
}

.tiny-tag {
  display: inline-block;
  padding: 2px 6px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  font-size: 0.7rem;
  margin-right: 5px;
  opacity: 0.8;
}