:root {
    --main-bg: hsla(204, 100%, 96%);
    --second-bg: hsla(204, 100%, 90%);
    --accent: hsla(196, 100%, 45%);
    --title: hsla(196, 100%, 15%);
    --text: hsla(196, 100%, 10%);
    --main-text: #065c59;
    --second-text: #207983;
}

* {
    box-sizing: border-box;
}

/* --- HEADER YAPISI --- */
.main-header {
    background: linear-gradient(
        to right,
        color-mix(in srgb, var(--accent), transparent 20%),
        color-mix(in srgb, var(--main-text), transparent 20%)
    );
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    height: 75px;
    width: 100%;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 9999;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.nav-container {
    margin: 0 auto;
    width: 100%;
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
}

/* --- LOGO --- */
.logo {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
}

.logo img {
    height: 40px;
    display: block;
}

.logo-text {
    color: #fff;
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.2;
    max-width: 160px;
    display: block;
    padding-left: 15px;
    border-left: 1px solid rgba(255, 255, 255, 1);
}

/* --- NAVIGASYON --- */
.nav-links {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
}

.nav-links > li {
    position: static;
    display: flex;
    align-items: center;
}

.nav-links > li > a {
    padding: 0 15px;
    height: 75px;
    line-height: 75px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    color: white;
    display: block;
    transition: 0.3s;
}

.nav-links > li > a:hover {
    color: var(--text);
}

.nav-links > li > a.nav-btn {
    height: auto;
    line-height: 1.2;
    padding: 12px 25px !important;
    background: var(--title);
    color: white !important;
    border-radius: 12px;
    margin-left: 10px;
    display: inline-flex;
    align-items: center;
}

.nav-links > li > a.nav-btn:hover {
    background: var(--accent);
    transform: translateY(-2px);
    transition: all 0.3s ease;
}

.nav-links > li > a.nav-btn:active {
    transform: translateY(0);
}

/* --- MEGA MENU --- */
.mega-menu {
    position: fixed;
    top: 75px;
    left: 0;
    width: 100%;
    background: var(--main-bg);
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    padding: 40px 0 60px 0;
    opacity: 0;
    visibility: hidden;
    clip-path: circle(0% at 50% 0%);
    transition:
        clip-path 0.8s cubic-bezier(0.77, 0, 0.175, 1),
        opacity 0.4s ease;
    pointer-events: none;
    z-index: 9998;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    max-height: calc(100vh - 75px);
}

.nav-links li:hover .mega-menu {
    opacity: 1;
    visibility: visible;
    clip-path: circle(150% at 50% 0%);
    pointer-events: auto;
}

.mega-menu-content {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1200px;
    padding: 0 50px;
    box-sizing: border-box;
}

.mega-side-title {
    width: 100%;
    text-align: left;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--second-text);
}

.mega-side-title h2 {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--main-text);
    text-transform: uppercase;
    margin: 0;
}

/* --- WRAPPER & SÜTUNLAR --- */
.mega-wrapper {
    display: grid;
    width: 100%;
    gap: 40px;
    align-items: start;
}

.col-2 .mega-wrapper {
    grid-template-columns: repeat(2, 1fr);
}
.col-4 .mega-wrapper {
    grid-template-columns: repeat(4, 1fr);
}

.mega-col {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
    padding: 22px;
    border: solid 1px var(--second-text);
    border-radius: 22px;
    background: transparent;
}

.nav-links li:hover .mega-col {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.3s;
}

.mega-col h3 {
    text-align: center;
    font-size: 1.5rem;
    color: var(--main-text);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: solid 1px var(--second-text);
    text-transform: uppercase;
    margin-top: 0;
}

.mega-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Standart 2'li ve 4'lü menüler için */
.col-2 .mega-col ul {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0 20px;
}

.mega-col ul li a {
    text-align: center;
    text-decoration: none;
    color: var(--second-text);
    font-size: 1rem;
    padding: 8px 0;
    display: block;
    transition: 0.3s ease;
    font-weight: 400;
    height: auto;
    line-height: normal;
}

.mega-col ul li a:hover {
    color: var(--title);
    transform: translateX(5px);
}

/* --- HAMBURGER MENU --- */
.hamburger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    cursor: pointer;
    z-index: 10000;
}

.hamburger-menu span {
    width: 100%;
    height: 3px;
    background-color: var(--main-text);
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* --- SPLIT LAYOUT (HİZMETLER MENÜSÜ İÇİN ÖZEL AYARLAR) --- */

.mega-wrapper.split-layout {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    width: 100%;
}

.mega-left-column {
    flex: 1;
    display: grid;
    /* Kurumsal ve Belediye bloklarını yan yana tutar */
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

/* >>>>> İŞTE İSTEDİĞİN KISIM BURASI <<<<< */
.mega-wrapper.split-layout .mega-col ul {
    /* Listeyi Grid Yapıyoruz */
    display: grid !important;
    /* İçerdeki linkleri 2 sütuna bölüyoruz */
    grid-template-columns: repeat(2, 1fr);
    gap: 5px 15px; /* Dikey boşluk 5px, Yatay boşluk 15px */
}

.mega-wrapper.split-layout .mega-col ul li a {
    text-align: left;
    padding: 8px 10px;
    border-radius: 6px;
    display: block;
    transition: all 0.3s ease;
    border-left: 2px solid transparent;
    font-size: 0.85rem; /* Sığması için fontu biraz küçülttük */
    white-space: nowrap; /* Yazı alt satıra kaymasın */
    overflow: hidden;
    text-overflow: ellipsis; /* Sığmazsa ... koysun */
}

.mega-wrapper.split-layout .mega-col ul li a:hover {
    background-color: color-mix(in srgb, var(--title), transparent 95%);
    color: var(--accent);
    border-left-color: var(--accent);
    transform: translateX(3px);
}

.mega-right-image {
    width: 400px;
    flex-shrink: 0;
    position: sticky;
    top: 20px;
}

.image-box {
    width: 100%;
    height: 350px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    background: #f0f0f0;
    position: relative;
}

.image-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition:
        transform 0.5s ease,
        opacity 0.3s ease;
}

.mega-right-image:hover img {
    transform: scale(1.05);
}

/* --- MOBİL GÖRÜNÜM --- */
/* Mobili en alta aldık ki yukarıdaki ayarlar mobili bozmasın */
/* --- MOBİL GÖRÜNÜM (YENİDEN DÜZENLENDİ) --- */
@media screen and (max-width: 991px) {
    .nav-container {
        padding: 0 20px;
    }

    .hamburger-menu {
        display: flex;
    }

    /* Hamburger çizgilerinin rengi */
    .hamburger-menu span {
        background-color: #fff; /* Header üzerindeyken beyaz daha iyi görünür */
    }

    .nav-links {
        position: fixed;
        top: 75px;
        right: -100%;
        width: 85%; /* Tam ekran yerine hafif boşluk daha modern durur */
        height: calc(100vh - 75px);
        background: var(--main-bg); /* Root'tan açık arka plan */
        flex-direction: column;
        align-items: flex-start;
        padding: 20px;
        transition: right 0.4s cubic-bezier(0.77, 0, 0.175, 1);
        overflow-y: auto;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
        z-index: 10001;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links > li {
        width: 100%;
        display: block;
        border-bottom: 1px solid var(--second-bg); /* Hafif belirgin ayraç */
    }

    .nav-links > li > a {
        height: auto;
        line-height: normal;
        padding: 18px 10px;
        width: 100%;
        color: var(--text) !important; /* Root'tan koyu metin rengi */
        font-size: 1rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    /* Mobilde Buton Görünümü */
    .nav-links > li > a.nav-btn {
        margin: 20px 0;
        width: 100%;
        justify-content: center;
        background: var(--accent);
        color: white !important;
        border-radius: 10px;
        padding: 15px;
    }

    /* --- MOBİL MEGA MENU AYARLARI --- */
    .mega-menu {
        position: static;
        width: 100%;
        opacity: 1;
        visibility: visible;
        clip-path: none;
        box-shadow: none;
        padding: 0;
        background: var(--second-bg); /* Bir tık farklı arka plan */
        display: none; /* JS ile toggle ediliyorsa */
        pointer-events: auto;
        max-height: none;
        border-radius: 12px;
        margin-bottom: 10px;
    }

    /* Menüye tıklandığında veya hoverda (isteğe bağlı) açılması için */
    .nav-links li:hover .mega-menu {
        display: block;
    }

    .mega-menu-content {
        padding: 15px;
    }

    .mega-wrapper,
    .col-2 .mega-wrapper,
    .col-4 .mega-wrapper,
    .mega-left-column {
        grid-template-columns: 1fr !important;
        gap: 15px;
        display: grid;
    }

    .mega-col {
        opacity: 1;
        transform: none;
        padding: 15px;
        border: 1px solid var(--accent); /* Root rengiyle ince çerçeve */
        background: white;
    }

    .mega-col h3 {
        font-size: 1.1rem;
        color: var(--title);
        margin-bottom: 10px;
        text-align: left;
    }

    .mega-col ul li a {
        color: var(--second-text) !important;
        text-align: left;
        padding: 10px 0;
        font-size: 0.95rem;
        border-bottom: 1px dashed var(--second-bg);
    }

    .mega-col ul li:last-child a {
        border-bottom: none;
    }

    /* Hizmetler özel grid yapısını mobilde dikey listeye çevir */
    .mega-wrapper.split-layout .mega-col ul {
        display: flex !important;
        flex-direction: column;
        grid-template-columns: 1fr !important;
    }

    /* Gizlenecek öğeler */
    .mega-right-image,
    .mega-side-title {
        display: none;
    }

    /* Hamburger Animasyonu */
    .hamburger-menu.toggle span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 6px);
    }
    .hamburger-menu.toggle span:nth-child(2) {
        opacity: 0;
    }
    .hamburger-menu.toggle span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -6px);
    }
}

@media screen and (max-width: 991px) {
    html,
    body {
        overflow-x: hidden;
        width: 100%;
        position: relative; /* Mobilde menü açılırken sayfa titremesin diye */
    }
}

@media screen and (max-width: 991px) {
    /* 1. Header'ı Ekrana Çivile */
    .main-header {
        position: fixed; /* Sticky yerine Fixed */
        top: 0;
        left: 0;
        width: 100%;
        /* Arka planın kayarken görünmemesi için zaten blur ve renk var, sorun yok */
    }

    /* 2. İçeriğin Yukarı Kaçmasını Engelle */
    /* Header 'fixed' olunca sayfadan kopar, alttaki içerik yukarı kayar.
       Bunu engellemek için body'ye header kadar (75px) boşluk veriyoruz. */
    body {
        padding-top: 75px;
    }
}

/* --- YAPAY ZEKA MENÜSÜ İÇİN ÖZEL STİL --- */

/* Wrapper'ı ortalar */
.compact-wrapper {
    display: flex;
    justify-content: center;
    width: 100%;
}

/* Kutuyu genişletir ve ortalar */
.ai-box {
    width: 100%;
    max-width: 900px; /* Çok yayılmasın diye sınır */
    text-align: center;
    background: linear-gradient(
        to bottom right,
        rgba(255, 255, 255, 0.8),
        rgba(255, 255, 255, 0.5)
    );
    border-color: var(--accent); /* Hafif vurgu rengi */
}

/* Linkleri yan yana 4'lü dizer */
.ai-grid-list {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr); /* 4 Eşit Parça */
    gap: 20px;
    margin-top: 15px;
}

/* Linklerin görünümü */
.ai-grid-list li a {
    text-align: center !important; /* Yazıyı ortala */
    padding: 15px 10px !important;
    border: 1px solid transparent;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.5);
    display: flex;
    flex-direction: column; /* İkon ve yazıyı alt alta al */
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

/* Hover efekti */
.ai-grid-list li a:hover {
    background: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-5px) !important;
    border-color: var(--second-bg);
}

/* İkon boyutu */
.ai-grid-list .icon {
    font-size: 1.5rem;
}

/* --- MOBİL UYUMLULUK (Yapay Zeka İçin) --- */
@media screen and (max-width: 991px) {
    .ai-grid-list {
        grid-template-columns: 1fr; /* Mobilde alt alta olsun */
        gap: 10px;
    }

    .ai-grid-list li a {
        flex-direction: row; /* Mobilde ikon solda, yazı sağda olsun */
        text-align: left !important;
        justify-content: flex-start;
        padding: 10px !important;
    }

    .compact-wrapper {
        display: block;
    }
}
