/* =========================================================
   صفحه «ایونت‌ها و رویدادها» — templates/events/list.html
   دیزاین هم‌سان با صفحه دوره‌ها (courses-list.css)
   ========================================================= */

.events-list-page {
  --blue: #1769e0;
  --blue2: #46a3e5;
  --navy: #10243f;
  --muted: #718096;
  --line: #e8edf4;
  --bg: #f7f9fc;
  --card: #ffffff;
  --green: #10a957;
  --amber: #f59e0b;
  --shadow: 0 16px 45px rgba(20, 45, 80, .08);
  background: var(--bg);
}

html {
  scroll-behavior: smooth;
}

.events-list-page button,
.events-list-page input {
  font: inherit;
}

.events-list-page button {
  cursor: pointer;
}

.training-page {
  min-height: 100vh;
  padding: 42px clamp(18px, 4vw, 64px) 70px;
  position: relative;
  overflow: hidden;
}

.training-page:before {
  content: "";
  position: absolute;
  width: 620px;
  height: 620px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(23, 105, 224, .08), transparent 68%);
  top: -280px;
  left: -180px;
  pointer-events: none;
}

.training-wrap {
  max-width: 1240px;
  margin: auto;
  position: relative;
  z-index: 1;
}

/* Header */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 28px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 9px;
}

.eyebrow i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 5px rgba(23, 105, 224, .10);
}

.page-head h1 {
  margin: 0;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.15;
  letter-spacing: -1.5px;
  font-weight: 800;
}

.head-copy {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.9;
}

.course-count {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 9px;
  background: #fff;
  border: 1px solid var(--line);
  padding: 11px 15px;
  border-radius: 14px;
  color: #41536b;
  font-size: 13px;
  box-shadow: 0 8px 25px rgba(20, 45, 80, .04);
}

.course-count strong {
  color: var(--blue);
  font-size: 16px;
}

/* Toolbar */
.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter {
  border: 1px solid var(--line);
  background: #fff;
  color: #63748a;
  padding: 9px 14px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  transition: .22s ease;
}

.filter:hover {
  border-color: #c8d8ef;
  color: var(--blue);
  transform: translateY(-1px);
}

.filter.active {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
  box-shadow: 0 7px 18px rgba(23, 105, 224, .20);
}

.search {
  width: min(270px, 100%);
  position: relative;
  display: block;
}

.search input {
  width: 100%;
  border: 1px solid var(--line);
  outline: none;
  background: #fff;
  color: var(--navy);
  border-radius: 13px;
  padding: 11px 42px 11px 14px;
  font-size: 12px;
  transition: .2s;
}

.search input:focus {
  border-color: #a9c6ef;
  box-shadow: 0 0 0 4px rgba(23, 105, 224, .07);
}

.search i {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #91a0b2;
  font-size: 13px;
  line-height: 1;
  pointer-events: none;
}

/* Grid */
.course-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(20, 45, 80, .035);
  transition: transform .28s ease, box-shadow .28s ease, border-color .28s ease;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-6px);
  border-color: #d6e2f2;
  box-shadow: var(--shadow);
}

.cover {
  height: 218px;
  position: relative;
  overflow: hidden;
  background: #dfeeff;
  display: block;
}

.cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cover:after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(5, 20, 42, .04) 30%, rgba(5, 20, 42, .32));
  pointer-events: none;
}

.badge {
  position: absolute;
  z-index: 2;
  top: 13px;
  right: 13px;
  color: #fff;
  background: rgba(10, 27, 49, .76);
  backdrop-filter: blur(9px);
  border: 1px solid rgba(255, 255, 255, .18);
  padding: 6px 9px;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 700;
}

.badge--open {
  background: rgba(16, 169, 87, .86);
}

.badge--full {
  background: rgba(245, 158, 11, .88);
}

.badge--past {
  background: rgba(100, 116, 139, .88);
}

.badge--closed {
  background: rgba(10, 27, 49, .76);
}

.card-body {
  padding: 18px 18px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card h2 {
  font-size: 17px;
  margin: 0 0 8px;
  font-weight: 800;
  letter-spacing: -.3px;
  line-height: 1.5;
}

.card h2 a {
  color: inherit;
  text-decoration: none;
}

.card h2 a:hover {
  color: var(--blue);
}

.meta {
  display: flex;
  align-items: center;
  gap: 13px;
  color: #8290a2;
  font-size: 11px;
  margin-bottom: 17px;
  flex-wrap: wrap;
}

.meta span {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.meta i {
  font-size: 12px;
  line-height: 1;
  color: var(--blue);
  opacity: .75;
}

.bottom {
  border-top: 1px solid #edf1f5;
  padding-top: 14px;
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.price {
  font-size: 13px;
  color: #344b65;
}

.price strong {
  font-size: 16px;
  color: var(--blue);
  font-weight: 800;
}

.price small {
  font-size: 10px;
  color: #8a98a9;
  margin-right: 3px;
}

.cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  overflow: hidden;
  isolation: isolate;
  border: 1.5px solid rgba(51, 51, 51, .4);
  background: transparent;
  color: #111111;
  padding: 9px 22px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  font-family: inherit;
  transition: all .6s cubic-bezier(.23, 1, .32, 1);
}

.cta:hover,
.cta:focus-visible {
  border-color: transparent;
  color: #fff;
  border-radius: 12px;
}

.cta:active {
  transform: scale(.95);
}

.cta__text {
  position: relative;
  z-index: 1;
  transform: translateX(12px);
  transition: transform .8s ease-out;
}

.cta:hover .cta__text,
.cta:focus-visible .cta__text {
  transform: translateX(-12px);
}

.cta__arrow {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  z-index: 9;
  color: #111111;
  pointer-events: none;
  transition: all .8s cubic-bezier(.34, 1.56, .64, 1);
}

.cta__arrow svg {
  display: block;
  width: 14px;
  height: 14px;
}

.cta__arrow--in {
  right: -25%;
}

.cta:hover .cta__arrow--in,
.cta:focus-visible .cta__arrow--in {
  right: 12px;
  color: #fff;
}

.cta__arrow--out {
  left: 12px;
}

.cta:hover .cta__arrow--out,
.cta:focus-visible .cta__arrow--out {
  left: -25%;
  color: #fff;
}

.cta__circle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border-radius: 50%;
  background: #111111;
  opacity: 0;
  z-index: 0;
  pointer-events: none;
  transition: all .8s cubic-bezier(.19, 1, .22, 1);
}

.cta:hover .cta__circle,
.cta:focus-visible .cta__circle {
  width: 220px;
  height: 220px;
  margin: -110px 0 0 -110px;
  opacity: 1;
}

.cta.free {
  border-color: rgba(23, 105, 224, .45);
  color: var(--blue);
}

.cta.free .cta__circle {
  background: var(--blue);
}

.cta.free:hover,
.cta.free:focus-visible {
  border-color: transparent;
  color: #fff;
}

.cta.green {
  border-color: rgba(23, 105, 224, .45);
  color: var(--blue);
}

.cta.green .cta__circle {
  background: var(--blue);
}

.cta.green:hover,
.cta.green:focus-visible {
  border-color: transparent;
  color: #fff;
}

@media (prefers-reduced-motion: reduce) {
  .cta,
  .cta__text,
  .cta__arrow,
  .cta__circle {
    transition: none;
  }
}

.empty {
  display: none;
  text-align: center;
  padding: 55px 20px;
  border: 1px dashed #ccd7e5;
  border-radius: 20px;
  color: #7a8a9d;
  grid-column: 1 / -1;
  background: #fff;
}

.empty.show {
  display: block;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(8, 22, 39, .55);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: .22s;
  z-index: 1100;
}

.modal.open {
  opacity: 1;
  visibility: visible;
}

.modal-box {
  width: min(560px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .22);
  transform: translateY(12px) scale(.98);
  transition: .22s;
}

.modal.open .modal-box {
  transform: none;
}

.modal-cover {
  height: 210px;
  position: relative;
  background: #dfeeff;
}

.modal-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.close {
  position: absolute;
  top: 13px;
  left: 13px;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .3);
  background: rgba(0, 0, 0, .38);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close i {
  font-size: 16px;
  line-height: 1;
}

.modal-content {
  padding: 22px;
}

.modal-content h3 {
  margin: 0 0 8px;
  font-size: 21px;
  line-height: 1.5;
}

.modal-content p {
  margin: 0;
  color: #718096;
  font-size: 13px;
  line-height: 2;
}

.modal-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 12px;
  color: #8290a2;
  font-size: 12px;
}

.modal-meta .price strong {
  font-size: 15px;
}

.modal-actions {
  display: flex;
  gap: 9px;
  margin-top: 18px;
}

.modal-actions button,
.modal-actions a {
  flex: 1;
  border: 0;
  border-radius: 11px;
  padding: 11px;
  font-weight: 800;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-family: inherit;
}

.primary {
  background: var(--blue);
  color: #fff;
}

.primary:hover {
  background: #125bc4;
}

.secondary {
  background: #edf3fa;
  color: #38516e;
}

.secondary:hover {
  background: #e0eaf6;
}

@media (max-width: 950px) {
  .course-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .training-page {
    padding: 28px 15px 45px;
  }

  .page-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .course-count {
    align-self: flex-start;
  }

  .toolbar {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .search {
    width: 100%;
  }

  .course-grid {
    grid-template-columns: 1fr;
  }

  .cover {
    height: 205px;
  }
}
