/* ===================================
   Courses Page Styles
   Modern Dark Theme
   =================================== */

/* Main Container */
.courses-container {
  min-height: 100vh;
  padding: 140px 20px 80px 20px;
  background: linear-gradient(
    135deg,
    #000000 0%,
    #000000 50%,
    rgb(0, 0, 0) 100%
  );
  direction: rtl;
  font-family: "Emkan", sans-serif;
}

/* ===================================
   Header Section
   =================================== */

.courses-header {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 60px auto;
  animation: fadeInDown 0.8s ease;
}

.courses-header__badge {
  display: inline-block;
  padding: 8px 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 20px;
}

.courses-header__title {
  font-size: 3rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 16px 0;
  line-height: 1.3;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.courses-header__subtitle {
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
  line-height: 1.6;
}

/* ===================================
   Courses Grid
   =================================== */

.courses-grid {
  max-width: 1500px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40px;
  padding: 0 40px;
}

/* ===================================
   Course Card
   =================================== */

.course-card {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  overflow: hidden;
  transition: all 0.4s ease;
  animation: fadeInUp 0.8s ease;
  animation-fill-mode: both;
  display: flex;
  flex-direction: column;
}

.course-card:nth-child(1) {
  animation-delay: 0.1s;
}

.course-card:nth-child(2) {
  animation-delay: 0.2s;
}

.course-card:hover {
  transform: translateY(-8px);
  border-color: rgba(102, 126, 234, 0.4);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
}

/* ===================================
   Course Media
   =================================== */

.course-media {
  position: relative;
  width: 100%;
  height: 320px;
  overflow: hidden;
  cursor: pointer;
  background: #000;
}

.course-media img,
.course-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all 0.5s ease;
}

.course-card:hover .course-media img {
  transform: scale(1.08);
}

.course-media video {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.course-media:hover video {
  opacity: 1;
}

.course-media:hover img {
  opacity: 0;
}

/* Category Badge */
.course-badge {
  position: absolute;
  top: 20px;
  right: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 10px 24px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
  z-index: 10;
}

/* Play Overlay */
.play-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  width: 80px;
  height: 80px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  z-index: 5;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.course-media:hover .play-overlay {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.play-icon {
  width: 0;
  height: 0;
  border-left: 22px solid #667eea;
  border-top: 13px solid transparent;
  border-bottom: 13px solid transparent;
  margin-left: 6px;
}

/* ===================================
   Course Content
   =================================== */

.course-content {
  padding: 28px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.course-title {
  font-size: 1.6rem;
  color: #fff;
  font-weight: 700;
  margin: 0 0 16px 0;
  line-height: 1.4;
}

/* Course Meta */
.course-meta {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.course-meta__item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
}

.course-meta__item svg {
  width: 18px;
  height: 18px;
  color: #667eea;
}

.course-description {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.9;
  margin-bottom: 16px;
  max-height: 80px;
  overflow: hidden;
  position: relative;
  transition: max-height 0.4s ease;
}

.course-description.expanded {
  max-height: 500px;
}

.course-description p {
  margin: 0;
}

.read-more-btn {
  background: none;
  border: none;
  color: #667eea;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0;
  font-family: "Emkan", sans-serif;
  transition: color 0.3s ease;
  align-self: flex-start;
}

.read-more-btn:hover {
  color: #764ba2;
}

/* ===================================
   Course Footer
   =================================== */

.course-footer {
  padding: 0 28px 28px 28px;
}

.view-course-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px 32px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  font-family: "Emkan", sans-serif;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.view-course-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 35px rgba(102, 126, 234, 0.5);
}

.view-course-btn svg {
  width: 18px;
  height: 18px;
  transform: rotate(180deg);
  transition: transform 0.3s ease;
}

.view-course-btn:hover svg {
  transform: rotate(180deg) translateX(-4px);
}

/* ===================================
   CTA Section
   =================================== */

.courses-cta {
  max-width: 800px;
  margin: 80px auto 0 auto;
}

.courses-cta__content {
  text-align: center;
  padding: 60px 40px;
  background: linear-gradient(
    135deg,
    rgba(102, 126, 234, 0.15),
    rgba(118, 75, 162, 0.15)
  );
  backdrop-filter: blur(20px);
  border: 1px solid rgba(102, 126, 234, 0.3);
  border-radius: 32px;
  position: relative;
  overflow: hidden;
}

.courses-cta__content::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle,
    rgba(102, 126, 234, 0.1) 0%,
    transparent 70%
  );
  animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

.courses-cta__title {
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 16px 0;
  position: relative;
}

.courses-cta__description {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.8);
  margin: 0 0 32px 0;
  line-height: 1.7;
  position: relative;
}

.courses-cta__button {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 18px 48px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  font-family: "Emkan", sans-serif;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
  position: relative;
}

.courses-cta__button:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 15px 40px rgba(102, 126, 234, 0.5);
}

.courses-cta__button svg {
  width: 20px;
  height: 20px;
  transform: rotate(180deg);
  transition: transform 0.3s ease;
}

.courses-cta__button:hover svg {
  transform: rotate(180deg) translateX(-4px);
}

/* ===================================
   Animations
   =================================== */

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===================================
   Responsive Design
   =================================== */

@media (max-width: 1024px) {
  .courses-container {
    padding-top: 120px;
  }

  .courses-grid {
    grid-template-columns: 1fr;
    max-width: 600px;
  }

  .course-media {
    height: 280px;
  }
}

@media (max-width: 768px) {
  .courses-container {
    padding: 100px 15px 60px 15px;
  }

  .courses-header {
    margin-bottom: 40px;
  }

  .courses-header__title {
    font-size: 2.2rem;
  }

  .courses-header__subtitle {
    font-size: 1rem;
  }

  .courses-grid {
    gap: 24px;
    padding: 0;
  }

  .course-media {
    height: 250px;
  }

  .course-title {
    font-size: 1.4rem;
  }

  .course-content {
    padding: 24px;
  }

  .course-footer {
    padding: 0 24px 24px 24px;
  }

  .courses-cta {
    margin-top: 60px;
  }

  .courses-cta__content {
    padding: 40px 24px;
    border-radius: 24px;
  }

  .courses-cta__title {
    font-size: 1.6rem;
  }

  .courses-cta__description {
    font-size: 1rem;
  }

  .courses-cta__button {
    padding: 16px 36px;
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .courses-container {
    padding: 90px 12px 50px 12px;
  }

  .courses-header__badge {
    font-size: 12px;
    padding: 6px 18px;
  }

  .courses-header__title {
    font-size: 1.8rem;
  }

  .course-media {
    height: 220px;
  }

  .course-badge {
    padding: 8px 18px;
    font-size: 12px;
  }

  .course-title {
    font-size: 1.2rem;
  }

  .course-content {
    padding: 20px;
  }

  .course-meta {
    flex-wrap: wrap;
    gap: 12px;
  }

  .course-footer {
    padding: 0 20px 20px 20px;
  }

  .view-course-btn {
    padding: 14px 24px;
    font-size: 0.9rem;
  }

  .play-overlay {
    width: 60px;
    height: 60px;
  }

  .play-icon {
    border-left: 16px solid #667eea;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    margin-left: 4px;
  }
}
