/**
 * mgx-Style Hamburger Menu
 * Sağdan açılan modern overlay menü
 * Version: 1.0
 */

/* ==========================================
   ESKİ HAMBURGER MENÜYÜ GİZLE
   ========================================== */

/* Eski tema hamburger menüsünü gizle */
.navbar-toggle,
.responsive-menu {
    display: none !important;
}

/* ==========================================
   HAMBURGER BUTTON
   ========================================== */

.mgx-hamburger {
    position: fixed;
    top: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--white-color);
    border-radius: 50%;
    cursor: pointer;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 6px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.mgx-hamburger:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 30px rgba(232, 211, 6, 0.3);
    background: var(--accent-color);
}

.mgx-hamburger-line {
    width: 24px;
    height: 2px;
    background: var(--primary-color);
    border-radius: 2px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hamburger Active State (X) */
.mgx-hamburger.is-active .mgx-hamburger-line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.mgx-hamburger.is-active .mgx-hamburger-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.mgx-hamburger.is-active .mgx-hamburger-line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

.mgx-hamburger.is-active {
    background: var(--primary-color);
}

.mgx-hamburger.is-active .mgx-hamburger-line {
    background: var(--accent-color);
}

/* ==========================================
   MENU OVERLAY
   ========================================== */

.mgx-menu-overlay {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 450px;
    height: 100vh;
    background: var(--primary-color);
    z-index: 9999;
    overflow-y: auto;
    transition: right 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -5px 0 50px rgba(0, 0, 0, 0.5);
}

.mgx-menu-overlay.is-open {
    right: 0;
}

/* Menu Inner Container */
.mgx-menu-inner {
    padding: 100px 50px 50px;
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

/* ==========================================
   MENU ITEMS
   ========================================== */

.mgx-menu-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mgx-menu-item {
    margin-bottom: 15px;
    opacity: 1;
    transform: translateX(0);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Stagger animation */
.mgx-menu-overlay.is-open .mgx-menu-item:nth-child(1) { 
    animation: slideInRight 0.5s 0.1s forwards; 
}
.mgx-menu-overlay.is-open .mgx-menu-item:nth-child(2) { 
    animation: slideInRight 0.5s 0.15s forwards; 
}
.mgx-menu-overlay.is-open .mgx-menu-item:nth-child(3) { 
    animation: slideInRight 0.5s 0.2s forwards; 
}
.mgx-menu-overlay.is-open .mgx-menu-item:nth-child(4) { 
    animation: slideInRight 0.5s 0.25s forwards; 
}
.mgx-menu-overlay.is-open .mgx-menu-item:nth-child(5) { 
    animation: slideInRight 0.5s 0.3s forwards; 
}
.mgx-menu-overlay.is-open .mgx-menu-item:nth-child(6) { 
    animation: slideInRight 0.5s 0.35s forwards; 
}
.mgx-menu-overlay.is-open .mgx-menu-item:nth-child(7) { 
    animation: slideInRight 0.5s 0.4s forwards; 
}
.mgx-menu-overlay.is-open .mgx-menu-item:nth-child(8) { 
    animation: slideInRight 0.5s 0.45s forwards; 
}
.mgx-menu-overlay.is-open .mgx-menu-item:nth-child(9) { 
    animation: slideInRight 0.5s 0.5s forwards; 
}
.mgx-menu-overlay.is-open .mgx-menu-item:nth-child(10) { 
    animation: slideInRight 0.5s 0.55s forwards; 
}
.mgx-menu-overlay.is-open .mgx-menu-item:nth-child(11) { 
    animation: slideInRight 0.5s 0.6s forwards; 
}
.mgx-menu-overlay.is-open .mgx-menu-item:nth-child(12) { 
    animation: slideInRight 0.5s 0.65s forwards; 
}
.mgx-menu-overlay.is-open .mgx-menu-item:nth-child(13) { 
    animation: slideInRight 0.5s 0.7s forwards; 
}
.mgx-menu-overlay.is-open .mgx-menu-item:nth-child(14) { 
    animation: slideInRight 0.5s 0.75s forwards; 
}
.mgx-menu-overlay.is-open .mgx-menu-item:nth-child(15) { 
    animation: slideInRight 0.5s 0.8s forwards; 
}

/* Fallback: Tüm item'lar için genel animasyon */
.mgx-menu-overlay.is-open .mgx-menu-item {
    animation: slideInRight 0.5s 0.2s forwards;
}

@keyframes slideInRight {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Menu Links */
.mgx-menu-link {
    display: block;
    font-size: 32px;
    font-weight: 700;
    color: #FFFFFF;
    text-decoration: none;
    padding: 15px 0;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    font-family: 'Hanken Grotesk', sans-serif;
    letter-spacing: -0.5px;
}

.mgx-menu-link::before {
    content: '';
    position: absolute;
    left: -100%;
    bottom: 10px;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
    transition: left 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.mgx-menu-link:hover {
    color: var(--accent-color);
    padding-left: 20px;
}

.mgx-menu-link:hover::before {
    left: 0;
}

/* Submenu */
.mgx-submenu {
    list-style: none;
    padding: 10px 0 10px 30px;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.mgx-menu-item.has-submenu.is-open .mgx-submenu {
    max-height: 500px;
}

.mgx-submenu-item {
    margin: 8px 0;
}

.mgx-submenu-link {
    display: block;
    font-size: 18px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    padding: 8px 0;
    transition: all 0.3s ease;
}

.mgx-submenu-link:hover {
    color: var(--accent-color);
    padding-left: 10px;
}

/* Submenu Toggle Icon */
.mgx-menu-item.has-submenu > .mgx-menu-link::after {
    content: '+';
    position: absolute;
    right: 20px;
    font-size: 40px;
    font-weight: 300;
    transition: transform 0.3s ease;
}

.mgx-menu-item.has-submenu.is-open > .mgx-menu-link::after {
    transform: rotate(45deg);
}

/* ==========================================
   MENU FOOTER (CTA)
   ========================================== */

.mgx-menu-footer {
    margin-top: auto;
    padding-top: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.5s;
}

.mgx-menu-overlay.is-open .mgx-menu-footer {
    opacity: 1;
    transform: translateY(0);
}

.mgx-menu-cta {
    display: inline-block;
    padding: 18px 40px;
    background: var(--accent-color);
    color: var(--primary-color);
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 50px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(232, 211, 6, 0.3);
}

.mgx-menu-cta:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(232, 211, 6, 0.5);
    background: var(--white-color);
    color: var(--primary-color);
}

.mgx-menu-social {
    display: flex;
    gap: 20px;
    margin-top: 30px;
}

.mgx-social-link {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: var(--white-color);
    text-decoration: none;
    font-size: 18px;
    transition: all 0.3s ease;
}

.mgx-social-link:hover {
    background: var(--accent-color);
    color: var(--primary-color);
    transform: translateY(-3px);
}

/* ==========================================
   BACKDROP OVERLAY
   ========================================== */

.mgx-menu-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.mgx-menu-backdrop.is-visible {
    opacity: 1;
    visibility: visible;
}

/* ==========================================
   BODY SCROLL LOCK
   ========================================== */

body.mgx-menu-open {
    overflow: hidden;
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 768px) {
    .mgx-hamburger {
        top: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }

    .mgx-menu-overlay {
        max-width: 100%;
    }

    .mgx-menu-inner {
        padding: 80px 30px 30px;
    }

    .mgx-menu-link {
        font-size: 28px;
        padding: 12px 0;
    }

    .mgx-submenu-link {
        font-size: 16px;
    }

    .mgx-menu-cta {
        padding: 15px 35px;
        font-size: 14px;
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .mgx-menu-link {
        font-size: 24px;
    }

    .mgx-menu-inner {
        padding: 70px 25px 25px;
    }
}

/* ==========================================
   DESKTOP - Always show hamburger
   ========================================== */

/* Hamburger her zaman görünür (mobile ve desktop) */
.mgx-hamburger {
    display: flex !important;
}

/* Desktop'ta header menüde sadece 3 item göster */
@media (min-width: 992px) {
    .navbar-nav .desktop-hidden {
        display: none !important;
    }
    
    .navbar-nav .desktop-visible {
        display: block !important;
    }
}

/* ==========================================
   CUSTOM SCROLLBAR
   ========================================== */

.mgx-menu-overlay::-webkit-scrollbar {
    width: 8px;
}

.mgx-menu-overlay::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.mgx-menu-overlay::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.mgx-menu-overlay::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ==========================================
   ACCESSIBILITY
   ========================================== */

.mgx-hamburger:focus,
.mgx-menu-link:focus,
.mgx-submenu-link:focus,
.mgx-menu-cta:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 4px;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .mgx-hamburger,
    .mgx-menu-overlay,
    .mgx-menu-item,
    .mgx-menu-link,
    .mgx-menu-footer {
        transition: none !important;
        animation: none !important;
    }
}

/* ==========================================
   MAIN MENU HOVER EFFECT
   ========================================== */

.main-menu ul li a {
    position: relative;
}

.main-menu ul li a::before {
    content: '';
    position: absolute;
    left: -100%;
    bottom: 10px;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
    opacity: 0;
    transition: left 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

.main-menu ul li a:hover::before {
    left: 0;
    opacity: 1;
}

.nav-link:hover {
    color: var(--accent-color);
    padding-left: 20px;
}