@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazir-font@v30.1.0/dist/font-face.css');

/* ------------------ ROOT ------------------ */
:root {
  --primary-color: #f7af68;
  --secondary-color: #465C88;
  --Background: #f0f5fa;
  --text: #10375C;
}

/* ------------------ GLOBAL ------------------ */
html, body {
  margin: 0;
  padding: 0;
  font-family: 'Vazir', sans-serif;
  background: #cce6ff;
  overflow-x: hidden;
}

nav {
  text-align: center;
  padding: 20px;
}
nav a {
  margin: 0 15px;
  text-decoration: none;
  color: var(--text);
  font-weight: bold;
  position: relative;
  display: inline-block;
}
nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0%;
  height: 2px;
  background-color: var(--primary-color);
  transition: width 0.3s ease;
}
nav a:hover::after {
  width: 100%;
}

h1 {
  text-align: center;
  color: var(--text);
  font-size: 2rem;
}
p.intro {
  text-align: center;
  color: var(--text);
  max-width: 600px;
  margin: 10px auto 30px;
}

/* ------------------ COURSES GRID ------------------ */
.courses {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  padding: 20px;
  overflow: visible;
  position: relative;
}

/* ------------------ COURSE CONTAINER ------------------ */
.course-container,
.course-ff1-container {
  position: relative;
  z-index: 10;
  overflow: visible;
}

/* ------------------ COURSE CARD ------------------ */
.card,
.course-ff1-card {
  width: 100%;
  height: 400px;
  padding: 15px;
  border-radius: 12px;
  background-color: var(--primary-color);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  direction: rtl;
  transition: transform 0.3s ease;
  font-size: 0.9em;
  box-sizing: border-box;
  position: relative;
}

.card:hover,
.course-ff1-card:hover {
  transform: translateY(-6px);
}

.card h1, .card h2, .card h3, .card h4, .card h5, .card h6, .card p,
.course-ff1-card h1, .course-ff1-card h2, .course-ff1-card h3, .course-ff1-card p {
  margin: 7px;
}

/* ------------------ BUTTONS ------------------ */
.btn,
.course-ff1-main-btn {
  background: #fff;
  color: #003366;
  font-weight: bold;
  padding: 6px 12px;
  border-radius: 20px;
  text-decoration: none;
  position: absolute;
  bottom: 10px;
  left: 10px;
  transition: 0.3s;
}
.btn:hover,
.course-ff1-main-btn:hover {
  background: #003366;
  color: #fff;
}

/* ------------------ HOVER BOXES BASE ------------------ */
.course-ff1-hover-boxes {
  position: absolute;
  top: 0;
  background: var(--Background);
  border: 2px solid var(--primary-color);
  border-radius: 10px;
  padding: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  opacity: 0;
  transform: translateX(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  z-index: 99999;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  overflow: visible;
}

/* ------------------ LEFT CARD → OPEN RIGHT ------------------ */
.course-ff1-container.left-card .course-ff1-hover-boxes {
  left: 100%;
}

.course-ff1-container.left-card:hover .course-ff1-hover-boxes {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
  width: 500px;
}

/* ------------------ RIGHT CARD → OPEN LEFT ------------------ */
.course-ff1-container.right-card .course-ff1-hover-boxes {
  right: 100%;
  left: auto;
  transform: translateX(-10px);
}

.course-ff1-container.right-card:hover .course-ff1-hover-boxes {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
  width: 500px;
}

/* ------------------ HOVER ITEMS ------------------ */
.course-ff1-hover-item {
  background: #fff;
  border-radius: 8px;
  padding: 10px;
  font-size: 0.9em;
  transition: transform 0.3s ease;
}
.course-ff1-hover-item:hover {
  transform: translateY(-5px);
}

.course-topics {
  font-size: 0.9em;
  padding-top: 10px;
}

.course-ff1-btn {
  margin-top: 8px;
  padding: 6px 12px;
  background: var(--primary-color);
  color: var(--text);
  border-radius: 20px;
  font-weight: bold;
  text-decoration: none;
  transition: background 0.3s ease;
}
.course-ff1-btn:hover {
  background: #003366;
  color: #fff;
}
  .course-ff1-container:hover {
  z-index: 999999 !important;
  position: relative;
}
/* ------------------ RESPONSIVE ------------------ */
@media (max-width: 768px) {
  .course-ff1-container.left-card:hover .course-ff1-hover-boxes {
    width: 200px;
  }
  .course-ff1-container.right-card:hover .course-ff1-hover-boxes {
    width: 200px;
  }
  .courses {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    padding: 10px;
  }

  .card,
  .course-ff1-card {
    height: 380px;
    font-size: 0.7em;
    overflow: visible;
  }

  .course-ff1-container:hover {
  z-index: 999999 !important;
  position: relative;
}

  .course-ff1-hover-boxes {
    font-size: 0.7em;
    width: 200px;
    top: 0;
    z-index: 999999;
  }

  .course-ff1-container.left-card .course-ff1-hover-boxes {
    left: 100%;
    transform: translateX(10px);
  }

  .course-ff1-container.right-card .course-ff1-hover-boxes {
    right: 100%;
    transform: translateX(-10px);
  }

  .course-ff1-container:hover .course-ff1-hover-boxes {
    opacity: 1;
    transform: translateX(0);
  }
}
