.t888-achievement-students .achievement-tabs,
.t888-achievement-style2-tabs {
  display: flex;
  gap: clamp(24px, 5vw, 30px);
  justify-content: center;
  align-items: center;
  margin-bottom: 80px;
}

.achievement-tab,
.t888-achievement-style2-tab {
  background: none;
  border: 1px solid #00377b;
  border-radius: 999px;
  font-size: 16px;
  line-height: 16px;
  font-weight: 600;
  cursor: pointer;
  color: #00377b;
  padding: 10px 20px;
  font-family: var(--font-family);
  white-space: nowrap;
  transition: all 0.3s ease;
}

.achievement-tab.active,
.t888-achievement-style2-tab.active {
  background: var(--forth-color);
  color: #fff;
  border-color: var(--forth-color);
}

.achievement-tab:hover,
.t888-achievement-style2-tab:hover {
  color: #fff;
  background: var(--forth-color);
  border-color: var(--forth-color);
}

.achievement-tab.active:hover,
.t888-achievement-style2-tab.active:hover {
  color: #fff;
}

.achievement-tab-panel {
  display: none;
}

.achievement-tab-panel.active {
  display: block;
}
.t888-achievement-style2 .t888-slider-next .nav-icon,
.t888-achievement-style2 .t888-slider-prev .nav-icon {
  height: 28px;
}
.t888-achievement-style2 .t888-slider-prev {
  left: -60px;
}
.t888-achievement-style2 .t888-slider-next {
  right: -60px;
}
/* ============================================
   TAB FADE TRANSITIONS
   ============================================ */
@keyframes fadeOutTab {
  from {
    opacity: 1;
    transform: translateY(0);
  }

  to {
    opacity: 0;
    transform: translateY(-20px);
  }
}

@keyframes fadeInTab {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.achievement-tab-panel.fade-out {
  animation: fadeOutTab 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.achievement-tab-panel.fade-in {
  animation: fadeInTab 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* ============================================
   FADE IN UP ANIMATION CHO ITEMS
   ============================================ */
@keyframes fadeInUpCard {
  from {
    opacity: 0;
    transform: translateY(40px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Initial state (KHÔNG áp dụng trong Elementor editor) */
body:not(.elementor-editor-active)
  .t888-achievement-students
  .achievement-card {
  opacity: 0;
  transform: translateY(40px);
}

/* Hiển thị bình thường trong Elementor editor */
body.elementor-editor-active .t888-achievement-students .achievement-card {
  opacity: 1;
  transform: translateY(0);
}

/* Animate khi visible - KHÔNG trong editor */
body:not(.elementor-editor-active)
  .t888-achievement-students
  .achievement-card.item-visible {
  animation: fadeInUpCard 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
  animation-delay: 0s !important;
  /* Delay được xử lý trong JS */
}

body:not(.elementor-editor-active)
  .t888-achievement-students
  .achievement-row
  .achievement-card:nth-child(4).item-visible {
  animation-delay: 0.45s;
}

.achievement-row {
  display: flex;
  justify-content: center;
  gap: 60px 30px;
  /* margin-bottom: 60px; */
  flex-wrap: wrap;
}

.achievement-row:last-child {
  margin-bottom: 0;
}

.achievement-visual {
  position: relative;
  height: 428px;
}

.achievement-card {
  /* width: 330px; */
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  filter: drop-shadow(0px 2px 16px rgba(0, 0, 0, 0.15));
  backdrop-filter: blur(2px);
  flex: 0 0 calc(25% - 22.5px);
}

.achievement-photo {
  position: relative;
  display: flex;
  justify-content: center;
  height: 428px;
  z-index: 3;
}

.achievement-photo img {
  height: 100%;
  width: auto;
  object-fit: cover;
}

.achievement-accent {
  position: absolute;
  bottom: 254px;
  left: 0;
  width: 100%;
  height: 20px;
  background: var(--forth-color);
  z-index: 2;
}

.achievement-bg {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 244px;
  background: var(--third-color);
  z-index: 1;
}

.achievement-info {
  background: #fff;
  text-align: center;
  padding: 15px 15px;
  border: 1px solid var(--third-color);
  border-bottom-left-radius: 20px;
  border-bottom-right-radius: 20px;
}

.achievement-name-small {
  font-size: 21px;
  line-height: 28px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--third-color);
}

.achievement-name {
  font-size: 28px;
  line-height: 38px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--third-color);
  margin: 0;
}

/* =========================
   FANCYBOX STYLES
========================= */
.achievement-fancybox-content .f-button {
  position: absolute !important;
  right: 10px !important;
  top: 10px !important;
  color: #fff !important;
  background: var(--forth-color);
  width: 26px !important;
  height: 26px !important;
  border: none !important;
  border-radius: 0 !important;
}

.achievement-fancybox-content .f-button svg {
  width: 12px !important;
  height: 12px !important;
}

.achievement-fancybox-content .f-button:hover {
  color: #fff !important;
  background: var(--forth-color) !important;
}
.achievement-fancybox-content .f-button:focus,
.achievement-fancybox-content .f-button:active,
.achievement-fancybox-content .f-button:focus-visible,
.achievement-fancybox-content .f-button:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

.achievement-fancybox-content.fancybox__content {
  max-width: 928px;
  /* padding: 60px; */
  border-radius: 20px;
}

.achievement-fancybox-inner {
  display: flex;
  gap: 60px;
  padding: 0;
  background: #fff;
  /* min-height: 570px; */
  max-width: 900px;
  margin: 0 auto;
}

.achievement-fancybox-left {
  flex: 0 0 390px;
  position: relative;
}

/* Visual wrapper giống card ngoài */
.achievement-fancybox-visual {
  position: relative;
  height: 100%;
  display: flex;
  justify-content: center;
}

/* Ảnh chính */
.achievement-fancybox-photo {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  height: 100%;
  z-index: 3;
}

.achievement-fancybox-photo img {
  height: 100%;
  width: auto;
  object-fit: contain;
  max-width: 400px;
}

/* Thanh hồng */
.achievement-fancybox-accent {
  position: absolute;
  bottom: 50%;
  left: 0;
  width: 100%;
  height: 20px;
  background: var(--forth-color);
  z-index: 2;
}

/* Nền xanh */
.achievement-fancybox-bg {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 48%;
  background: var(--third-color);
  z-index: 1;
  border-bottom-left-radius: 20px;
  border-bottom-right-radius: 20px;
}

.achievement-fancybox-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-height: 570px;
}

.achievement-fancybox-name {
  font-size: 28px;
  line-height: 38px;
  font-weight: 700;
  color: var(--third-color);
  margin: 0;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.achievement-fancybox-description {
  font-size: 18px;
  line-height: 25px;
  color: var(--primary-color);
  overflow-y: auto;
}

.achievement-fancybox-description p:has(strong) {
  font-size: 20px;
  line-height: 27px;
  font-weight: 700;
  margin-bottom: 6px;
}

.achievement-fancybox-description p strong {
  font-size: 20px;
  line-height: 27px;
  font-weight: 700;
}

.achievement-fancybox-description p {
  margin: 0;
}

.achievement-fancybox-description ul {
  margin-top: 0;
  padding-left: 30px;
}

/* Cursor pointer cho card */
.achievement-card {
  cursor: pointer;
  transition: transform 0.3s ease;
}

.achievement-card:hover {
  transform: translateY(-5px);
}

.t888-achievement-style2-tab-content {
  display: none;
}
.t888-achievement-style2-tab-content.active {
  display: block;
}
@media (max-width: 1024px) {
  .achievement-card {
    flex: 0 0 calc(33.3333% - 20px);
  }
  .achievement-fancybox-inner {
    gap: 30px;
    min-height: auto;
  }
  .achievement-fancybox-left {
    flex: 0 0 calc(50% - 15px);
    max-width: calc(50% - 15px);
  }
  .achievement-fancybox-right {
    flex: 0 0 calc(50% - 15px);
    max-width: calc(50% - 15px);
  }
  .achievement-fancybox-content.fancybox__content {
    max-width: 90%;
    padding: 30px;
  }
  .t888-achievement-style2 .t888-slider-prev {
    left: -20px;
  }
  .t888-achievement-style2 .t888-slider-next {
    right: -20px;
  }
}

@media (max-width: 767px) {
  .t888-achievement-students .achievement-tabs,
  .t888-achievement-style2-tabs {
    justify-content: space-evenly;
    flex-wrap: wrap;
    gap: 10px 14px;
    margin: 0 0 48px;
    padding: 0;
    overflow: visible;
  }

  .achievement-tab,
  .t888-achievement-style2-tab {
    flex: 0 1 auto;
    min-height: 42px;
    padding: 10px 18px;
  }

  .achievement-card {
    flex: 0 0 calc(50% - 15px);
  }
}

@media (max-width: 575px) {
  .achievement-card {
    flex: 0 0 100%;
  }
  .achievement-fancybox-content.fancybox__content {
    padding: 30px 20px;
    max-width: 95%;
  }
  .achievement-fancybox-inner {
    flex-direction: column;
    align-items: center;
    gap: 30px;
  }
  .achievement-fancybox-left {
    flex: 0 0 auto;
    max-width: 100%;
    height: 400px;
  }
  .achievement-fancybox-photo img {
    max-width: 100% !important;
    height: auto;
    max-height: 400px;
  }
  .achievement-fancybox-right {
    flex: 0 0 auto;
    max-width: 100%;
    max-height: none;
  }
  .achievement-fancybox-name {
    font-size: 22px;
    line-height: 30px;
    margin-bottom: 15px;
  }
  .achievement-fancybox-description {
    font-size: 16px;
    line-height: 22px;
  }
  .achievement-fancybox-description p:has(strong) {
    font-size: 18px;
    line-height: 25px;
    margin-bottom: 20px;
  }
  .achievement-fancybox-description p strong {
    font-size: 18px;
    line-height: 25px;
  }
  .t888-achievement-students .achievement-tabs,
  .t888-achievement-style2-tabs {
    margin-bottom: 36px;
  }

  .achievement-tab,
  .t888-achievement-style2-tab {
    min-height: 40px;
    padding: 9px 17px;
    font-size: 13px;
    line-height: 18px;
    width: 100%;
  }
  /* quick fix font size */
  .elementor-1831
    .elementor-element.elementor-element-041763f
    .elementor-heading-title {
    font-size: 20px;
    line-height: 1.5;
  }
}
