* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #0a0a0a 0%, #1a0d2e 50%, #2d1b4e 100%);
  background-attachment: fixed;
  color: #ffffff;
  overflow-x: hidden;
  min-height: 100vh;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Navigation */
.navbar {
  background: rgba(10, 10, 10, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(155, 138, 251, 0.2);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 15px 0;
  animation: slideDown 0.6s ease-out;
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.navbar-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}

.logo a {
  font-size: 1.8rem;
  font-weight: bold;
  text-decoration: none;
  background: linear-gradient(135deg, #9b8afb 0%, #c9b3ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: glow 3s ease-in-out infinite;
}

@keyframes glow {
  0%,
  100% {
    filter: drop-shadow(0 0 10px rgba(155, 138, 251, 0.5));
  }
  50% {
    filter: drop-shadow(0 0 20px rgba(155, 138, 251, 0.8));
  }
}

.menu-toggle {
  display: none;
}

.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 5px;
}

.hamburger .bar {
  width: 25px;
  height: 3px;
  background: #9b8afb;
  border-radius: 3px;
  transition: 0.3s;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 30px;
}

.nav-menu a {
  color: #ffffff;
  text-decoration: none;
  transition: color 0.3s;
  position: relative;
  padding: 5px 0;
}

.mobile-nav-extras {
  display: none;
  width: 100%;
  padding-top: 8px;
  border-top: 1px solid rgba(155, 138, 251, 0.06);
}

.mobile-nav-extras .search-container {
  width: 100%;
}

.mobile-nav-extras .cta-buttons {
  width: 100%;
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.mobile-nav-extras .cta-buttons .btn {
  flex: 1;
  width: auto;
}

.nav-menu a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: #9b8afb;
  transition: width 0.3s;
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
  width: 100%;
}

.nav-menu a.active {
  color: #9b8afb;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.search-container {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input {
  background: rgba(155, 138, 251, 0.1);
  border: 1px solid rgba(155, 138, 251, 0.3);
  border-radius: 20px;
  padding: 8px 40px 8px 15px;
  color: #ffffff;
  outline: none;
  transition: all 0.3s;
  width: 200px;
}

.search-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.search-input:focus {
  border-color: #9b8afb;
  box-shadow: 0 0 15px rgba(155, 138, 251, 0.3);
  width: 250px;
}

.search-btn {
  position: absolute;
  right: 5px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 5px;
  display: flex;
  align-items: center;
}

.search-btn img {
  width: 20px;
  height: 20px;
  filter: brightness(0) invert(1);
  opacity: 0.7;
  transition: all 0.3s;
}

.search-btn:hover img {
  opacity: 1;
  transform: scale(1.1);
}

.cta-buttons {
  display: flex;
  gap: 10px;
}

.btn {
  padding: 10px 25px;
  border-radius: 25px;
  text-decoration: none;
  font-size: 0.95rem;
  transition: all 0.3s;
  border: none;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-secondary {
  background: transparent;
  border: 1px solid rgba(155, 138, 251, 0.5);
  color: #ffffff;
}

.btn-secondary:hover {
  border-color: #9b8afb;
  background: rgba(155, 138, 251, 0.1);
  transform: translateY(-2px);
}

.btn-primary {
  background: linear-gradient(135deg, #9b8afb 0%, #7a68d6 100%);
  color: white;
  box-shadow: 0 5px 15px rgba(155, 138, 251, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(155, 138, 251, 0.5);
}

.btn img {
  width: 16px;
  height: 16px;
  filter: brightness(0) invert(1);
}

/* Page Hero */
.page-hero {
  padding: 80px 0 60px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.page-hero::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(
    circle,
    rgba(155, 138, 251, 0.15) 0%,
    transparent 70%
  );
  animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.5;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 0.8;
  }
}

.page-hero h1 {
  font-size: 3.5rem;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #ffffff 0%, #9b8afb 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
  z-index: 1;
  animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-hero p {
  font-size: 1.3rem;
  color: #b8b8b8;
  position: relative;
  z-index: 1;
  animation: fadeInUp 0.8s ease-out 0.2s backwards;
}

/* Course Filters */
.course-filters {
  padding: 40px 0;
  background: rgba(10, 10, 10, 0.3);
  border-top: 1px solid rgba(155, 138, 251, 0.2);
  border-bottom: 1px solid rgba(155, 138, 251, 0.2);
  backdrop-filter: blur(10px);
  animation: fadeIn 0.8s ease-out 0.3s backwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.filter-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 30px;
  flex-wrap: wrap;
}

.filter-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1;
}

.filter-tabs input[type="radio"] {
  display: none;
}

.filter-tabs .tab {
  padding: 10px 25px;
  background: rgba(155, 138, 251, 0.05);
  border: 1px solid rgba(155, 138, 251, 0.3);
  border-radius: 25px;
  color: #b8b8b8;
  cursor: pointer;
  transition: all 0.3s;
  white-space: nowrap;
}

.filter-tabs .tab:hover {
  background: rgba(155, 138, 251, 0.1);
  border-color: #9b8afb;
  color: #ffffff;
  transform: translateY(-2px);
}

.filter-tabs input[type="radio"]:checked + .tab {
  background: linear-gradient(135deg, #9b8afb 0%, #7a68d6 100%);
  border-color: #9b8afb;
  color: #ffffff;
  box-shadow: 0 5px 15px rgba(155, 138, 251, 0.3);
}

.sort-filter {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sort-filter label {
  color: #b8b8b8;
  font-size: 0.95rem;
}

.sort-select {
  background: rgba(155, 138, 251, 0.1);
  border: 1px solid rgba(155, 138, 251, 0.3);
  border-radius: 10px;
  padding: 10px 35px 10px 15px;
  color: #ffffff;
  outline: none;
  cursor: pointer;
  transition: all 0.3s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239B8AFB' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.sort-select:hover {
  border-color: #9b8afb;
  box-shadow: 0 0 15px rgba(155, 138, 251, 0.2);
}

.sort-select option {
  background: #1a0d2e;
  color: #ffffff;
}

/* Course Listings */
.course-listings {
  padding: 60px 0;
}

.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 30px;
  margin-bottom: 60px;
}

.course-card {
  background: rgba(155, 138, 251, 0.05);
  border: 1px solid rgba(155, 138, 251, 0.2);
  border-radius: 20px;
  overflow: hidden;
  transition: all 0.4s;
  animation: fadeInUp 0.6s ease-out;
  position: relative;
}

.course-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(155, 138, 251, 0.1),
    transparent
  );
  transition: left 0.6s;
  z-index: 0;
}

.course-card:hover::before {
  left: 100%;
}

.course-card:hover {
  transform: translateY(-10px);
  border-color: #9b8afb;
  box-shadow: 0 20px 60px rgba(155, 138, 251, 0.3);
}

.course-image {
  position: relative;
  height: 220px;
  background: linear-gradient(
    135deg,
    rgba(155, 138, 251, 0.2),
    rgba(122, 104, 214, 0.2)
  );
  overflow: hidden;
}

.course-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}

.course-card:hover .course-image img {
  transform: scale(1.1) rotate(2deg);
}

.course-badge {
  position: absolute;
  top: 15px;
  right: 15px;
  background: linear-gradient(135deg, #9b8afb 0%, #7a68d6 100%);
  color: white;
  padding: 6px 18px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 5px 15px rgba(155, 138, 251, 0.4);
  animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

.course-content {
  padding: 25px;
  position: relative;
  z-index: 1;
}

.course-content h3 {
  color: #ffffff;
  font-size: 1.5rem;
  margin-bottom: 12px;
  transition: color 0.3s;
}

.course-card:hover h3 {
  color: #9b8afb;
}

.course-content > p {
  color: #b8b8b8;
  line-height: 1.6;
  margin-bottom: 20px;
}

.course-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 15px 0;
  border-top: 1px solid rgba(155, 138, 251, 0.2);
  border-bottom: 1px solid rgba(155, 138, 251, 0.2);
  gap: 15px;
  flex-wrap: wrap;
}

.course-meta span {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #b8b8b8;
  font-size: 0.9rem;
}

.course-meta img {
  width: 16px;
  height: 16px;
  filter: brightness(0) invert(1);
  opacity: 0.7;
}

.price {
  font-size: 1.8rem !important;
  font-weight: bold;
  color: #9b8afb !important;
}

.duration,
.level {
  font-size: 0.9rem;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 40px;
}

.page-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 45px;
  height: 45px;
  background: rgba(155, 138, 251, 0.05);
  border: 1px solid rgba(155, 138, 251, 0.3);
  border-radius: 10px;
  color: #ffffff;
  text-decoration: none;
  transition: all 0.3s;
  font-weight: 500;
}

.page-link:hover {
  background: rgba(155, 138, 251, 0.1);
  border-color: #9b8afb;
  transform: translateY(-2px);
}

.page-link.active {
  background: linear-gradient(135deg, #9b8afb 0%, #7a68d6 100%);
  border-color: #9b8afb;
  box-shadow: 0 5px 15px rgba(155, 138, 251, 0.3);
}

.page-link.next img {
  width: 20px;
  height: 20px;
  filter: brightness(0) invert(1);
}

.page-dots {
  color: #9b8afb;
  font-size: 1.2rem;
  padding: 0 10px;
}

/* Footer */
.footer {
  background: rgba(10, 10, 10, 0.8);
  border-top: 1px solid rgba(155, 138, 251, 0.2);
  padding: 60px 0 30px;
  margin-top: 80px;
}

.footer-content {
  display: grid;
  grid-template-columns: 2fr 3fr 2fr;
  gap: 60px;
  margin-bottom: 40px;
}

.footer-brand .logo a {
  font-size: 2rem;
}

.footer-brand p {
  color: #b8b8b8;
  line-height: 1.7;
  margin: 20px 0;
}

.social-links {
  display: flex;
  gap: 15px;
}

.social-link {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(155, 138, 251, 0.1);
  border: 1px solid rgba(155, 138, 251, 0.3);
  border-radius: 50%;
  transition: all 0.3s;
}

.social-link img {
  width: 20px;
  height: 20px;
  filter: brightness(0) invert(1);
}

.social-link:hover {
  background: rgba(155, 138, 251, 0.2);
  border-color: #9b8afb;
  transform: translateY(-3px) rotate(360deg);
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

.footer-column h3 {
  color: #9b8afb;
  margin-bottom: 20px;
  font-size: 1.1rem;
}

.footer-column ul {
  list-style: none;
}

.footer-column ul li {
  margin-bottom: 12px;
}

.footer-column ul li a {
  color: #b8b8b8;
  text-decoration: none;
  transition: all 0.3s;
  display: inline-block;
}

.footer-column ul li a:hover {
  color: #9b8afb;
  transform: translateX(5px);
}

.footer-newsletter h3 {
  color: #9b8afb;
  margin-bottom: 15px;
  font-size: 1.2rem;
}

.footer-newsletter p {
  color: #b8b8b8;
  line-height: 1.6;
  margin-bottom: 20px;
}

.newsletter-form {
  display: flex;
  gap: 10px;
}

.newsletter-form input {
  flex: 1;
  padding: 12px 15px;
  background: rgba(155, 138, 251, 0.05);
  border: 1px solid rgba(155, 138, 251, 0.3);
  border-radius: 8px;
  color: #ffffff;
  outline: none;
  transition: all 0.3s;
}

.newsletter-form input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.newsletter-form input:focus {
  border-color: #9b8afb;
  box-shadow: 0 0 15px rgba(155, 138, 251, 0.2);
}

.newsletter-form button {
  padding: 12px 25px;
  white-space: nowrap;
}

.footer-bottom {
  text-align: center;
  padding-top: 30px;
  border-top: 1px solid rgba(155, 138, 251, 0.1);
  color: #b8b8b8;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .footer-content {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .footer-links {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  .nav-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(10, 10, 10, 0.98);
    flex-direction: column;
    padding: 20px;
    border-top: 1px solid rgba(155, 138, 251, 0.2);
    transform: translateX(-100%);
    transition: transform 0.3s;
  }

  .menu-toggle:checked ~ .nav-menu {
    transform: translateX(0);
  }

  .menu-toggle:checked ~ .hamburger .bar:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
  }

  .menu-toggle:checked ~ .hamburger .bar:nth-child(2) {
    opacity: 0;
  }

  .menu-toggle:checked ~ .hamburger .bar:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
  }

  .navbar-container {
    flex-wrap: wrap;
  }

  .nav-actions {
    flex-direction: column;
    width: 100%;
    gap: 15px;
    order: 3;
  }

  .search-container {
    width: 100%;
  }

  .search-input {
    width: 100%;
  }

  .search-input:focus {
    width: 100%;
  }

  .cta-buttons {
    width: 100%;
    flex-direction: column;
  }

  .cta-buttons .btn {
    width: 100%;
    text-align: center;
  }

  .page-hero h1 {
    font-size: 2.5rem;
  }

  .page-hero p {
    font-size: 1.1rem;
  }

  .filter-container {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-tabs {
    justify-content: center;
  }

  .sort-filter {
    justify-content: space-between;
  }

  .courses-grid {
    grid-template-columns: 1fr;
  }

  .footer-links {
    grid-template-columns: 1fr;
  }

  .newsletter-form {
    flex-direction: column;
  }
}

@media (max-width: 768px) {
  /* Force mobile navbar behavior */
  .hamburger {
    display: flex;
  }
  .nav-actions {
    display: none !important;
  }
  .nav-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(10, 10, 10, 0.98);
    flex-direction: column;
    padding: 18px 16px;
    border-top: 1px solid rgba(155, 138, 251, 0.2);
    transform: translateY(-10px) scaleY(0);
    transform-origin: top center;
    transition: transform 0.28s ease, opacity 0.28s ease;
    opacity: 0;
    pointer-events: none;
    gap: 12px;
  }
  .menu-toggle:checked ~ .nav-menu {
    transform: translateY(0) scaleY(1);
    opacity: 1;
    pointer-events: auto;
  }
  .menu-toggle:checked ~ .nav-menu .mobile-nav-extras {
    display: block;
  }
}

@media (max-width: 480px) {
  .page-hero h1 {
    font-size: 2rem;
  }

  .filter-tabs .tab {
    font-size: 0.85rem;
    padding: 8px 18px;
  }

  .pagination {
    gap: 5px;
  }

  .page-link {
    width: 40px;
    height: 40px;
    font-size: 0.9rem;
  }
}

/* Additional Animations */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

/* Smooth Scroll */
html {
  scroll-behavior: smooth;
}

/* Selection Color */
::selection {
  background: rgba(155, 138, 251, 0.3);
  color: #ffffff;
}

::-moz-selection {
  background: rgba(155, 138, 251, 0.3);
  color: #ffffff;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: #0a0a0a;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #9b8afb 0%, #7a68d6 100%);
  border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #c9b3ff 0%, #9b8afb 100%);
}

/* Final mobile override: ensure hamburger dropdown shows mobile extras and top actions hidden */
@media (max-width: 768px) {
  .hamburger {
    display: flex !important;
  }
  .nav-actions {
    display: none !important;
  }
  .nav-menu {
    display: flex !important;
  }
  .mobile-nav-extras {
    display: none;
  }
  .menu-toggle:checked ~ .nav-menu {
    transform: translateY(0) scaleY(1);
    opacity: 1;
    pointer-events: auto;
  }
  .menu-toggle:checked ~ .nav-menu .mobile-nav-extras {
    display: block;
  }
}
