@import url("./css/base.css?v=20260708-mask-ui1");
@import url("./css/control-panel.css?v=20260708-collapsed-slider2");
@import url("./css/camera-overlay.css");
@import url("./css/content-area.css?v=20260701-caption1");
@import url("./css/modal.css");
@import url("./css/cursor-effects.css");
@import url("./css/responsive.css?v=20260704-mask-promised1");
@import url("./css/popup-display.css?v=20260728-effectsound1");

/* @tweakable media upload styling for main content loading */
.media-upload-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.media-info-display {
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(5px);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* @tweakable enhanced media control hiding styles */
.media-controls-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.control-panel.collapsed .media-upload-group,
.control-panel.collapsed .media-controls-options,
.control-panel.collapsed .audio-volume-controls {
  display: none;
}

/* @tweakable complete media control suppression when controls are hidden */
video[controls="false"],
audio[controls="false"] {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

video[controls="false"]::-webkit-media-controls,
audio[controls="false"]::-webkit-media-controls {
  display: none !important;
}

video[controls="false"]::-webkit-media-controls-enclosure,
audio[controls="false"]::-webkit-media-controls-enclosure {
  display: none !important;
}

video[controls="false"]::-webkit-media-controls-panel,
audio[controls="false"]::-webkit-media-controls-panel {
  display: none !important;
}

/* @tweakable disable all webkit media control elements */
video[controls="false"]::-webkit-media-controls-play-button,
video[controls="false"]::-webkit-media-controls-pause-button,
video[controls="false"]::-webkit-media-controls-seek-back-button,
video[controls="false"]::-webkit-media-controls-seek-forward-button,
video[controls="false"]::-webkit-media-controls-fullscreen-button,
video[controls="false"]::-webkit-media-controls-timeline,
video[controls="false"]::-webkit-media-controls-time-remaining-display,
video[controls="false"]::-webkit-media-controls-current-time-display,
video[controls="false"]::-webkit-media-controls-mute-button,
video[controls="false"]::-webkit-media-controls-volume-slider {
  display: none !important;
}

audio[controls="false"]::-webkit-media-controls-play-button,
audio[controls="false"]::-webkit-media-controls-pause-button,
audio[controls="false"]::-webkit-media-controls-timeline,
audio[controls="false"]::-webkit-media-controls-time-remaining-display,
audio[controls="false"]::-webkit-media-controls-current-time-display,
audio[controls="false"]::-webkit-media-controls-mute-button,
audio[controls="false"]::-webkit-media-controls-volume-slider {
  display: none !important;
}

/* Simple Iframe Recording Styles */
.iframe-recording-container {
  width: 100%;
  background: #000;
  border-radius: 8px;
  position: relative;
  padding-top: 45px;
  margin-top: 5px;
}

.iframe-recording-container video {
  width: 100%;
  height: auto;
  display: block;
  background: #000;
}

/* Video Controls Overlay - positioned above video */
.video-controls-overlay {
  position: absolute;
  top: -40px;
  right: 10px;
  display: flex;
  gap: 8px;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.9);
  border-radius: 6px;
  padding: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Video Control Buttons */
.video-control-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.video-control-btn:hover {
  opacity: 0.8;
  transform: scale(1.05);
}

.video-control-btn.close-btn {
  background: rgba(220, 53, 69, 0.9);
  color: white;
  font-size: 18px;
}

.video-control-btn.save-btn {
  background: rgba(46, 125, 50, 0.9);
  color: white;
  font-size: 14px;
}

.video-control-btn.save-close-btn {
  background: rgba(156, 39, 176, 0.9);
  color: white;
  font-size: 12px;
  width: 42px;
  font-weight: bold;
}

.video-control-btn.save-close-btn:hover {
  background: rgba(156, 39, 176, 1);
}

/* Active Display Save Button Styles */
.active-item-save {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(46, 125, 50, 0.9);
  color: white;
  border: none;
  border-radius: 4px;
  width: 27px;
  height: 27px;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.active-item-save:hover {
  background: rgba(46, 125, 50, 1);
  transform: scale(1.1);
}

.active-item-close {
  position: absolute;
  top: 2px;
  right: 31px;
  background: rgba(220, 20, 60, 0.9);
  color: white;
  border: none;
  border-radius: 4px;
  width: 27px;
  height: 27px;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  font-weight: bold;
}

.active-item-close:hover {
  background: rgba(220, 20, 60, 1);
  transform: scale(1.1);
}

/* Floating Recording Controls */
#iframe-recording-controls {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  pointer-events: auto;
}

#main-recording-controls {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  pointer-events: auto;
}

.recording-control-panel {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #4caf50 0%, #45a049 50%, #2e7d32 100%);
  border: none;
  border-radius: 25px;
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
  backdrop-filter: blur(10px);
}

.recording-control-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 18px;
  padding: 8px 12px;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  min-width: 36px;
  height: 36px;
  font-weight: 600;
}

.recording-control-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.control-icon {
  font-size: 16px;
  line-height: 1;
}

.recording-status {
  color: white;
  font-weight: 600;
  font-size: 14px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  margin-left: 8px;
}

@keyframes pulse {
  from {
    opacity: 0.8;
  }
  to {
    opacity: 1;
  }
}

/* 🎵 Audio Volume Controls - Simplified */
.audio-volume-controls {
  margin-top: 15px;
}

.audio-volume-controls h4 {
  margin: 15px 0 10px 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  font-weight: 600;
}

.audio-volume-controls label {
  display: block;
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 13px;
  font-weight: 500;
}

.audio-volume-controls input[type="range"] {
  width: 100%;
  margin: 5px 0;
}

.audio-volume-controls span {
  color: rgba(255, 255, 255, 0.9);
  font-size: 12px;
  font-weight: 600;
  float: right;
  margin-top: -20px;
}

/* Audio level meter styles */
.audio-indicators {
  animation: pulse 1s infinite alternate;
}

.audio-indicators {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.level-meter {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  overflow: hidden;
}

.level-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #4caf50, #ffc107, #f44336);
  border-radius: 2px;
  transition: width 0.1s ease-out;
}

/* Audio level animations */
@keyframes audioLevel {
  0% {
    width: 0%;
  }
  50% {
    width: var(--level, 0%);
  }
  100% {
    width: 0%;
  }
}

/* Audio Volume Controls Styling */
.audio-control-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

.audio-control-item label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
}

.audio-control-item input[type="range"] {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  margin: 2px 0;
}

.audio-control-item input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  background: rgba(102, 126, 234, 0.9);
  border-radius: 50%;
  cursor: pointer;
}

.audio-control-item input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  background: rgba(102, 126, 234, 0.9);
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

.audio-control-item span {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.7);
  text-align: right;
  margin-top: -2px;
}

.audio-value-display {
  font-size: 14px;
  font-weight: 600;
  color: rgba(102, 126, 234, 0.9);
  text-align: center;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(102, 126, 234, 0.3);
  border-radius: 4px;
  padding: 4px 8px;
  margin-top: 4px;
  min-width: 40px;
  backdrop-filter: blur(5px);
}

/* 🎬 Setup Countdown for Auto-Pause */
.setup-countdown {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 15000;
  pointer-events: none;
}

.countdown-number {
  font-size: 120px;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.8);
  text-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
  text-align: center;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  animation: countdownPulse 1s ease-in-out;
}

@keyframes countdownPulse {
  0% {
    opacity: 0;
    transform: scale(0.5);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
  }
  100% {
    opacity: 0.8;
    transform: scale(1);
  }
}

/* SmΔrt Logo in Countdown */
.countdown-logo {
  animation: countdownPulse 1s ease-in-out;
  display: block;
  margin: 0 auto;
}

/* 🎬 Recording Start Mode Controls */
.recording-start-mode-controls {
  margin-top: 15px;
}

.recording-start-mode-controls label {
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
  display: block;
}

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.modern-checkbox {
  width: 18px;
  height: 18px;
  accent-color: #4caf50;
  cursor: pointer;
}

.checkbox-label {
  color: rgba(255, 255, 255, 0.85);
  font-size: 14px;
  cursor: pointer;
  user-select: none;
  margin: 0 !important;
}

.checkbox-label:hover {
  color: rgba(255, 255, 255, 0.95);
}

.setting-description {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.4;
  margin-top: 5px;
  display: block;
}

/* 🎛️ Panel Collapse Enhancement States */

/* Hide elements when panel is collapsed */
.control-panel.collapsed .collapse-hide {
  display: none !important;
}

/* Show elements only when collapsed (hidden by default) */
.collapse-show {
  display: none;
}

.control-panel.collapsed .collapse-show {
  display: block !important;
}

.control-panel.collapsed .collapse-show-icon {
  display: inline !important;
}

.collapse-show-icon {
  display: none;
}

/* Icon-only navigation buttons when collapsed */
.control-panel.collapsed .playlist-navigation {
  justify-content: center;
  gap: 8px;
  margin: 8px 0;
}

.control-panel.collapsed .nav-btn {
  background: transparent;
  border: none;
  border-radius: 4px;
  padding: 4px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 24px;
  min-height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.control-panel.collapsed .nav-btn:hover {
  color: rgba(255, 255, 255, 1);
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.1);
}

.control-panel.collapsed .nav-btn:active {
  transform: scale(0.95);
}

/* Ensure playlist title shows only icon when collapsed */
.control-panel.collapsed .playlist-title {
  text-align: center;
  font-size: 20px;
  padding: 8px 0;
}

/* Enhanced URL items layout when collapsed - no left/right margins for larger items */
.control-panel.collapsed .playlist-items {
  margin: 0; /* No margins for maximum width */
  padding: 0;
}

.control-panel.collapsed .playlist-item {
  margin: 4px 0; /* Only top/bottom margins */
  padding: 8px 12px; /* Increased horizontal padding for better touch target */
  border-radius: 6px;
  position: relative;
  cursor: pointer;
}

/* Hover tooltip for URL items when collapsed - JavaScript-based tooltip system */
.control-panel.collapsed .playlist-item {
  position: relative;
  overflow: visible;
}

/* JavaScript tooltip that escapes all container bounds */
.playlist-tooltip {
  position: fixed;
  background: rgba(0, 0, 0, 0.95);
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  z-index: 999999;
  max-width: 150px; /* Reduced to fit in collapsed panel area */
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.15s ease;
}

.playlist-tooltip.show {
  opacity: 1;
  transform: translateY(0);
}

.playlist-tooltip::before {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(0, 0, 0, 0.95);
}
/* Unified Playlist Styles */
.playlist-btn.add-media-btn .icon {
  font-size: 14px;
}

.playlist-btn.add-url-btn .icon {
  font-size: 14px;
}

.playlist-item.media-item {
  border-left: 3px solid #ff6b6b;
}

.playlist-item.url-item {
  border-left: 3px solid #64b5f6;
}

.playlist-media-options {
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  margin-top: 10px;
}

.playlist-media-options .toggle-setting {
  margin-bottom: 8px;
}

.playlist-media-options .toggle-setting:last-child {
  margin-bottom: 0;
}

/* Enhanced Add Form with Tabs */
.form-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 12px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.form-tab {
  flex: 1;
  padding: 10px 12px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}

.form-tab:hover {
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.05);
}

.form-tab.active {
  color: #64b5f6;
  border-bottom-color: #64b5f6;
}

.form-tab-content {
  display: none;
}

.form-tab-content.active {
  display: block;
}

.form-hint {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 8px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  text-align: center;
}

/* Assets Browser */
.assets-browser {
  max-height: 200px;
  overflow-y: auto;
}

.assets-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.asset-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.asset-item:hover {
  background: rgba(100, 181, 246, 0.2);
  border-color: #64b5f6;
  transform: translateX(4px);
}

.asset-item.selected {
  background: rgba(100, 181, 246, 0.3);
  border-color: #64b5f6;
  border-left: 3px solid #64b5f6;
}

.asset-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.asset-name {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
