/* Enhanced Styles for Video Resource Site */

:root {
  --primary-color: #1976d2;
  --primary-dark: #1565c0;
  --secondary-color: #ff9800;
  --bg-light: #f5f5f5;
  --text-dark: #222;
  --text-medium: #444;
  --text-light: #666;
  --border-color: #e0e0e0;
  --shadow-sm: 0 2px 6px rgba(0,0,0,0.06);
  --shadow-md: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.12);
}

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
}

/* Enhanced Button Styles */
.btn {
  display: inline-block;
  padding: 10px 24px;
  background: var(--primary-color);
  color: #fff;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 500;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}

.btn:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: var(--primary-color);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-md);
  z-index: 999;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background: var(--primary-dark);
  transform: translateY(-4px);
}

/* Loading Animation */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255,255,255,.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
}

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

/* Enhanced Card Hover Effects */
.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(25,118,210,0.05) 0%, rgba(25,118,210,0) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: 8px;
  pointer-events: none;
}

.card:hover::before {
  opacity: 1;
}

/* Improved Typography */
.section p::first-letter {
  font-size: 1.2em;
  font-weight: 600;
  color: var(--primary-color);
}

/* Responsive Enhancements */
@media (max-width: 768px) {
  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    font-size: 20px;
  }
}

/* Print Styles */
@media print {
  nav, .back-to-top, .related {
    display: none;
  }

  body {
    background: #fff;
  }

  .detail {
    box-shadow: none;
    padding: 0;
  }
}

/* Focus Styles for Accessibility */
a:focus,
button:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Selection Color */
::selection {
  background: var(--primary-color);
  color: #fff;
}

::-moz-selection {
  background: var(--primary-color);
  color: #fff;
}

/* Enhanced Tag Styles */
.tag {
  transition: all 0.3s ease;
}

.tag:hover {
  background: var(--primary-color);
  color: #fff;
  transform: scale(1.05);
}

/* List Item Animations */
.item, .card {
  position: relative;
  animation: fadeInUp 0.6s ease;
}

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

/* Stagger Animation for Multiple Items */
.item:nth-child(1), .card:nth-child(1) { animation-delay: 0.05s; }
.item:nth-child(2), .card:nth-child(2) { animation-delay: 0.1s; }
.item:nth-child(3), .card:nth-child(3) { animation-delay: 0.15s; }
.item:nth-child(4), .card:nth-child(4) { animation-delay: 0.2s; }
.item:nth-child(5), .card:nth-child(5) { animation-delay: 0.25s; }
.item:nth-child(6), .card:nth-child(6) { animation-delay: 0.3s; }

/* Nav Active State */
nav a.active {
  color: var(--primary-color);
  font-weight: 600;
  background: rgba(25,118,210,0.05);
}
