@import url("https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700&display=swap");

:root {
  --primary-color: #0d47a1;
  --secondary-color: #1565c0;
  --text-color: #333;
  --light-bg: #f5f5f5;
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Cairo", sans-serif;
}

#userIconAlt {
  font-size: 14px;
  color: #0055d2;
  cursor: pointer;
  margin-right: 10px;
  display: flex;
  align-items: center;
  gap: 17px;
}

#userIconAlt a {
  text-decoration: none;
  color: #0055d2;
  font-size: 14px;
}

body {
  direction: rtl;
  background-color: #fff;
  color: var(--text-color);
}

/* Header Styles */
header {
  background-color: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 1000;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1300px;
  margin: 0 auto;
}
nav {
  display: flex;
  justify-content: flex-end; /* أو space-between حسب الحاجة */
  align-items: center;
  max-width: 1300px;
  direction:rtl; /* يضمن ترتيب العناصر صح */
  gap: 250px;
}

@media (min-width: 1600px) {
  nav {
    max-width: 1650px;
  }
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
}

.code-icon {
  font-size: 1.8rem;
  font-weight: bold;
}

.nav-links {
  margin-left: auto; /* يجعلها تروح أقصى اليمين */
  display: flex;
  align-items: center;


}

.nav-links a {
  text-decoration: none;
  color: var(--text-color);
  position: relative;
  transition: var(--transition);
}

.nav-links a::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary-color);
  transition: var(--transition);
}

.nav-links a:hover::after {
  width: 100%;
}

.login-btns {
  display: flex;
  gap: 1rem;
}

.login-btns button:last-child {
  background-color: transparent;
  color: var(--primary-color);
  padding: 0.5rem 1.5rem;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid var(--primary-color);
}

.login-btn {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 0.5rem 1.5rem;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition);
}

.login-btns .login-btn:first-of-type a {
  text-decoration: none;
  color: white;
}

.login-btns .login-btn:last-of-type a {
  text-decoration: none;
  color: var(--primary-color);
}

.login-btn:hover {
  background-color: var(--secondary-color);
  transform: translateY(-2px);
}

/* Hero Section */
.hero {
  background: linear-gradient(rgba(13, 71, 161, 0.9), rgba(13, 71, 161, 0.9)),
    url("https://images.unsplash.com/photo-1498050108023-c5249f4df085?ixlib=rb-1.2.1&auto=format&fit=crop&w=1920&q=80")
      center/cover;
  color: white;
  padding: 4rem 2rem;
  text-align: center;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin-top: 0 !important;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  animation: fadeInDown 1s ease;
}

.hero p {
  animation: fadeInUp 1s ease;
}

/* Courses Section */
.courses {
  max-width: 1300px;
  margin: 4rem auto;
  padding: 0 2rem;
}

@media (min-width: 1600px) {
  .courses {
    max-width: 1650px;
  }
}

.courses h2 {
  text-align: center;
  margin-bottom: 1rem;
  font-size: 2rem;
  color: var(--primary-color);
}

.subtitle {
  text-align: center;
  color: #666;
  margin-bottom: 3rem;
  font-size: 1.1rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.courses-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 3rem;
}

@media (min-width: 1600px) {
  .courses-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.course-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: var(--transition);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.course-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

.course-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.card-content {
  padding: 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.card-content h3 {
  margin-bottom: 1rem;
  font-size: 1.2rem;
  color: var(--primary-color);
  line-height: 1.4;
}

.card-content p {
  color: #666;
  margin-bottom: 1.5rem;
  line-height: 1.6;
  flex-grow: 1;
}

.rating {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 1rem 0;
  padding: 0.5rem 0;
  border-top: 1px solid #eee;
  border-bottom: 1px solid #eee;
}

.stars {
  color: #ffd700;
  font-size: 1.1rem;
}

.price {
  font-weight: bold;
  color: var(--primary-color);
  font-size: 1.1rem;
}

.buttons {
  display: flex;
  gap: 1rem;
  margin-top: auto;
}

.view-btn,
.register-btn {
  padding: 0.75rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  flex: 1;
  transition: var(--transition);
  font-weight: 600;
  text-align: center;
  font-size: 0.95rem;
}

.view-btn {
  background-color: white;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
}

.view-btn:hover {
  background-color: var(--primary-color);
  color: white;
  transform: translateY(-2px);
}

.register-btn {
  background-color: var(--primary-color);
  border: none;
  color: white;
}

.register-btn:hover {
  background-color: var(--secondary-color);
  transform: translateY(-2px);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 3rem;
}

.pagination a {
  text-decoration: none;
  color: var(--text-color);
  transition: var(--transition);
  font-weight: 600;
}

.numbers {
  display: flex;
  gap: 0.5rem;
}

.numbers a {
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: var(--transition);
  border: 2px solid transparent;
}

.numbers a:hover {
  background-color: var(--secondary-color);
  color: white;
}

.numbers a.active {
  background-color: var(--primary-color);
  color: white;
}

/* Stats Section */
/* .stats {
    background-color: var(--light-bg);
    padding: 4rem 2rem;
    display: flex;
    justify-content: space-around;
    text-align: center;
}

.stat-item h3 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
} */

/* Footer */
/* footer {
    background-color: var(--primary-color);
    color: white;
    padding: 4rem 2rem 1rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.footer-section h4 {
    margin-bottom: 1.5rem;
}

.footer-link {
    color: white;
    text-decoration: none;
    display: block;
    margin-bottom: 0.5rem;
    transition: var(--transition);
}

.footer-link:hover {
    color: #90caf9;
    transform: translateX(-5px);
}

.footer-bottom {
    text-align: center;
    margin-top: 3rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
} */

/* Animations */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive Design */
@media (max-width: 1200px) {
  .courses-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 992px) {
  .courses-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .stats {
    flex-direction: column;
    gap: 2rem;
  }

  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-logo {
    justify-content: center;
  }
}

@media (max-width: 576px) {
  .courses-grid {
    grid-template-columns: 1fr;
  }

  .buttons {
    flex-direction: column;
  }
}
