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

:root {
  --primary-color: #2C4A6B;   
  --secondary-color: #7BAFD4;  
  --accent-color: #C2DFF0;      
  --Background: #EFECE3;       
  --text: #000000;              
}


body {
  margin: 0;
  font-family: 'Vazir', sans-serif;
  background: var(--Background);
  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(--secondary-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 {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  padding: 0 20px 40px;
  overflow: visible;
}


.course-ff1-container {
  position: relative;
  margin: 20px;
  box-sizing: border-box;
  z-index: 1;
}
.course-ff1-container:hover {
  z-index: 999;
}
.card,
.course-ff1-card {
  width: 300px;
  height: 400px;
  font-size: 0.9em;
  color: var(--primary-color);
}
.course-ff1-card {
  border-radius: 12px;
  padding: 15px 20px;
  transition: transform 0.3s ease;
  direction: rtl;
  position: relative;
  box-sizing: border-box;
}
.course-ff1-card:hover {
  transform: translateY(-8px);
}


.courses .course-ff1-container:nth-child(odd) .course-ff1-card {
  background: var(--primary-color);
  color: #fff;
}
.courses .course-ff1-container:nth-child(even) .course-ff1-card {
  background: var(--secondary-color);
  color: #000;
}

.course-ff1-title {
  text-align: right;
  font-size: 0.95rem;
  font-weight: bold;
}

.course-ff1-main-btn {
  background: #fff;
  color: var(--primary-color);
  font-weight: bold;
  padding: 6px 12px;
  border-radius: 20px;
  text-decoration: none;
  position: absolute;
  bottom: 10px;
  left: 10px;
  transition: 0.3s;
}
.course-ff1-main-btn:hover {
  background: var(--secondary-color);
  color: #fff;
}


.course-ff1-hover-boxes {
  display: grid;
  gap: 15px;
  background: var(--accent-color);
  border: 2px solid var(--primary-color);
  border-radius: 10px;
  padding: 10px;
  position: absolute;
  top: 0;
  font-size: 0.9em;
  right: calc(100% + 10px);
  width: 240px;
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity 0.4s ease, transform 0.3s ease;
  pointer-events: none;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  z-index: 10000;
}
.course-ff1-container:hover .course-ff1-hover-boxes {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.course-ff1-hover-item {
  background: #fff;
  border-radius: 8px;
  padding: 10px 10px 40px;
  text-align: center;
  color: var(--text);
  transition: transform 0.3s ease;
  position: relative;
}
.course-ff1-hover-item:hover {
  transform: translateY(-5px);
}

.course-ff1-btn {
  padding: 6px 12px;
  background: var(--secondary-color);
  color: #fff;
  border-radius: 20px;
  font-weight: bold;
  text-decoration: none;
  transition: background 0.3s ease;
  position: absolute;
  bottom: 10px;
  left: 10px;
}
.course-ff1-btn:hover {
  background: var(--primary-color);
  color: #fff;
}


.course-container {
  position: relative;
  margin: 20px;
  box-sizing: border-box;
}
.card {
  direction: rtl;
  border-radius: 12px;
  padding: 15px 20px;
  position: relative;
  transition: transform 0.3s ease;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.card:hover {
  transform: translateY(-8px);
}
.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; 
}

.courses .course-container:nth-child(odd) .card {
  background: var(--primary-color);
  color: #fff;
}
.courses .course-container:nth-child(even) .card {
  background: var(--secondary-color);
  color: #000;
}

.title-line {
  text-align: right;
  font-size: 0.95rem;
  font-weight: bold;
}
.title-line span {
  display: inline-block;
}

.btn {
  background: #fff;
  color: var(--primary-color);
  font-weight: bold;
  padding: 6px 12px;
  border-radius: 20px;
  text-decoration: none;
  position: absolute;
  bottom: 10px;
  left: 10px;
  transition: 0.3s;
}
.btn:hover {
  background: var(--primary-color);
  color: #fff;
}
@media (max-width: 768px) {
  html, body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
  }

  .courses {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 0 8px 24px;
    box-sizing: border-box;
    overflow: visible;
  }

  .course-container,
  .course-ff1-container {
    margin: 0;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    overflow: visible;
    z-index: 1;
  }

  .card,
  .course-ff1-card {
    padding: 12px;
    border-radius: 12px;
    height: auto;
    box-sizing: border-box;
    height: 380px;
    font-size: 0.7em;
    overflow: visible;
    width: 200px;
  }
  .course-ff1-card {
    height: 100%;
  }

  .courses .course-container:nth-child(odd) .card,
  .courses .course-ff1-container:nth-child(odd) .course-ff1-card {
    background: var(--primary-color);
    color: #fff;
  }
  .courses .course-container:nth-child(even) .card,
  .courses .course-ff1-container:nth-child(even) .course-ff1-card {
    background: var(--secondary-color);
    color: #000;
  }


  .course-ff1-hover-boxes {
    position: absolute;
    top: 0;
    left: calc(100% + 10px);
    right: auto;
    width: 90%;
    height: auto;
    background: var(--accent-color);
    border: 2px solid var(--primary-color);
    border-radius: 10px;
    padding: 10px;
    opacity: 0;
    transform: translateX(10px);
    transition: opacity 0.4s ease, transform 0.3s ease;
    pointer-events: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    z-index: 9999;
  }

  .course-ff1-container:hover .course-ff1-hover-boxes,
  .course-ff1-container:focus-within .course-ff1-hover-boxes,
  .course-ff1-container:active .course-ff1-hover-boxes {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
  }

  .course-ff1-hover-item {
    padding: 0;
    width: 90%;
    height: 90%;
    margin: 0;
    padding: 10px 10px 40px; 
    height: auto;
    position: relative;
    background: #fff;
    border-radius: 8px;
    color: var(--text);
  }

  .course-ff1-btn,
  .course-ff1-main-btn,
  .btn {
    font-size: 0.8rem;
    padding: 6px 10px;
    position: absolute;
    bottom: 10px;
    left: 10px;
  }
}
