/* ==========================================
   INFO DATA - 100VH FULL VIEWPORT DESIGN
   Modern Video Tutorial UI
   ========================================== */

/* CSS Variables for Theme */
:root {
  --primary-color: #8b5cf6;
  --primary-light: #a78bfa;
  --primary-dark: #7c3aed;
  --accent-blue: #60a5fa;
  --dark-bg: #0f0f1a;
  --sidebar-bg: #1a1a2e;
  --card-bg: rgba(26, 26, 46, 0.95);
  --border-color: rgba(139, 92, 246, 0.3);
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-muted: rgba(255, 255, 255, 0.5);
  --glow-purple: rgba(139, 92, 246, 0.5);
  --progress-bg: rgba(255, 255, 255, 0.15);
  --border-radius: 12px;
  --transition: all 0.25s ease;
}

/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Segoe UI', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--dark-bg);
  color: var(--text-primary);
  line-height: 1.5;
}

/* Main Container - Fixed 100vh */
.container {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* ==========================================
   SIDEBAR - LEFT PANEL
   ========================================== */
.sidebar {
  width: 260px;
  min-width: 260px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.sidebar-box {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0;
}

/* Hide nav track by default */
.nav-track {
  display: none;
}

.nav-dots {
  display: none;
}

/* Video Titles List */
.video-titles {
  list-style: none;
  display: flex;
  flex-direction: column;
  padding: 20px 0;
  flex: 1;
  overflow-y: auto;
}

.video-titles::-webkit-scrollbar {
  width: 4px;
}

.video-titles::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 4px;
}

.video-titles li {
  padding: 16px 24px;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  border-left: 3px solid transparent;
  position: relative;
}

.video-titles li:hover {
  background: rgba(139, 92, 246, 0.1);
  color: var(--text-primary);
}

.video-titles li.active {
  background: rgba(139, 92, 246, 0.15);
  border-left-color: var(--primary-color);
  color: var(--text-primary);
  font-weight: 600;
}

.video-titles li.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--primary-color);
  box-shadow: 0 0 10px var(--glow-purple);
}

/* ==========================================
   MAIN CONTENT AREA
   ========================================== */
.main-video {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: var(--dark-bg);
  overflow: hidden;
}

/* Video Player */
#videoPlayer {
  flex: 1;
  width: 100%;
  background: #000;
  object-fit: contain;
  cursor: pointer;
  min-height: 0;
}

/* Video Controls Bar */
.video-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  background: var(--sidebar-bg);
  border-top: 1px solid var(--border-color);
  flex-shrink: 0;
}

.play-btn {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: var(--primary-color);
  color: white;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}

.play-btn:hover {
  background: var(--primary-dark);
  transform: scale(1.05);
}

#currentTime,
#totalTime {
  font-size: 13px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  min-width: 42px;
  font-weight: 500;
}

/* ==========================================
   CUSTOM PROGRESS BAR
   ========================================== */
.progress-container {
  flex: 1;
  height: 24px;
  display: flex;
  align-items: center;
  cursor: pointer;
  position: relative;
}

.progress-bar-bg {
  width: 100%;
  height: 6px;
  background: var(--progress-bg);
  border-radius: 10px;
  position: relative;
  overflow: visible;
}

.progress-bar-fill {
  height: 100%;
  background: var(--primary-color);
  border-radius: 10px;
  width: 0%;
  transition: width 0.1s linear;
  position: relative;
}

.progress-bar-thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  background: var(--primary-color);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--glow-purple), 0 2px 6px rgba(0, 0, 0, 0.3);
  cursor: grab;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  z-index: 2;
}

.progress-bar-thumb:hover {
  transform: translate(-50%, -50%) scale(1.2);
  box-shadow: 0 0 15px var(--glow-purple), 0 3px 10px rgba(0, 0, 0, 0.4);
}

.progress-bar-thumb:active {
  cursor: grabbing;
  transform: translate(-50%, -50%) scale(1.1);
}

.progress-container:hover .progress-bar-bg {
  height: 8px;
}

.progress-container:hover .progress-bar-thumb {
  width: 18px;
  height: 18px;
}

/* ==========================================
   HELPFUL LINKS SECTION
   ========================================== */
.helpful-links-section {
  background: var(--sidebar-bg);
  border-top: 1px solid var(--border-color);
  padding: 16px 24px;
  flex-shrink: 0;
}

.helpful-links-section h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
}

.helpful-links-section h3 .icon {
  width: 28px;
  height: 28px;
  background: var(--primary-color);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.links-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  transition: var(--transition);
  white-space: nowrap;
}

.brand-link:hover {
  background: rgba(139, 92, 246, 0.25);
  color: var(--text-primary);
  border-color: var(--primary-color);
  transform: translateY(-2px);
}

.brand-link .brand-icon {
  font-size: 14px;
}

.brand-link .external-icon {
  font-size: 10px;
  opacity: 0.6;
}

/* Brand Colors on Hover */
.brand-link.xiaomi:hover {
  border-color: #FF6900;
}

.brand-link.huawei:hover {
  border-color: #C7000B;
}

.brand-link.samsung:hover {
  border-color: #1428A0;
}

.brand-link.vivo:hover {
  border-color: #0026A3;
}

.brand-link.smartisan:hover {
  border-color: #666;
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */

/* Tablets */
@media (max-width: 900px) {
  .sidebar {
    width: 220px;
    min-width: 220px;
  }

  .video-titles li {
    padding: 14px 18px;
    font-size: 13px;
  }

  .video-controls {
    padding: 14px 18px;
    gap: 12px;
  }

  .helpful-links-section {
    padding: 12px 18px;
  }
}

/* Small Tablets / Large Phones - Stack Layout */
@media (max-width: 768px) {
  .container {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    min-width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
  }

  .video-titles {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 12px 16px;
    gap: 8px;
  }

  .video-titles::-webkit-scrollbar {
    height: 3px;
  }

  .video-titles li {
    padding: 10px 16px;
    white-space: nowrap;
    border-left: none;
    border-bottom: 2px solid transparent;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    font-size: 12px;
  }

  .video-titles li.active {
    border-bottom-color: var(--primary-color);
    background: rgba(139, 92, 246, 0.2);
  }

  .video-titles li.active::before {
    display: none;
  }

  .main-video {
    height: auto;
    flex: 1;
    min-height: 0;
  }

  #videoPlayer {
    aspect-ratio: 16/9;
    flex: none;
    max-height: 50vh;
  }

  .video-controls {
    padding: 12px 16px;
    gap: 10px;
  }

  .play-btn {
    width: 38px;
    height: 38px;
    font-size: 14px;
  }

  .progress-bar-thumb {
    width: 14px;
    height: 14px;
  }

  .helpful-links-section {
    padding: 12px 16px;
    overflow-x: auto;
  }

  .helpful-links-section h3 {
    font-size: 13px;
    margin-bottom: 10px;
  }

  .links-grid {
    padding-bottom: 4px;
  }

  .brand-link {
    padding: 6px 12px;
    font-size: 11px;
  }
}

/* Mobile Phones */
@media (max-width: 480px) {
  .video-titles li {
    padding: 8px 12px;
    font-size: 11px;
  }

  .video-controls {
    padding: 10px 12px;
    gap: 8px;
  }

  .play-btn {
    width: 34px;
    height: 34px;
    font-size: 12px;
  }

  #currentTime,
  #totalTime {
    font-size: 11px;
    min-width: 36px;
  }

  .progress-bar-thumb {
    width: 12px;
    height: 12px;
  }

  .helpful-links-section {
    padding: 10px 12px;
  }

  .helpful-links-section h3 {
    font-size: 12px;
  }

  .helpful-links-section h3 .icon {
    width: 24px;
    height: 24px;
    font-size: 12px;
  }

  .brand-link {
    padding: 5px 10px;
    font-size: 10px;
    gap: 6px;
  }

  .brand-link .brand-icon {
    font-size: 12px;
  }
}

/* Landscape Mode on Mobile */
@media (max-height: 500px) and (orientation: landscape) {
  .container {
    flex-direction: row;
  }

  .sidebar {
    width: 180px;
    min-width: 180px;
    height: 100vh;
    border-right: 1px solid var(--border-color);
    border-bottom: none;
  }

  .video-titles {
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 10px 0;
  }

  .video-titles li {
    padding: 10px 14px;
    white-space: normal;
    font-size: 11px;
    border-left: 2px solid transparent;
    border-bottom: none;
    border-radius: 0;
    background: transparent;
  }

  .video-titles li.active {
    border-left-color: var(--primary-color);
    border-bottom-color: transparent;
    background: rgba(139, 92, 246, 0.15);
  }

  .main-video {
    height: 100vh;
    flex: 1;
  }

  #videoPlayer {
    flex: 1;
    max-height: none;
    aspect-ratio: unset;
  }

  .video-controls {
    padding: 8px 12px;
  }

  .play-btn {
    width: 32px;
    height: 32px;
  }

  .helpful-links-section {
    display: none;
  }
}

/* Print - Hide everything except video */
@media print {

  .sidebar,
  .video-controls,
  .helpful-links-section {
    display: none;
  }
}