/* Video Coach Simple - Clean, Modern Styling */

/* Main Container */
.video-coach-main {
  position: relative;
  min-height: calc(100vh - 60px);
  background: #000;
  overflow: hidden;
}

/* Video and Canvas Container */
.video-coach-container {
  position: relative;
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

/* Video Stream */
.video-stream {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1); /* Mirror for user */
}

/* Pose Canvas Overlay */
.pose-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  transform: scaleX(-1); /* Mirror to match video */
  z-index: 10;
}

/* Debug - Force modal visibility */
#settingsModal.active {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 99999 !important;
}

/* Hide any floating elements that shouldn't be visible */
.video-coach-page .mobile-nav-header,
.video-coach-page .mobile-nav,
.video-coach-page .mobile-nav-overlay {
  display: none !important;
  visibility: hidden !important;
  position: absolute !important;
  left: -9999px !important;
}

/* Ensure mobile nav stays hidden unless explicitly shown */
.video-coach-page .mobile-nav.active {
  display: block !important;
  visibility: visible !important;
  position: fixed !important;
  left: 0 !important;
}

/* Hide any duplicate logos in main content */
main .logo,
main .mobile-logo {
  display: none !important;
}

/* Hide any clickable logo links in the main content area */
.video-coach-main a[href*="index"] img,
.video-coach-container a[href*="index"] img,
.video-coach-main .mobile-logo,
.video-coach-container .mobile-logo {
  display: none !important;
}

/* Additional selector to hide parent links */
.video-coach-main a[href*="index"]:not(.nav a),
.video-coach-container a[href*="index"]:not(.nav a) {
  display: none !important;
}

.video-coach-container {
  position: relative;
  width: 100%;
  height: calc(100vh - 60px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

/* Video Stream */
.video-stream {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  z-index: 1;
}

/* Pose Canvas Overlay */
.pose-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

/* Floating Status Bar */
.status-bar {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  border-radius: 30px;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  z-index: 100;
  transition: opacity 0.3s ease, transform 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.status-bar.hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(-10px);
  pointer-events: none;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: white;
  font-size: 14px;
  font-weight: 500;
}

.status-item i {
  font-size: 16px;
  color: #5D5FEF;
}

.status-item span {
  font-size: 18px;
  font-weight: 700;
}

.status-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  margin-left: 4px;
}

.status-item.live i {
  color: #00ff00;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}

/* Control Buttons */
.control-buttons {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 20px;
  z-index: 100;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.control-buttons.hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(10px);
  pointer-events: none;
}

.settings-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.settings-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.session-btn {
  padding: 15px 40px;
  background: #5D5FEF;
  color: white;
  border: none;
  border-radius: 30px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 20px rgba(93, 95, 239, 0.3);
}

.session-btn:hover {
  background: #4f51d8;
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(93, 95, 239, 0.4);
}

.session-btn.active {
  background: #ff4444;
}

.session-btn.active:hover {
  background: #dd3333;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  z-index: 20000 !important;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  padding: 20px;
}

.modal.active {
  display: flex !important;
  opacity: 1 !important;
  z-index: 20000 !important;
}

/* Ensure video coach page modal is visible and centered */
.video-coach-page .modal.active {
  display: flex !important;
  opacity: 1 !important;
  align-items: center !important;
  justify-content: center !important;
}

.modal-content {
  background: white;
  border-radius: 20px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  transform: scale(0.9);
  transition: transform 0.3s ease;
  position: relative;
  z-index: 20001;
  margin: auto;
}

.modal.active .modal-content {
  transform: scale(1);
}

.modal-header {
  padding: 20px 30px;
  border-bottom: 1px solid #eee;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h2 {
  margin: 0;
  font-size: 24px;
  color: #333;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #999;
  cursor: pointer;
  transition: color 0.3s ease;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.modal-close:hover {
  color: #333;
  background: #f5f5f5;
}

.modal-body {
  padding: 30px;
  overflow-y: auto;
  max-height: calc(90vh - 180px);
}

.modal-footer {
  padding: 20px 30px;
  border-top: 1px solid #eee;
  display: flex;
  gap: 15px;
  justify-content: flex-end;
}

/* Settings Form */
.setting-group {
  margin-bottom: 25px;
}

.setting-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #333;
  margin-bottom: 10px;
}

.setting-select {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-size: 16px;
  background: white;
  transition: border-color 0.3s ease;
}

.setting-select:focus {
  outline: none;
  border-color: #5D5FEF;
}

.angle-buttons {
  display: flex;
  gap: 10px;
}

.angle-btn {
  flex: 1;
  padding: 12px 20px;
  border: 2px solid #e0e0e0;
  background: white;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.angle-btn.active {
  background: #5D5FEF;
  color: white;
  border-color: #5D5FEF;
}

.angle-btn:hover:not(.active) {
  border-color: #5D5FEF;
  background: #f8f8ff;
}

/* Checkbox Styling */
.setting-group input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-right: 10px;
  cursor: pointer;
}

.setting-group label[for] {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-weight: 500;
}

/* Modal Buttons */
.modal-btn {
  padding: 12px 30px;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.modal-btn.cancel {
  background: #f5f5f5;
  color: #666;
}

.modal-btn.cancel:hover {
  background: #e8e8e8;
}

.modal-btn.save,
.modal-btn.primary {
  background: #5D5FEF;
  color: white;
}

.modal-btn.save:hover,
.modal-btn.primary:hover {
  background: #4f51d8;
  transform: translateY(-1px);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 1001;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: white;
  padding: 15px 20px;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 300px;
  animation: slideIn 0.3s ease;
  position: relative;
  overflow: hidden;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast.success {
  border-left: 4px solid #4caf50;
}

.toast.error {
  border-left: 4px solid #f44336;
}

.toast.warning {
  border-left: 4px solid #ff9800;
}

.toast.info {
  border-left: 4px solid #2196f3;
}

.toast i {
  font-size: 20px;
}

.toast.success i { color: #4caf50; }
.toast.error i { color: #f44336; }
.toast.warning i { color: #ff9800; }
.toast.info i { color: #2196f3; }

.toast-message {
  flex: 1;
  font-size: 14px;
  color: #333;
  font-weight: 500;
}

/* Summary Stats */
.summary-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.summary-stat {
  text-align: center;
  padding: 20px;
  background: #f8f8ff;
  border-radius: 15px;
}

.summary-stat i {
  font-size: 30px;
  color: #5D5FEF;
  margin-bottom: 10px;
}

.summary-stat h3 {
  font-size: 24px;
  margin: 5px 0;
  color: #333;
}

.summary-stat p {
  font-size: 14px;
  color: #666;
  margin: 0;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .video-coach-container {
    height: calc(100vh - 50px);
  }
  
  .status-bar {
    top: 10px;
    padding: 8px 15px;
    gap: 15px;
  }
  
  .status-item {
    font-size: 12px;
  }
  
  .status-item span {
    font-size: 16px;
  }
  
  .control-buttons {
    bottom: 20px;
    gap: 15px;
  }
  
  .settings-btn {
    width: 45px;
    height: 45px;
    font-size: 18px;
  }
  
  .session-btn {
    padding: 12px 30px;
    font-size: 14px;
  }
  
  .modal-content {
    width: 95%;
    margin: 20px;
  }
  
  .angle-buttons {
    flex-direction: column;
  }
  
  .summary-stats {
    grid-template-columns: 1fr;
  }
  
  .toast-container {
    top: 60px;
    right: 10px;
    left: 10px;
  }
  
  .toast {
    min-width: auto;
    width: 100%;
  }
}

/* Balance & ROM Panels */
.balance-panel,
.rom-panel {
  position: absolute;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  border-radius: 15px;
  padding: 0;
  width: 200px;
  z-index: 10;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.balance-panel {
  top: 80px;
  right: 20px;
}

.rom-panel {
  top: 80px;
  left: 20px;
}

.panel-header {
  padding: 12px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  color: white;
}

.panel-header i {
  margin-right: 8px;
  color: #5D5FEF;
}

.panel-toggle {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}

.panel-content {
  padding: 15px;
  max-height: 300px;
  overflow-y: auto;
  transition: max-height 0.3s ease;
}

.balance-panel.collapsed .panel-content,
.rom-panel.collapsed .panel-content {
  max-height: 0;
  padding: 0 15px;
}

.balance-panel.collapsed .panel-toggle i,
.rom-panel.collapsed .panel-toggle i {
  transform: rotate(-90deg);
}

/* Balance Score */
.balance-score {
  text-align: center;
  margin-bottom: 15px;
}

.score-circle {
  position: relative;
  display: inline-block;
}

.score-circle svg {
  transform: rotate(-90deg);
}

.score-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 5;
}

.score-fill {
  fill: none;
  stroke: #5D5FEF;
  stroke-width: 5;
  stroke-dasharray: 157;
  stroke-dashoffset: 157;
  transition: stroke-dashoffset 0.5s ease;
}

.score-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 18px;
  font-weight: bold;
}

/* Metrics */
.balance-metrics,
.rom-metrics {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.metric {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
}

.metric-label {
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
}

.metric-value {
  color: white;
  font-weight: 600;
  font-size: 14px;
}

.rom-metric {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  margin-bottom: 8px;
}

.rom-joint {
  color: #5D5FEF;
  font-weight: 600;
  font-size: 12px;
  min-width: 50px;
}

.rom-bar {
  flex: 1;
  height: 20px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  position: relative;
  overflow: hidden;
}

.rom-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: linear-gradient(to right, #5D5FEF, #7B7FFF);
  border-radius: 10px;
  transition: width 0.3s ease;
}

.rom-angle {
  color: white;
  font-size: 11px;
  font-weight: 500;
  margin-left: 8px;
}

/* Visualization Mode Buttons */
.viz-buttons {
  display: flex;
  gap: 10px;
}

.viz-btn {
  flex: 1;
  padding: 12px 20px;
  border: 2px solid #e0e0e0;
  background: white;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.viz-btn.active {
  background: #5D5FEF;
  color: white;
  border-color: #5D5FEF;
}

.viz-btn:hover:not(.active) {
  border-color: #5D5FEF;
  background: #f8f8ff;
}

/* Auto-hide Controls */
.video-coach-container.controls-hidden .status-bar,
.video-coach-container.controls-hidden .control-buttons,
.video-coach-container.controls-hidden .balance-panel,
.video-coach-container.controls-hidden .rom-panel {
  opacity: 0;
  pointer-events: none;
}

.video-coach-container:hover .status-bar,
.video-coach-container:hover .control-buttons,
.video-coach-container:hover .balance-panel,
.video-coach-container:hover .rom-panel {
  opacity: 1;
  pointer-events: auto;
}

/* Loading State */
.video-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 5;
}

.video-loading i {
  font-size: 48px;
  color: #5D5FEF;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.video-loading p {
  color: white;
  margin-top: 20px;
  font-size: 18px;
}

/* Exercise Prompt */
.exercise-prompt {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 5;
  background: rgba(0, 0, 0, 0.9);
  padding: 40px;
  border-radius: 20px;
  border: 2px solid rgba(93, 95, 239, 0.3);
  max-width: 400px;
}

.exercise-prompt i {
  font-size: 64px;
  color: #5D5FEF;
  margin-bottom: 20px;
  display: block;
}

.exercise-prompt h3 {
  color: white;
  font-size: 24px;
  margin-bottom: 10px;
}

.exercise-prompt p {
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 25px;
  font-size: 16px;
}

.prompt-btn {
  background: #5D5FEF;
  color: white;
  border: none;
  padding: 12px 30px;
  border-radius: 25px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.prompt-btn:hover {
  background: #4f51d8;
  transform: translateY(-2px);
}