/* =====================================================
   Muhammed Yağarkar - Özel Düzeltmeler ve İyileştirmeler
   custom-fixes.css
   ===================================================== */

/* -------------------------------------------------------
   0. MOBİL MENÜ OVERLAY & HAMBURGERmenü AYARLARI
   ------------------------------------------------------- */

/* Menü açıldığında overlay arka plan */
body.menu-open {
    overflow: hidden;
}

body.menu-open::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 998;
    pointer-events: auto;
}

/* Hamburger menü butonu styling */
.mobile-menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 1001;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: currentColor;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(10px, 10px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Menü blok z-index */
#menu-block.active {
    z-index: 999;
}

/* -------------------------------------------------------
   1. MENÜ DROPDOWN OK İKONU DÜZELTMESİ
   □ şeklinde görünen Unicode ikonları düzeltiyoruz
   ------------------------------------------------------- */

/* Webnode'un kendi CSS'ini override ediyoruz */
.wnd-with-submenu {
    position: relative !important;
}

.wnd-with-submenu > .menu-item::after,
.wnd-with-submenu > .menu-item .menu-item-text::after {
    content: " ▾" !important;
    font-family: Arial, Helvetica, sans-serif !important;
    font-size: 0.75em !important;
    display: inline-block !important;
    margin-left: 5px !important;
    vertical-align: middle !important;
    font-style: normal !important;
    letter-spacing: normal !important;
}

/* Webnode icon font'unu tamamen devredışı bırakıyoruz */
.wnd-with-submenu .mm-arrow,
.wnd-with-submenu .menu-item-text::after,
.wnd-with-submenu .menu-item::before {
    display: none !important;
    content: none !important;
}

/* Submenu ok yönü hover'da değişsin */
.wnd-with-submenu:hover > .menu-item::after,
.wnd-with-submenu.wnd-active > .menu-item::after {
    content: " ▴" !important;
}

/* Dropdown menü genişliğini ve başlık taşmalarını düzeltme */
.level-2 {
    position: absolute !important;
    width: auto !important;
    min-width: 280px !important;
    max-width: 450px !important;
    white-space: normal !important; /* Başlıklar çok uzunsa alt satıra geçebilsin, kesilmesin */
    top: 100% !important;
    left: 0 !important;
    right: auto !important;
    z-index: 1001 !important;
}

.level-2 .menu-item-text {
    white-space: normal !important;
    display: inline-block !important;
    word-break: break-word !important;
}

/* -------------------------------------------------------
   2. NAVİGASYON SABİT YAPI - Kayma Önleme
   ------------------------------------------------------- */

/* Header'ın minimum yüksekliğini sabitle */
.l-h {
    min-height: 70px;
}

/* Menü wrapper'ı flex ile sabitle */
.menu-nav {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
}

/* Navigasyon overflow'unu kontrol et */
.n-l {
    width: 100%;
    overflow: visible;
}

/* Menü elemanlarının kaymamasını sağla */
.level-1 {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    white-space: nowrap !important;
}

.level-1 > li {
    flex-shrink: 0 !important;
    position: relative !important;
}

/* -------------------------------------------------------
   3. YAZILAR SAYFASI - İÇERİK KAYMASINI ÖNLEME & BUTON HİZALAMA
   ------------------------------------------------------- */

/* Sütun wrapper'larını flexbox düzenine alarak eşit boyda olmalarını sağlıyoruz */
.cw-c {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: stretch !important;
}

.cw-c > .c {
    display: flex !important;
    flex-direction: column !important;
}

.cw-c > .c > .c-c {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto !important;
    height: 100% !important;
}

/* Yazı bloklarını stabil tut */
.b-text {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    flex-grow: 1 !important; /* Metin alanının tüm boşluğu doldurmasını sağlar */
}

/* Butonun her zaman altta hizalanması */
.cw-c .b-btn {
    margin-top: auto !important;
    padding-top: 15px !important;
}

/* Yazı sayfası bölümlerini düzelt */
.s-basic .ez-c {
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Yeni yazı eklenince düzeni korusun */
.s-basic .b-text-c {
    overflow: hidden !important;
    box-sizing: border-box !important;
}

/* -------------------------------------------------------
   4. DİPLOMALAR AKORDİYON BÖLÜMÜ
   ------------------------------------------------------- */

/* Diploma container */
.diploma-accordion {
    width: 100%;
    margin: 30px 0;
    font-family: inherit;
}

.diploma-accordion-item {
    margin-bottom: 12px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: box-shadow 0.3s ease;
}

.diploma-accordion-item:hover {
    box-shadow: 0 4px 20px rgba(193, 37, 91, 0.15);
}

/* Accordion header/trigger */
.diploma-accordion-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    background: linear-gradient(135deg, #373b44 0%, #4286f4 150%); /* Şık gri tonundan hafif mavi geçişli */
    color: #ffffff;
    border: none;
    cursor: pointer;
    text-align: left;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.diploma-accordion-trigger::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: linear-gradient(180deg, #c2185b, #e91e63);
    transition: width 0.3s ease;
}

.diploma-accordion-trigger:hover::before,
.diploma-accordion-trigger.active::before {
    width: 6px;
}

.diploma-accordion-trigger:hover {
    background: linear-gradient(135deg, #4b526d 0%, #c2185b 150%);
}

.diploma-accordion-trigger.active {
    background: linear-gradient(135deg, #c2185b 0%, #880e4f 100%);
}


/* Sol taraftaki diploma ikonu ve metin */
.diploma-trigger-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.diploma-icon {
    font-size: 1.8rem;
    flex-shrink: 0;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
}

.diploma-trigger-info h3 {
    margin: 0 0 3px 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
}

.diploma-trigger-info span {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.75);
    font-weight: 400;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Sağ ok işareti */
.diploma-arrow {
    font-size: 1.2rem;
    color: rgba(255,255,255,0.8);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    margin-left: 10px;
}

.diploma-accordion-trigger.active .diploma-arrow {
    transform: rotate(180deg);
}

/* İçerik paneli */
.diploma-accordion-content {
    background: #ffffff;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.diploma-accordion-content.open {
    max-height: 1000px; /* Limit has been increased to allow long scrollHeight views containing PDF viewers */
}

.diploma-content-inner {
    padding: 24px 28px;
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

/* Diploma görsel alanı */
.diploma-image-area {
    flex-shrink: 0;
    width: 200px;
}

.diploma-image-area img {
    width: 100%;
    border-radius: 6px;
    box-shadow: 0 3px 12px rgba(0,0,0,0.15);
    border: 2px solid #e8e8e8;
    transition: transform 0.3s ease;
}

.diploma-image-area img:hover {
    transform: scale(1.03);
}

/* Diploma metin alanı */
.diploma-text-area {
    flex: 1;
}

.diploma-text-area h4 {
    margin: 0 0 10px 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #1a1a2e;
}

.diploma-text-area p {
    margin: 0 0 10px 0;
    font-size: 0.9rem;
    color: #555;
    line-height: 1.7;
}

.diploma-text-area .diploma-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.diploma-badge {
    display: inline-block;
    padding: 4px 12px;
    background: linear-gradient(135deg, #c2185b, #e91e63);
    color: #fff;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.diploma-badge.secondary {
    background: linear-gradient(135deg, #1a1a2e, #0f3460);
}

/* Responsive */
@media screen and (max-width: 600px) {
    .diploma-content-inner {
        flex-direction: column;
    }
    
    .diploma-image-area {
        width: 100%;
        max-width: 200px;
        margin: 0 auto;
    }
    
    .diploma-accordion-trigger {
        padding: 14px 16px;
    }
    
    .diploma-trigger-info h3 {
        font-size: 0.85rem;
    }
}

/* -------------------------------------------------------
   5. GENEL İYİLEŞTİRMELER
   ------------------------------------------------------- */

/* Font Rendering iyileştirmesi */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Uzun URL'lerin layout'ı bozmasını engelle */
p, li, h1, h2, h3, h4, h5, h6 {
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
}

/* Resimlerin taşmasını önle */
img {
    max-width: 100%;
    height: auto;
}

/* 6. Okunabilirlik ve Yazı Boyutu İyileştirmeleri (SEO) */
body, p, .b-text-c, .b-text p, .wsw-02 {
    font-size: 16px !important; /* Mobil ve masaüstünde kolay okunan 16px */
    line-height: 1.6 !important;
}

/* Küçük menüler ve altbilgileri hariç tutma */
.menu-item-text {
    font-size: 15px !important;
}
.s-f-cr, .s-f-sf {
    font-size: 13px !important;
}

/* -------------------------------------------------------
   7. MOBİL SANDVİÇ MENÜ TASARIMI
   ------------------------------------------------------- */

/* Hamburger Butonu Stili */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    cursor: pointer;
    z-index: 1001;
    margin-left: auto;
    padding: 5px;
}

.mobile-menu-toggle span {
    display: block;
    height: 3px;
    width: 100%;
    background-color: #333;
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* Mobil Görünüm (Media Query) */
@media screen and (max-width: 991px) {
    .mobile-menu-toggle {
        display: flex;
    }

    #menu-block {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        max-width: 100%;
        height: 100vh;
        background: #ffffff !important;
        z-index: 1000;
        transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: -5px 0 25px rgba(0,0,0,0.15);
        padding-top: 70px;
        overflow-y: auto;
        overflow-x: auto;
        display: block !important;
        box-sizing: border-box;
    }

    #menu-block.active {
        right: 0;
    }

    /* Ana menü liste yapısı */
    .level-1 {
        flex-direction: column !important;
        align-items: stretch !important;
        white-space: normal !important;
        padding: 0 !important;
        margin: 0 !important;
        list-style: none !important;
        display: flex !important;
        overflow: visible !important;
    }

    .level-1 > li {
        width: 100%;
        border-bottom: 1px solid #e8e8e8;
        display: block;
        position: static !important;
    }

    /* Submenu container'ı mobilde static position */
    .wnd-with-submenu {
        position: static !important;
    }

    .level-1 > li > .menu-item-text,
    .level-1 > li > a {
        padding: 14px 25px !important;
        display: block !important;
        width: 100% !important;
        box-sizing: border-box !important;
        font-size: 16px !important;
        color: #333 !important;
        text-decoration: none !important;
        font-weight: 500 !important;
    }

    .level-1 > li > .menu-item-text:hover,
    .level-1 > li > a:hover {
        background-color: #f5f5f5 !important;
        color: #c2185b !important;
    }

    /* Alt menü container (level-2) */
    .level-2 {
        position: static !important;
        width: 100% !important;
        min-width: 100% !important;
        max-width: none !important;
        box-shadow: none !important;
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
        background: #fafafa !important;
        max-height: none !important;
        opacity: 1 !important;
        visibility: visible !important;
        border: none !important;
        overflow: visible !important;
    }

    /* Level 3+ menüler için */
    .level-2 .level-2,
    .level-3,
    .level-4,
    .level-5 {
        position: static !important;
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow: visible !important;
        left: auto !important;
        right: auto !important;
        top: auto !important;
    }

    /* Alt menü öğeleri */
    .level-2 li {
        display: block !important;
        width: 100% !important;
        border-bottom: 1px solid #eee !important;
    }

    .level-2 li a,
    .level-2 li .menu-item-text {
        padding: 12px 25px 12px 40px !important;
        display: block !important;
        width: 100% !important;
        box-sizing: border-box !important;
        font-size: 15px !important;
        color: #555 !important;
        text-decoration: none !important;
    }

    .level-2 li a:hover,
    .level-2 li .menu-item-text:hover {
        background-color: #f0f0f0 !important;
        color: #c2185b !important;
    }

    /* Hamburger Animasyonu */
    .mobile-menu-toggle.active span:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }
    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    .mobile-menu-toggle.active span:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }

    /* Sayfa kaymasını engelle */
    body.menu-open {
        overflow: hidden;
    }

    /* Hamburger menü overlay arka planı */
    body.menu-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }
}

/* =======================================================
   8. CUSTOM MOBILE MENU SYSTEM (STANDALONE & ACCORDION-FREE)
   ======================================================= */

/* Custom Hamburger Button - Hidden on mobile as drawer is open by default */
.custom-hamburger {
    display: none !important;
}

/* Custom Mobile Menu Drawer */
#custom-mobile-menu-drawer {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important; /* Start fully open */
    width: 300px !important;
    height: 100dvh !important;
    background: #ffffff !important;
    z-index: 10002 !important;
    box-shadow: -4px 0 25px rgba(0, 0, 0, 0.15) !important;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
    display: flex !important;
    flex-direction: column !important;
    font-family: inherit !important;
    box-sizing: border-box !important;
}

#custom-mobile-menu-drawer.minimized {
    right: -300px !important; /* Minimize to the right */
}

/* Header inside drawer */
.custom-mobile-menu-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 20px 24px !important;
    border-bottom: 2px solid #f3f4f6 !important;
    background-color: #fafafa !important;
}

.custom-mobile-menu-header span {
    font-size: 20px !important;
    font-weight: 700 !important;
    color: #111827 !important;
    letter-spacing: 0.03em !important;
}

/* Sidebar minimize toggle button (40% larger with 10s color animation) */
.custom-sidebar-toggle {
    position: absolute !important;
    top: 50% !important;
    left: -56px !important;
    transform: translateY(-50%) !important;
    width: 56px !important;
    height: 84px !important;
    background-color: #c2185b !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 12px 0 0 12px !important;
    box-shadow: -3px 0 10px rgba(0, 0, 0, 0.18) !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 38px !important;
    font-weight: 300 !important;
    line-height: 1 !important;
    padding: 0 0 6px 0 !important;
    z-index: 10003 !important;
    transition: background-color 0.2s !important;
    outline: none !important;
    animation: sidebarTabPulse 10s infinite ease-in-out !important;
}

.custom-sidebar-toggle:hover {
    background-color: #a01046 !important;
    animation: none !important; /* stop animation on hover */
}

@keyframes sidebarTabPulse {
    0%, 100% { background-color: #c2185b; }
    50% { background-color: #e91e63; }
}

/* List container */
.custom-mobile-menu-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow-y: auto !important;
    flex: 1 !important;
    overscroll-behavior: contain !important;
}

/* Menu items */
.custom-menu-item {
    position: relative !important;
    border-bottom: 1px solid #f3f4f6 !important;
}

.custom-menu-item a {
    display: block !important;
    padding: 15px 24px !important;
    color: #1f2937 !important;
    text-decoration: none !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    transition: color 0.2s, background-color 0.2s !important;
    line-height: 1.4 !important;
}

.custom-menu-item a:hover {
    color: #c2185b !important;
    background-color: #fff5f8 !important;
}

.custom-menu-item.active > a {
    color: #c2185b !important;
    font-weight: 700 !important;
    background-color: #fff5f8 !important;
    border-left: 4px solid #c2185b !important;
    padding-left: 20px !important;
}

/* Submenu container (always visible & nested) */
.custom-submenu {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    background-color: #fafafa !important;
    border-top: 1px solid #f3f4f6 !important;
}

/* Submenu items styling */
.custom-sub-menu-item {
    border-bottom: 1px solid #f3f4f6 !important;
}

.custom-sub-menu-item:last-child {
    border-bottom: none !important;
}

.custom-sub-menu-item a {
    padding: 11px 24px 11px 40px !important;
    font-size: 14px !important;
    color: #4b5563 !important;
    font-weight: 500 !important;
}

.custom-sub-menu-item a:hover {
    color: #c2185b !important;
    background-color: #fff5f8 !important;
}

.custom-sub-menu-item.active > a {
    color: #c2185b !important;
    font-weight: 600 !important;
    background-color: #fff5f8 !important;
}

/* Custom Overlay (Transparent to prevent dimming, but catches click events) */
#custom-mobile-menu-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: transparent !important;
    z-index: 10000 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: opacity 0.3s, visibility 0.3s !important;
}

#custom-mobile-menu-overlay.active {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Body lock state */
body.custom-menu-open {
    overflow: hidden !important;
}

/* Desktop Hiding Rules */
@media screen and (min-width: 992px) {
    .custom-hamburger,
    #custom-mobile-menu-drawer,
    #custom-mobile-menu-overlay {
        display: none !important;
    }
}

/* Mobile Display & Webnode Reset Rules */
@media screen and (max-width: 991px) {
    /* Hide all default Webnode menu blocks and old toggle styles completely */
    #menu-block,
    #menu-mobile,
    #menu-submit,
    .mobile-menu-toggle {
        display: none !important;
    }
    
    /* Suppress default Webnode overlay */
    body.menu-open::before {
        display: none !important;
    }
}
