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

:root {
  /* Light Mode Colors */
  --primary-color: #2563eb;
  --secondary-color: #1e40af;
  --accent-color: #3b82f6;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --bg-primary: #ffffff;
  --bg-secondary: #f9fafb;
  --bg-tertiary: #f3f4f6;
  --border-color: #e5e7eb;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);

  /* Dark Mode Colors */
  --dark-primary-color: #3b82f6;
  --dark-secondary-color: #1d4ed8;
  --dark-accent-color: #60a5fa;
  --dark-text-primary: #f9fafb;
  --dark-text-secondary: #d1d5db;
  --dark-bg-primary: #111827;
  --dark-bg-secondary: #1f2937;
  --dark-bg-tertiary: #374151;
  --dark-border-color: #4b5563;
  --dark-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  --dark-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

/* Dark Mode Styles */
.dark-mode {
  --primary-color: var(--dark-primary-color);
  --secondary-color: var(--dark-secondary-color);
  --accent-color: var(--dark-accent-color);
  --text-primary: var(--dark-text-primary);
  --text-secondary: var(--dark-text-secondary);
  --bg-primary: var(--dark-bg-primary);
  --bg-secondary: var(--dark-bg-secondary);
  --bg-tertiary: var(--dark-bg-tertiary);
  --border-color: var(--dark-border-color);
  --shadow: var(--dark-shadow);
  --shadow-lg: var(--dark-shadow-lg);
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  transition: all 0.3s ease;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Navigation Styles */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background-color: var(--bg-primary);
  box-shadow: var(--shadow);
  z-index: 1000;
  transition: all 0.3s ease;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 70px;
}

.nav-logo h2 {
  color: var(--primary-color);
  font-size: 1.5rem;
  font-weight: 700;
}

.nav-logo i {
  margin-right: 8px;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 30px;
}

.nav-link {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
  position: relative;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary-color);
}

.nav-link.active::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--primary-color);
}

.theme-toggle {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.theme-toggle:hover {
  background-color: var(--bg-tertiary);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
}

.bar {
  width: 25px;
  height: 3px;
  background-color: var(--text-primary);
  margin: 3px 0;
  transition: 0.3s;
}

/* Hero Section */
.hero-section {
  padding: 120px 0 80px;
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--secondary-color) 100%
  );
  color: white;
  text-align: center;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 20px;
}

.hero-subtitle {
  font-size: 1.2rem;
  margin-bottom: 40px;
  opacity: 0.9;
}

.search-container {
  margin-bottom: 50px;
}

.search-box {
  display: flex;
  max-width: 500px;
  margin: 0 auto;
  background: white;
  border-radius: 50px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

#search-input {
  flex: 1;
  padding: 15px 20px;
  border: none;
  outline: none;
  font-size: 1rem;
  color: var(--text-primary);
}

.search-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 15px 25px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.search-btn:hover {
  background: var(--secondary-color);
}

.quick-links {
  margin-top: 50px;
}

.quick-links h3 {
  margin-bottom: 30px;
  font-size: 1.5rem;
}

.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  max-width: 800px;
  margin: 0 auto;
}

.quick-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 25px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  text-decoration: none;
  color: white;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.quick-link:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-5px);
}

.quick-link i {
  font-size: 2rem;
  margin-bottom: 10px;
}

/* Section Styles */
.section-title {
  text-align: center;
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 50px;
  color: var(--text-primary);
}

.subjects-section,
.resources-section,
.downloads-section,
.contact-section {
  padding: 80px 0;
}

.subjects-section {
  background-color: var(--bg-secondary);
}

/* Subjects Grid */
.subjects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.subject-card {
  background: var(--bg-primary);
  padding: 30px;
  border-radius: 15px;
  box-shadow: var(--shadow);
  text-align: center;
  transition: all 0.3s ease;
  border: 1px solid var(--border-color);
}

.subject-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-lg);
}

.subject-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--accent-color)
  );
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.subject-icon i {
  font-size: 2rem;
  color: white;
}

.subject-card h3 {
  font-size: 1.5rem;
  margin-bottom: 15px;
  color: var(--text-primary);
}

.subject-card p {
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.subject-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 12px 30px;
  border-radius: 25px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
}

.subject-btn:hover {
  background: var(--secondary-color);
  transform: scale(1.05);
}

/* Resources Grid */
.resources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
}

.resource-card {
  background: var(--bg-primary);
  padding: 30px;
  border-radius: 15px;
  box-shadow: var(--shadow);
  text-align: center;
  transition: all 0.3s ease;
  border: 1px solid var(--border-color);
}

.resource-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.resource-icon {
  width: 60px;
  height: 60px;
  background: var(--primary-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.resource-icon i {
  font-size: 1.5rem;
  color: white;
}

.resource-card h3 {
  font-size: 1.3rem;
  margin-bottom: 15px;
  color: var(--text-primary);
}

.resource-card p {
  color: var(--text-secondary);
}

/* Downloads Section */
.downloads-section {
  background-color: var(--bg-secondary);
}

.downloads-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.download-card {
  background: var(--bg-primary);
  padding: 30px;
  border-radius: 15px;
  box-shadow: var(--shadow);
  text-align: center;
  transition: all 0.3s ease;
  border: 1px solid var(--border-color);
}

.download-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.download-icon {
  width: 70px;
  height: 70px;
  background: var(--accent-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.download-icon i {
  font-size: 1.8rem;
  color: white;
}

.download-card h3 {
  font-size: 1.3rem;
  margin-bottom: 15px;
  color: var(--text-primary);
}

.download-card p {
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.download-btn {
  background: var(--accent-color);
  color: white;
  border: none;
  padding: 12px 25px;
  border-radius: 25px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
}

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

/* Contact Section */
.contact-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  align-items: start;
}

.contact-info h3 {
  font-size: 1.8rem;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.contact-info p {
  color: var(--text-secondary);
  margin-bottom: 30px;
}

.contact-details {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 15px;
}

.contact-item i {
  width: 40px;
  height: 40px;
  background: var(--primary-color);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.contact-form {
  background: var(--bg-primary);
  padding: 30px;
  border-radius: 15px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
}

.submit-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 15px 30px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  font-size: 1rem;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}

.submit-btn:hover {
  background: var(--secondary-color);
  transform: translateY(-2px);
}

/* Footer */
.footer {
  background: var(--bg-secondary);
  padding: 50px 0 20px;
  margin-top: 80px;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
  margin-bottom: 30px;
}

.footer-section h3,
.footer-section h4 {
  color: var(--text-primary);
  margin-bottom: 20px;
}

.footer-section p {
  color: var(--text-secondary);
  line-height: 1.6;
}

.footer-section ul {
  list-style: none;
}

.footer-section ul li {
  margin-bottom: 10px;
}

.footer-section ul li a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-section ul li a:hover {
  color: var(--primary-color);
}

.social-links {
  display: flex;
  gap: 15px;
}

.social-links a {
  width: 40px;
  height: 40px;
  background: var(--primary-color);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all 0.3s ease;
}

.social-links a:hover {
  background: var(--secondary-color);
  transform: translateY(-3px);
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  color: var(--text-secondary);
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
}

.modal-content {
  background-color: var(--bg-primary);
  margin: 5% auto;
  padding: 30px;
  border-radius: 15px;
  width: 90%;
  max-width: 800px;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-lg);
}

.close {
  color: var(--text-secondary);
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  position: absolute;
  right: 20px;
  top: 20px;
}

.close:hover {
  color: var(--text-primary);
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
  .nav-menu {
    position: fixed;
    left: -100%;
    top: 70px;
    flex-direction: column;
    background-color: var(--bg-primary);
    width: 100%;
    text-align: center;
    transition: 0.3s;
    box-shadow: var(--shadow);
    padding: 20px 0;
  }

  .nav-menu.active {
    left: 0;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-toggle.active .bar:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle.active .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }

  .nav-toggle.active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

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

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

  .search-box {
    flex-direction: column;
    border-radius: 15px;
  }

  #search-input {
    border-radius: 15px 15px 0 0;
  }

  .search-btn {
    border-radius: 0 0 15px 15px;
  }

  .links-grid {
    grid-template-columns: 1fr;
  }

  .subjects-grid,
  .resources-grid,
  .downloads-grid {
    grid-template-columns: 1fr;
  }

  .contact-content {
    grid-template-columns: 1fr;
    gap: 30px;
  }

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

  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .modal-content {
    margin: 10% auto;
    width: 95%;
    padding: 20px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 15px;
  }

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

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

  .subject-card,
  .resource-card,
  .download-card {
    padding: 20px;
  }

  .contact-form {
    padding: 20px;
  }
}

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

.fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

/* Scroll to top button */
.scroll-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all 0.3s ease;
  z-index: 1000;
}

.scroll-top:hover {
  background: var(--secondary-color);
  transform: translateY(-3px);
}

.scroll-top.show {
  display: flex;
}

/* ===== VIDEO SECTION STYLES ===== */
.videos-section {
  padding: 80px 0;
  background: var(--bg-primary);
}

.videos-section .section-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-bottom: 50px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Video Categories Filter */
.video-categories {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 50px;
}

.category-btn {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 2px solid var(--border-color);
  padding: 12px 24px;
  border-radius: 25px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
  font-size: 0.95rem;
}

.category-btn:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.category-btn.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  box-shadow: var(--shadow);
}

/* Videos Container */
.videos-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 30px;
  margin-bottom: 50px;
}

/* Video Card */
.video-card {
  background: var(--bg-secondary);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.3s ease;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow);
}

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

/* Video Thumbnail */
.video-thumbnail {
  position: relative;
  width: 100%;
  height: 220px;
  overflow: hidden;
  background: #000;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  transition: all 0.3s ease;
}

.video-thumbnail::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.3) 0%,
    rgba(0, 0, 0, 0) 50%
  );
  z-index: 1;
  pointer-events: none;
}

.video-thumbnail iframe {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all 0.5s ease;
}

.video-card:hover .video-thumbnail iframe {
  transform: scale(1.03);
}

.video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.5);
  cursor: pointer;
  transition: all 0.3s ease;
}

.video-overlay i {
  width: 60px;
  height: 60px;
  background: rgba(37, 99, 235, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.video-card:hover .video-overlay {
  background-color: rgba(0, 0, 0, 0.3);
}

.video-card:hover .video-overlay i {
  transform: scale(1.1);
  background: rgba(29, 78, 216, 0.9);
}

/* Video Info */
.video-info {
  padding: 24px;
}

.video-info h3 {
  color: var(--text-primary);
  font-size: 1.3rem;
  margin-bottom: 8px;
  line-height: 1.4;
  font-weight: 600;
}

.video-subject {
  color: var(--primary-color);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.video-description {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 16px;
}

.video-stats {
  display: flex;
  gap: 20px;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

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

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

/* Load More Button */
.load-more-container {
  text-align: center;
}

.load-more-btn {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  color: white;
  border: none;
  padding: 16px 32px;
  border-radius: 50px;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow);
}

.load-more-btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.load-more-btn i {
  transition: all 0.3s ease;
}

.load-more-btn:hover i {
  transform: rotate(90deg);
}

/* Video Category Filtering */
.video-card[data-category] {
  display: block;
  animation: fadeInUp 0.5s ease forwards;
}

.video-card.hidden {
  display: none;
}

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

/* Responsive Design for Video Section */
@media (max-width: 768px) {
  .videos-section {
    padding: 60px 0;
  }

  .video-categories {
    margin-bottom: 40px;
  }

  .category-btn {
    padding: 10px 18px;
    font-size: 0.9rem;
  }

  .videos-container {
    grid-template-columns: 1fr;
    gap: 25px;
    margin-bottom: 40px;
  }

  .video-thumbnail {
    height: 200px;
  }

  .video-info {
    padding: 20px;
  }

  .video-info h3 {
    font-size: 1.2rem;
  }

  .video-stats {
    gap: 15px;
  }

  .load-more-btn {
    padding: 14px 28px;
    font-size: 0.95rem;
  }
}

@media (max-width: 480px) {
  .videos-container {
    grid-template-columns: 1fr;
  }

  .video-thumbnail {
    height: 180px;
  }

  .video-info {
    padding: 16px;
  }

  .category-btn {
    padding: 8px 16px;
    font-size: 0.85rem;
  }
}
