/* ==============================================
   VIDEO TUTORIALS PAGE - COMPLETE CSS
   MediBrain | 2026
   ============================================== */

:root {
  --primary-green: #10b981;
  --dark-green: #065f46;
  --light-green: #ecfdf5;
  --text-main: #1f2937;
  --text-muted: #4b5563;
  --white: #ffffff;
  --transition: all 0.3s ease;
}

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

body {
  font-family: 'Inter', sans-serif;
  color: var(--text-main);
  line-height: 1.6;
}

/* Ensure Bootstrap Icons work */
.bi::before {
  font-family: 'bootstrap-icons' !important;
  font-style: normal;
  font-weight: normal !important;
  font-variant: normal;
  text-transform: none;
  line-height: 1;
  vertical-align: middle;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: inline-block;
}

/* ==============================================
   HERO SECTION
   ============================================== */

.video-hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 120px 0 80px;
}

/* Hero Background */
.hero-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  overflow: hidden;
}

.hero-gradient {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at top left, rgba(16, 185, 129, 0.15) 0%, transparent 50%),
              radial-gradient(ellipse at top right, rgba(6, 95, 70, 0.1) 0%, transparent 50%),
              radial-gradient(ellipse at bottom left, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
              linear-gradient(135deg, #f0fdf4 0%, #ffffff 50%, #f3f4f6 100%);
}

.hero-pattern {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(circle at 20% 50%, rgba(16, 185, 129, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(59, 130, 246, 0.03) 0%, transparent 50%);
  background-size: 80% 80%;
  animation: patternFloat 20s ease-in-out infinite;
}

@keyframes patternFloat {
  0%, 100% { 
    transform: translate(0, 0); 
  }
  50% { 
    transform: translate(20px, -20px); 
  }
}

/* Floating Elements */
.floating-element {
  position: absolute;
  font-size: 3rem;
  color: rgba(16, 185, 129, 0.1);
  animation: float 6s ease-in-out infinite;
  z-index: 1;
}

.floating-1 {
  top: 15%;
  left: 10%;
  animation-delay: 0s;
}

.floating-2 {
  top: 60%;
  right: 15%;
  animation-delay: 2s;
}

.floating-3 {
  bottom: 20%;
  left: 20%;
  animation-delay: 4s;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-30px) rotate(5deg);
  }
}

/* Hero Content */
.video-hero .container {
  position: relative;
  z-index: 2;
}

.breadcrumb-custom {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.breadcrumb-custom a {
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition);
}

.breadcrumb-custom a:hover {
  color: var(--primary-green);
}

.breadcrumb-custom span {
  color: var(--text-muted);
}

/* Hero Badge */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--dark-green);
  margin-bottom: 2rem;
  animation: fadeInUp 0.8s ease;
}

.hero-badge i {
  font-size: 1.3rem;
  color: var(--primary-green);
}

/* Hero Title */
.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
  animation: fadeInUp 0.8s ease 0.2s backwards;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.gradient-text {
  background: linear-gradient(135deg, var(--primary-green) 0%, #059669 50%, var(--dark-green) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline;
  animation: gradientShift 3s ease infinite;
  background-size: 200% 200%;
}

@keyframes gradientShift {
  0%, 100% { 
    background-position: 0% 50%; 
  }
  50% { 
    background-position: 100% 50%; 
  }
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 2.5rem;
  max-width: 600px;
  animation: fadeInUp 0.8s ease 0.4s backwards;
}

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

/* Hero Stats */
.hero-stats {
  display: flex;
  gap: 2rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
  animation: fadeInUp 0.8s ease 0.6s backwards;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 20px;
  background: white;
  border-radius: 16px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: var(--transition);
}

.stat-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.3);
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.05));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--primary-green);
}

.stat-content {
  display: flex;
  flex-direction: column;
}

.stat-number {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--primary-green);
  line-height: 1;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Hero Actions */
.hero-actions {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  animation: fadeInUp 0.8s ease 0.8s backwards;
}

.hero-actions .btn {
  padding: 14px 30px;
  font-weight: 700;
  border-radius: 12px;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-outline-light {
  border: 2px solid var(--primary-green);
  color: var(--primary-green);
  background: white;
}

.btn-outline-light:hover {
  background: var(--primary-green);
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
}

/* Hero Video Card */
.hero-video-card {
  animation: fadeInRight 1s ease 0.5s backwards;
  max-width: 100%;
  overflow: hidden;
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.video-preview {
  background: white;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.1);
  transition: var(--transition);
  max-width: 100%;
}

.video-preview:hover {
  transform: translateY(-10px);
  box-shadow: 0 30px 80px rgba(16, 185, 129, 0.25);
}

.video-thumbnail {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  width: 100%;
}

.video-thumbnail img {
  width: 100%;
  height: auto;
  display: block;
  transition: var(--transition);
  max-width: 100%;
}

.video-thumbnail:hover img {
  transform: scale(1.05);
}

.play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--primary-green);
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.play-button:hover {
  transform: translate(-50%, -50%) scale(1.1);
  background: var(--primary-green);
  color: white;
}

.video-info {
  padding: 20px;
}

.video-badge {
  display: inline-block;
  padding: 6px 12px;
  background: linear-gradient(135deg, var(--primary-green), #059669);
  color: white;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.video-info h4 {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 12px;
  color: var(--text-main);
}

.video-meta {
  display: flex;
  gap: 15px;
  font-size: 0.9rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.video-meta span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.video-meta i {
  color: var(--primary-green);
}

/* ==============================================
   FILTER SECTION
   ============================================== */

.filter-section {
  background: white;
  border-bottom: 1px solid #e5e7eb;
  padding: 20px 0;
  position: sticky;
  top: 80px;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.filter-bar {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.filter-group label {
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0;
  font-size: 0.9rem;
}

.filter-btn {
  border: 1px solid #e5e7eb;
  background: white;
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-main);
  transition: var(--transition);
  cursor: pointer;
}

.filter-btn:hover {
  border-color: rgba(16, 185, 129, 0.5);
  background: rgba(236, 253, 245, 0.75);
}

.filter-btn.active {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.6);
  color: var(--dark-green);
}

/* ==============================================
   SECTIONS
   ============================================== */

.featured-section,
.browse-section {
  padding: 80px 0;
}

.browse-section {
  background: #f9fafb;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3rem;
  flex-wrap: wrap;
  gap: 20px;
}

.section-header.text-center {
  flex-direction: column;
  text-align: center;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 900;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin: 0;
}

/* ==============================================
   VIDEO CARDS
   ============================================== */

.video-card {
  border-radius: 20px;
  overflow: hidden;
  background: white;
  border: 1px solid #e5e7eb;
  transition: var(--transition);
  height: 100%;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.video-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.3);
}

.video-card.featured {
  border: 2px solid var(--primary-green);
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.1);
}

.video-thumbnail-wrapper {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.video-thumbnail-wrapper img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  transition: var(--transition);
}

.video-card:hover .video-thumbnail-wrapper img {
  transform: scale(1.08);
}

.video-duration {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.85);
  color: white;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
}

.play-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 70px;
  height: 70px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--primary-green);
  opacity: 0;
  transition: var(--transition);
}

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

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

.video-tags {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.tag {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.tag-gcse {
  background: #dbeafe;
  color: #2563eb;
}

.tag-alevel {
  background: #fce7f3;
  color: #db2777;
}

.tag-maths {
  background: #e0e7ff;
  color: #4f46e5;
}

.tag-physics {
  background: #d1fae5;
  color: #059669;
}

.tag-chemistry {
  background: #fef3c7;
  color: #d97706;
}

.tag-biology {
  background: #dbeafe;
  color: #0284c7;
}

.video-title {
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 10px;
  color: var(--text-main);
  line-height: 1.4;
}

.video-description {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 15px;
  flex: 1;
}

.video-stats {
  display: flex;
  gap: 15px;
  font-size: 0.9rem;
  color: var(--text-muted);
  padding-top: 15px;
  border-top: 1px solid #e5e7eb;
  flex-wrap: wrap;
}

.video-stats span {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.video-stats i {
  color: var(--primary-green);
}

/* ==============================================
   SUBJECT VIDEO CARDS
   ============================================== */

.subject-video-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  padding: 28px;
  transition: var(--transition);
  height: 100%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.subject-video-card:hover {
  border-color: var(--primary-green);
  box-shadow: 0 12px 30px rgba(16, 185, 129, 0.15);
}

.subject-card-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 25px;
  padding-bottom: 20px;
  border-bottom: 2px solid #e5e7eb;
}

.subject-icon {
  width: 70px;
  height: 70px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.05));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--primary-green);
  flex-shrink: 0;
}

.subject-info h3 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 5px;
}

.subject-info p {
  color: var(--text-muted);
  margin: 0;
}

/* Video List Items */
.videos-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.video-list-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  transition: var(--transition);
  cursor: pointer;
}

.video-list-item:hover {
  background: white;
  border-color: var(--primary-green);
  transform: translateX(5px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.1);
}

.video-item-thumbnail {
  position: relative;
  width: 120px;
  height: 80px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
}

.video-item-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.play-mini {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 35px;
  height: 35px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--primary-green);
}

.video-item-info {
  flex: 1;
}

.item-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.badge-gcse {
  background: #dbeafe;
  color: #2563eb;
}

.badge-alevel {
  background: #fce7f3;
  color: #db2777;
}

.video-item-info h5 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 5px;
  color: var(--text-main);
}

.item-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

.item-meta i {
  color: var(--primary-green);
}

.video-item-link {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--light-green);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-green);
  text-decoration: none;
  transition: var(--transition);
  flex-shrink: 0;
}

.video-item-link:hover {
  background: var(--primary-green);
  color: white;
}

/* ==============================================
   CTA SECTION
   ============================================== */

.cta-section {
  padding: 80px 0;
}

.cta-card {
  background: linear-gradient(135deg, var(--primary-green), #059669);
  border-radius: 24px;
  padding: 50px;
  color: white;
  box-shadow: 0 20px 60px rgba(16, 185, 129, 0.3);
}

.cta-title {
  font-size: 2rem;
  font-weight: 900;
  margin-bottom: 1rem;
  color: white;
}

.cta-text {
  font-size: 1.1rem;
  margin: 0;
  opacity: 0.95;
}

.cta-card .btn-light {
  background: white;
  color: var(--primary-green);
  border: none;
  font-weight: 700;
}

.cta-card .btn-light:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

/* ==============================================
   NO RESULTS
   ============================================== */

.no-results {
  text-align: center;
  padding: 80px 20px;
}

.no-results i {
  font-size: 5rem;
  color: #d1d5db;
  margin-bottom: 1.5rem;
}

.no-results h4 {
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.no-results p {
  color: var(--text-muted);
}

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

@media (max-width: 991px) {
  .video-hero {
    min-height: auto;
    padding: 100px 0 60px;
  }

  .hero-title {
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    line-height: 1.3;
  }

  .hero-stats {
    gap: 1rem;
  }

  .stat-item {
    flex: 1;
    min-width: 150px;
  }

  .section-title {
    font-size: 2rem;
  }

  .cta-card {
    padding: 35px;
  }

  .cta-title {
    font-size: 1.5rem;
  }

  .hero-video-card {
    margin-top: 2rem;
  }

  .subject-card-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 768px) {
  .hero-title {
    font-size: 1.8rem;
    line-height: 1.3;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .hero-stats {
    width: 100%;
  }

  .stat-item {
    flex: 1 1 100%;
    max-width: 100%;
  }

  .filter-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .video-item-thumbnail {
    width: 100px;
    height: 70px;
  }

  .video-preview {
    border-radius: 18px;
  }

  .play-button {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
  }

  .video-info h4 {
    font-size: 1.1rem;
  }

  .featured-section,
  .browse-section {
    padding: 60px 0;
  }
}

@media (max-width: 576px) {
  .hero-title {
    font-size: 1.6rem;
  }

  .hero-actions {
    width: 100%;
  }

  .hero-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .stat-item {
    padding: 12px 15px;
  }

  .stat-icon {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }

  .stat-number {
    font-size: 1.5rem;
  }

  .section-title {
    font-size: 1.8rem;
  }

  .cta-card {
    padding: 25px;
  }

  .cta-title {
    font-size: 1.3rem;
  }

  .cta-text {
    font-size: 1rem;
  }
}