/* Enhanced Fullscreen Menu Styles */
.sfm-toggle-container {
    display: inline-block;
    cursor: pointer;
    z-index: 9998;
    position: relative;
}

#sfm-toggle-btn, .sfm-toggle-btn {
    padding: 10px;
    background: transparent;
    border: none;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#sfm-toggle-btn:hover, .sfm-toggle-btn:hover {
    transform: scale(1.1);
}

.sfm-bar {
    display: block;
    width: 30px;
    height: 3px;
    background-color: #333;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    margin: 2px 0;
}

/* Hamburger to X animation with bounce effect */
#sfm-toggle-btn.active .sfm-bar:nth-child(1),
.sfm-toggle-btn.active .sfm-bar:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

#sfm-toggle-btn.active .sfm-bar:nth-child(2),
.sfm-toggle-btn.active .sfm-bar:nth-child(2) {
    opacity: 0;
    transform: translateX(-20px);
}

#sfm-toggle-btn.active .sfm-bar:nth-child(3),
.sfm-toggle-btn.active .sfm-bar:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

.sfm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.9s cubic-bezier(0.34, 1.56, 0.64, 1); /* Elastic effect */
    transform-origin: 100% 0;
    /* Enhanced ripple effect from top-right corner with wave-like motion */
    clip-path: circle(0% at 100% 0%);
    will-change: clip-path, transform, opacity;
    overflow-y: auto;
    pointer-events: auto; /* Đảm bảo các sự kiện click hoạt động */
}

.sfm-overlay.active {
    opacity: 1;
    visibility: visible;
    /* Enhanced ripple effect with larger final size */
    clip-path: circle(170% at 100% 0%);
}

/* Đảm bảo menu container hiển thị đúng cách khi overlay active */
.sfm-overlay.active .sfm-menu-container {
    opacity: 1;
    visibility: visible;
    z-index: 10001;
}

.sfm-overlay-content {
    width: 100%;
    max-width: 1200px;
    text-align: center;
    padding: 50px 20px;
    position: relative;
    transform: translateY(50px) scale(0.9);
    transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
    perspective: 1000px;
    z-index: 10000; /* Đảm bảo nội dung hiển thị trên overlay */
    pointer-events: auto; /* Đảm bảo các sự kiện click hoạt động */
}

.sfm-overlay.active .sfm-overlay-content {
    transform: translateY(0) scale(1);
}

/* Improved close button positioning and size */
#sfm-close-btn {
    position: fixed;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    color: white;
    font-size: 48px; /* Increased size */
    cursor: pointer;
    z-index: 10000;
    width: 60px; /* Increased size */
    height: 60px; /* Increased size */
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    transition: all 0.3s ease;
    transform: scale(0) rotate(-180deg);
    opacity: 0;
}

.sfm-overlay.active #sfm-close-btn {
    transform: scale(1) rotate(0deg);
    opacity: 1;
    transition-delay: 0.5s;
}

#sfm-close-btn:hover {
    transform: scale(1.2) rotate(90deg);
    color: #f5a623;
}

.sfm-close-icon {
    color: white;
    font-size: 48px; /* Increased size */
    line-height: 1;
    display: block;
}

.sfm-menu-container {
    margin-top: 40px;
    position: relative;
    z-index: 10001; /* Cao hơn z-index của overlay (9999) và close button (10000) */
    opacity: 1; /* Luôn hiển thị với opacity 1 */
    visibility: visible; /* Luôn hiển thị */
}

.sfm-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 10002; /* Cao hơn z-index của menu container */
}

.sfm-menu li {
    margin: 5px 0;
    opacity: 1; /* Luôn hiển thị với opacity 1 */
    transform: translateY(40px) rotateX(-15deg); /* Hiệu ứng ban đầu */
    transform-origin: center;
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    perspective: 1000px;
    position: relative;
    z-index: 10003; /* Cao hơn z-index của menu */
}

/* Chỉ áp dụng hiệu ứng transform khi overlay active */
.sfm-overlay.active .sfm-menu li {
    transform: translateY(0) rotateX(0);
}

/* Staggered animation for menu items */
.sfm-menu li:nth-child(1) { transition-delay: 0.2s; }
.sfm-menu li:nth-child(2) { transition-delay: 0.3s; }
.sfm-menu li:nth-child(3) { transition-delay: 0.4s; }
.sfm-menu li:nth-child(4) { transition-delay: 0.5s; }
.sfm-menu li:nth-child(5) { transition-delay: 0.6s; }
.sfm-menu li:nth-child(6) { transition-delay: 0.7s; }
.sfm-menu li:nth-child(7) { transition-delay: 0.8s; }
.sfm-menu li:nth-child(8) { transition-delay: 0.9s; }

/* Styles for active menu item */
.sfm-menu li.active {
    position: relative;
}

/* .sfm-menu li.active::before {
    content: '';
    position: absolute;
    left: -15px;
    top: 50%;
    transform: translateY(-50%);
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background-color: #f5a623;
    box-shadow: 0 0 10px 2px rgba(245, 166, 35, 0.5);
} */

.sfm-menu a {
    color: white;
    text-decoration: none;
    font-size: 32px;
    font-weight: 500;
    padding: 5px 15px;
    display: inline-block;
    position: relative;
    transition: color 0.4s ease, transform 0.4s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    overflow: hidden;
    z-index: 10004; /* Cao hơn z-index của menu item */
    pointer-events: auto; /* Đảm bảo các sự kiện click hoạt động */
    background-clip: text;
    -webkit-background-clip: text;
}

.sfm-menu a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: #f5a623;
    transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.sfm-menu a:hover,
.sfm-menu .active a {
    color: transparent;
    transform: translateY(-5px);
    background-image: linear-gradient(90deg, #f5a623, #f5a623);
    background-size: 200% 100%;
    background-position: 100% 0;
    -webkit-background-clip: text;
    background-clip: text;
    text-shadow: none;
}

.sfm-menu a:hover::after,
.sfm-menu .active a::after {
    width: 100%;
}

/* Prevent body scroll when menu is open */
body.sfm-menu-open {
    overflow: hidden;
}

/* Responsive */
@media (max-width: 768px) {
    .sfm-menu a {
        font-size: 16px;
    }

    #sfm-close-btn {
        top: 10px;
        right: 10px;
    }
}

.sfm-lang-switcher-wrapper {
    margin-top: 0;
    display: unset;
    justify-content: unset;
    align-items: unset;
}

.sfm-menu-lang {
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sfm-lang-switcher {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    font-size: 0px;
    color: #1565c0;
    font-weight: bold;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-align: center;
    margin: 20px 0 0 0;
    background: none;
    box-shadow: none;
    border: none;
    list-style: none;
}

.sfm-lang-switcher a {
    color: #1565c0;
    text-decoration: none;
    padding: 0 12px;
    font-size: 18px !important;
    font-weight: bold;
    text-transform: uppercase;
    transition: color 0.2s;
    display: inline-block;
}


.sfm-lang-switcher a:hover {
    color: #f5a623;
}



ul.sfm-menu.sfm-menu-lang li {
    padding: 32px !important;
    column-gap: 20px !important;
}
