.t888-achievement-students .achievement-tabs {
    display: flex;
    gap: 46px;
    justify-content: center;
    margin-bottom: 80px;
}

.achievement-tab {
    background: none;
    border: none;
    font-size: 18px;
    line-height: 25px;
    font-weight: 700;
    cursor: pointer;
    color: var(--forth-color);
    padding: 0;
    font-family: var(--font-family);
}

.achievement-tab.active {
    text-decoration: underline;
}

.achievement-tab-panel {
    display: none;
}

.achievement-tab-panel.active {
    display: block;
}

/* ============================================
   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: 12px 15px;
    border: 1px solid var(--third-color);
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
}

.achievement-name-small {
    font-size: 16px;
    line-height: 22px;
    font-weight: 600;
    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);
}

@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;
    }
}

@media (max-width: 767px) {
  .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;
  }
}