:root {
  --primary-color: #3b82f6; /* Modern Vibrant Blue */
  --secondary-color: #8b5cf6; /* Vibrant Violet */
  --primary-gradient: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  --bg-top: #f8fafc;
  --bg-bottom: #e2e8f0;
  --text-dark: #0f172a;
  --text-light: #64748b;
  --white: #ffffff;
  --border-radius: 16px;
  --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
  --shadow-hover: 0 20px 25px -5px rgba(59, 130, 246, 0.15), 0 8px 10px -6px rgba(59, 130, 246, 0.1);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text-dark);
  background: linear-gradient(135deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
  background-attachment: fixed;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Header Global */
.global-header {
  padding: 0.8rem 5%;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.6);
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.03);
}

.logo a {
  display: inline-block;
  font-weight: 800;
  font-size: 1.35rem; /* Reduced from 1.8rem */
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-decoration: none;
  transition: opacity 0.2s;
  white-space: nowrap;
}
.logo a:hover { opacity: 0.8; }

.header-search {
  flex-grow: 1;
  max-width: 500px;
  margin-left: 2rem;
}
.header-search input {
  width: 100%;
  padding: 0.7rem 1.2rem;
  border-radius: 20px;
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(248, 250, 252, 0.8);
  outline: none;
  font-size: 0.95rem;
  color: var(--text-dark);
  transition: var(--transition);
}
.header-search input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
  background: var(--white);
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.1);
  border: 1px solid rgba(0,0,0,0.05);
  max-height: 400px;
  overflow-y: auto;
  z-index: 200;
  display: none;
}
.search-dropdown.active {
  display: block;
}
.search-result-item {
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  transition: var(--transition);
}
.search-result-item:last-child {
  border-bottom: none;
}
.search-result-item:hover {
  background: #f8fafc;
}
.search-result-title {
  color: var(--text-dark);
  font-weight: 600;
  font-size: 0.95rem;
}
.search-result-subject {
  color: var(--primary-color);
  font-size: 0.75rem;
  font-weight: 700;
  margin-top: 4px;
}

@media (max-width: 768px) {
  .global-header {
    flex-direction: column;
    gap: 0.8rem;
    padding: 1rem 5%;
  }
  .header-search {
    margin-left: 0;
    width: 100%;
    max-width: 100%;
  }
}


.quote-container {
  margin-top: 1rem;
  font-style: italic;
  font-size: 1.1rem;
  color: var(--text-light);
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  opacity: 0;
  animation: fadeIn 1.5s forwards 0.5s;
}
.quote-author {
  font-weight: 600;
  color: var(--primary-color);
  font-style: normal;
}

/* (Replaced by modern Hero section at bottom) */

/* Main Container */
main {
  padding: 2rem 5%;
  max-width: 1400px;
  margin: 0 auto;
}

/* Search and Filters */
.controls {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 3rem;
  align-items: center;
}

.search-bar {
  width: 100%;
  max-width: 600px;
  padding: 1.2rem 2rem;
  border-radius: 30px;
  border: 2px solid transparent;
  background: var(--white);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
  font-size: 1.1rem;
  outline: none;
  transition: var(--transition);
}
.search-bar:focus {
  border-color: var(--primary-color);
  box-shadow: 0 6px 20px rgba(140, 142, 242, 0.2);
}

.filter-pills {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  justify-content: center;
}

.pill {
  padding: 0.6rem 1.2rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(0,0,0,0.05);
  color: var(--text-light);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.95rem;
  font-weight: 500;
}
.pill.active, .pill:hover {
  background: var(--primary-color);
  color: var(--white);
  border-color: var(--primary-color);
  box-shadow: 0 4px 12px rgba(140, 142, 242, 0.3);
  transform: translateY(-2px);
}

/* Grid */
.videos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2.5rem;
}

/* Video Card */
.video-card {
  background: var(--white);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  position: relative;
  text-decoration: none;
  color: inherit;
  opacity: 0;
  animation: fadeIn 0.6s forwards;
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

.youtube-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #ff0000;
  color: var(--white);
  padding: 0.8rem 1.5rem;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  transition: var(--transition);
  border: none;
  margin-top: 1.5rem;
  width: 100%;
}
.youtube-btn:hover {
  background: #cc0000;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(255, 0, 0, 0.3);
}
.youtube-btn svg {
  width: 20px;
  height: 20px;
}

.video-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-hover);
}

.video-card img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-bottom: 1px solid rgba(0,0,0,0.02);
  transition: transform 0.5s ease;
}
.video-card:hover img {
  transform: scale(1.05);
}
.thumb-container {
  overflow: hidden;
  position: relative;
}
.duration-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.7);
  color: var(--white);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  backdrop-filter: blur(4px);
}

.video-info {
  padding: 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.course-tag {
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--secondary-color);
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
}

.video-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.8rem;
  color: var(--text-dark);
  line-height: 1.4;
}

.video-desc {
  color: var(--text-light);
  font-size: 0.95rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 1rem;
}

.video-action {
  margin-top: auto;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Single Video View */
.single-video-container {
  max-width: 1000px;
  margin: 2rem auto;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 2.5rem;
  box-shadow: var(--shadow-hover);
  border: 1px solid rgba(255, 255, 255, 0.6);
}
.video-wrapper {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
  margin-bottom: 2rem;
}
.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
.single-meta {
  margin-top: 2rem;
}
.single-meta h1 {
  font-size: 2.2rem;
  margin-bottom: 1rem;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.3;
}
.full-desc {
  white-space: pre-wrap;
  color: var(--text-light);
  line-height: 1.8;
  font-size: 1.05rem;
}
.back-btn {
  display: inline-block;
  margin-bottom: 2rem;
  text-decoration: none;
  font-weight: 600;
  color: var(--primary-color);
  background: rgba(140, 142, 242, 0.1);
  padding: 0.8rem 1.5rem;
  border-radius: 30px;
  transition: var(--transition);
}
.back-btn:hover {
  background: var(--primary-color);
  color: var(--white);
}

/* Animations */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Responsive */
@media (max-width: 768px) {
  .author-section {
    flex-direction: column;
    text-align: center;
  }
}

/* Hero Section (Index Redesign) */
.hero-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  max-width: 1200px;
  margin: 5rem auto;
  padding: 0 5%;
}

.hero-text {
  animation: slideUp 0.8s forwards;
}
.hero-text h1 {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1.5rem;
  color: var(--text-dark);
}
.hero-text h1 span {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-quote {
  font-style: italic;
  font-size: 1.15rem;
  color: var(--text-light);
  border-left: 4px solid var(--primary-color);
  padding-left: 1.5rem;
  margin-bottom: 2.5rem;
}
.hero-quote strong {
  font-style: normal;
  color: var(--text-dark);
  display: block;
  margin-top: 0.5rem;
}

.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
  animation: fadeIn 1s forwards 0.2s;
  opacity: 0;
}
.hero-blob {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 350px;
  height: 350px;
  background: var(--primary-gradient);
  filter: blur(80px);
  opacity: 0.2;
  border-radius: 50%;
  z-index: 0;
}
.author-card {
  position: relative;
  z-index: 1;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 24px;
  padding: 2.5rem;
  box-shadow: var(--shadow-hover);
  text-align: center;
  max-width: 340px;
}
.author-card img {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 1.5rem;
  border: 4px solid var(--white);
  box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}
.author-card h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--text-dark);
}
.author-card p {
  font-size: 0.95rem;
  color: var(--text-light);
  line-height: 1.5;
}

@media (max-width: 900px) {
  .hero-section {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 3rem;
    margin: 3rem auto;
  }
  .hero-quote {
    border-left: none;
    border-top: 4px solid var(--primary-color);
    padding-left: 0;
    padding-top: 1.5rem;
  }
}


.primary-btn {
  display: inline-block;
  margin-top: 1.5rem;
  padding: 1rem 2.5rem;
  border-radius: 30px;
  background: var(--primary-gradient);
  color: white;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
  box-shadow: 0 4px 15px rgba(140, 142, 242, 0.4);
  transition: transform 0.2s;
}
.primary-btn:hover {
  transform: scale(1.05);
}

/* Dashboard / Menu Hierarchy */
.dashboard-main { max-width: 1000px; }
.search-container { margin-bottom: 2rem; }
.years-list { display: flex; flex-direction: column; gap: 1rem; }
.year-block { background: white; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
.year-header { 
  padding: 1.5rem; 
  cursor: pointer; 
  display: flex; 
  justify-content: space-between; 
  align-items: center;
  background: #fafbff;
  border-bottom: 1px solid #f0f0f0;
}
.year-header h2 { font-size: 1.3rem; margin: 0; color: var(--primary-color); }
.year-content { display: none; padding: 1.5rem; }
.year-block.active .year-content { display: block; }

.semester-block { margin-bottom: 2rem; }
.semester-block h3 { color: #718096; margin-bottom: 1rem; font-size: 1.1rem; }

.subjects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.subject-card {
  padding: 1.5rem;
  background: #f8f9ff;
  border-radius: 12px;
  text-decoration: none;
  color: var(--text-dark);
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.subject-card:hover { background: var(--primary-color); color: white; transform: translateY(-3px); }
.subject-card h4 { font-size: 1.1rem; margin: 0; }
.video-count { font-size: 0.85rem; opacity: 0.8; }

/* Subject Profile */
.subject-header {
  text-align: center;
  margin: 2rem auto 4rem;
  max-width: 900px;
  padding: 3rem;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow-hover);
}
.back-link { font-weight: 600; color: var(--primary-color); text-decoration: none; margin-bottom: 1rem; display: inline-block; }
.subject-title { 
  font-size: 2.8rem; 
  margin: 1rem 0; 
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 800;
}
.subject-desc { max-width: 800px; margin: 0 auto; color: var(--text-light); line-height: 1.8; font-size: 1.1rem; }

.transcript-module {
  margin-top: 3rem;
  background: #f8f9ff;
  border-radius: 12px;
  padding: 2rem;
  border: 1px solid #e2e8f0;
}
.transcript-module h3 {
  color: var(--primary-color);
  margin-top: 0;
  margin-bottom: 1.5rem;
  font-size: 1.3rem;
  font-weight: 700;
}
.transcript-content {
  white-space: pre-wrap;
  color: #4a5568;
  line-height: 1.8;
  font-size: 1.05rem;
  padding-right: 1rem;
}
.transcript-content::-webkit-scrollbar {
  width: 8px;
}
.transcript-content::-webkit-scrollbar-track {
  background: #edf2f7; 
  border-radius: 10px;
}
.transcript-content::-webkit-scrollbar-thumb {
  background: #cbd5e0; 
  border-radius: 10px;
}
.transcript-content::-webkit-scrollbar-thumb:hover {
  background: #a0aec0; 
}

.download-btn {
  background-color: var(--secondary-color, #7ca0e6);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.9rem;
}
.download-btn:hover {
  background-color: var(--primary-color, #5e7fc2);
  transform: translateY(-2px);
}
