/**
 * IT Vision - Components Stylesheet
 * Cards, Carousels, Hero, Player, Toasts, and Controls
 */

/* Section Headers */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* 1. HERO SPOTLIGHT */
.hero-spotlight {
  position: relative;
  width: 100%;
  min-height: 380px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 40px;
  box-shadow: var(--card-shadow);
  display: flex;
  align-items: flex-end;
  background-size: cover;
  background-position: center;
  border: 1px solid var(--border-subtle);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11, 16, 32, 0.1) 0%, rgba(11, 16, 32, 0.85) 60%, var(--bg-main) 100%);
}

.hero-content {
  position: relative;
  z-index: 10;
  padding: 40px;
  max-width: 800px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: rgba(37, 99, 235, 0.3);
  border: 1px solid rgba(37, 99, 235, 0.6);
  color: #60A5FA;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 14px;
}

.hero-title {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.25;
  color: #FFFFFF;
  margin-bottom: 12px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 28px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-cyan) 100%);
  color: #FFFFFF;
  font-weight: 600;
  font-size: 15px;
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
  transition: var(--transition);
}

.hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(37, 99, 235, 0.6);
}

/* 2. HORIZONTAL CAROUSEL SHELF */
.shelf-container {
  margin-bottom: 40px;
  position: relative;
}

.shelf-carousel-wrapper {
  position: relative;
}

.shelf-carousel {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 8px 4px 16px 4px;
  scrollbar-width: none; /* Firefox */
}

.shelf-carousel::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.shelf-nav-btn {
  position: absolute;
  top: 40%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--card-shadow);
  z-index: 20;
  opacity: 0;
  transition: var(--transition);
}

.shelf-carousel-wrapper:hover .shelf-nav-btn {
  opacity: 0.95;
}

.shelf-nav-btn:hover {
  opacity: 1;
  background: var(--accent-primary);
  color: #FFFFFF;
  border-color: var(--accent-primary);
}

.shelf-nav-prev { left: -16px; }
.shelf-nav-next { right: -16px; }

/* 3. VIDEO CARD */
.video-card {
  flex: 0 0 300px;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
  position: relative;
}

.video-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-active);
  box-shadow: var(--card-shadow), var(--glow-shadow);
}

.video-card-thumb-link {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
}

.video-card-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.video-card:hover .video-card-thumb {
  transform: scale(1.05);
}

.video-duration-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.8);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}

.video-play-overlay {
  position: absolute;
  inset: 0;
  background: rgba(11, 16, 32, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--transition);
}

.play-circle-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--accent-primary);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(0.8);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.6);
}

.video-card:hover .video-play-overlay {
  opacity: 1;
}

.video-card:hover .play-circle-icon {
  transform: scale(1);
}

.video-card-content {
  padding: 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.video-card-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
}

.video-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.channel-avatar-sm {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  object-fit: cover;
}

.channel-name {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.video-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
  font-size: 12px;
  color: var(--text-muted);
}

.video-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.action-btn-sm {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: var(--transition);
}

.action-btn-sm:hover, .action-btn-sm.active {
  color: var(--accent-primary);
  background: var(--bg-surface-elevated);
}

/* Progress bar for Continue Watching */
.watch-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
}

.watch-progress-fill {
  height: 100%;
  background: var(--accent-primary);
}

/* 4. VIDEO PLAYER WATCH PAGE */
.watch-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 32px;
}

@media (max-width: 1100px) {
  .watch-layout {
    grid-template-columns: 1fr;
  }
}

.player-container {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  margin-bottom: 20px;
}

.player-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.player-info-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
}

.player-title {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 16px;
}

.player-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 20px;
}

.player-channel-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.player-channel-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  object-fit: cover;
}

.follow-btn {
  padding: 8px 20px;
  border-radius: var(--radius-full);
  background: var(--accent-primary);
  color: #FFFFFF;
  font-weight: 600;
  font-size: 14px;
  transition: var(--transition);
}

.follow-btn.following {
  background: var(--bg-surface-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.player-interactive-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pill-action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
}

.pill-action-btn:hover, .pill-action-btn.active {
  color: var(--accent-primary);
  border-color: var(--accent-primary);
  background: var(--bg-surface-elevated);
}

.player-description-box {
  background: var(--bg-surface);
  padding: 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
  white-space: pre-line;
}

/* 5. CHANNEL CARD */
.channel-card-sidebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.channel-card-sidebar:hover {
  border-color: var(--border-active);
}

/* 6. TOAST NOTIFICATIONS */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

[dir="rtl"] .toast-container {
  right: auto;
  left: 24px;
}

.toast {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-active);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--card-shadow);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* 7. SEARCH AUTOCOMPLETE DROPDOWN */
.search-autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--card-shadow);
  max-height: 360px;
  overflow-y: auto;
  display: none;
  z-index: 100;
}

.search-suggestion-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  cursor: pointer;
  transition: var(--transition);
}

.search-suggestion-item:hover {
  background: var(--bg-surface-elevated);
}

/* Grid for Explore and Search */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  max-width: 500px;
  margin: 0 auto;
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px auto;
}

.empty-state-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.empty-state-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 24px;
  line-height: 1.5;
}
