/*--------------------------------------------------------------
Mega Menu Styles - PlantArch Custom
Responsive & Mobile Uyumlu Tasarım
--------------------------------------------------------------*/

/* ============================================
   KÖŞE YAZILARI Mega Menu - Ana Yapı
   ============================================ */

.newsx-desktop-menu .menu-item.mega-menu-full {
    position: static;
}

.newsx-desktop-menu .menu-item.mega-menu-full > .sub-menu {
    display: flex !important;
    flex-wrap: nowrap;
    width: calc(100% - 40px);
    max-width: 1100px;
    left: 50% !important;
    transform: translateX(-50%) translateY(15px);
    padding: 0;
    background-color: #fff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
    overflow: hidden;
    z-index: 99999;
}

.newsx-desktop-menu .menu-item.mega-menu-full:hover > .sub-menu,
.newsx-desktop-menu .menu-item.mega-menu-full > .sub-menu.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

/* Eski menu-item'ları gizle */
.newsx-desktop-menu .menu-item.mega-menu-full > .sub-menu.mega-restructured > .menu-item {
    display: none !important;
}

/* ============================================
   Sol Kolon - Kategori Listesi
   ============================================ */

.mega-menu-left-column {
    width: 200px;
    min-width: 200px;
    background: linear-gradient(180deg, #166534 0%, #14532d 100%);
    padding: 15px 0;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    border-radius: 12px 0 0 12px;
}

.mega-menu-category-item {
    display: block;
    position: relative;
}

.mega-menu-category-item a {
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.85);
    padding: 13px 20px;
    font-weight: 500;
    font-size: 14px;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
    background-color: transparent;
    text-decoration: none;
    position: relative;
}

.mega-menu-category-item a::after {
    content: '';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-right: 2px solid rgba(255,255,255,0.5);
    border-bottom: 2px solid rgba(255,255,255,0.5);
    transform: translateY(-50%) rotate(-45deg);
    opacity: 0;
    transition: opacity 0.2s ease, right 0.2s ease;
}

.mega-menu-category-item a:hover,
.mega-menu-category-item.mega-active a {
    background-color: rgba(0, 0, 0, 0.2);
    border-left-color: #4ade80;
    color: #fff;
}

.mega-menu-category-item.mega-active a::after {
    opacity: 1;
    right: 12px;
}

/* ============================================
   Sağ Kolon - Dinamik İçerik Alanı
   ============================================ */

.mega-menu-content-area {
    flex: 1;
    min-height: 320px;
    max-height: 420px;
    overflow-y: auto;
    overflow-x: hidden;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    padding: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-content: flex-start;
    border-radius: 0 12px 12px 0;
}

/* Custom Scrollbar */
.mega-menu-content-area::-webkit-scrollbar {
    width: 6px;
}

.mega-menu-content-area::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.05);
    border-radius: 3px;
}

.mega-menu-content-area::-webkit-scrollbar-thumb {
    background: #166534;
    border-radius: 3px;
}

.mega-menu-content-area::-webkit-scrollbar-thumb:hover {
    background: #14532d;
}

/* ============================================
   Post Kartları
   ============================================ */

.mega-menu-content-area .mega-menu-post {
    width: calc(33.333% - 10px);
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.mega-menu-content-area .mega-menu-post::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #166534, #4ade80);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.mega-menu-content-area .mega-menu-post:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(22, 101, 52, 0.2);
}

.mega-menu-content-area .mega-menu-post:hover::before {
    transform: scaleX(1);
}

.mega-menu-content-area .mega-menu-post a {
    display: block;
    text-decoration: none;
}

.mega-menu-content-area .mega-menu-post-image {
    width: 100%;
    height: 110px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.mega-menu-content-area .mega-menu-post:hover .mega-menu-post-image {
    transform: scale(1.05);
}

.mega-menu-content-area .mega-menu-post a {
    overflow: hidden;
}

.mega-menu-content-area .mega-menu-post-title {
    padding: 12px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.5;
    transition: color 0.2s ease;
}

.mega-menu-content-area .mega-menu-post:hover .mega-menu-post-title {
    color: #166534;
}

/* Loading & Empty States */
.mega-menu-content-area .mega-menu-loading {
    width: 100%;
    height: 100%;
    min-height: 200px;
    text-align: center;
    padding: 50px;
    color: #6b7280;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.mega-menu-content-area .mega-menu-loading::before {
    content: '';
    width: 40px;
    height: 40px;
    border: 3px solid #e5e7eb;
    border-top-color: #166534;
    border-radius: 50%;
    animation: megaMenuSpin 0.8s linear infinite;
    margin-bottom: 15px;
}

.mega-menu-content-area .mega-menu-loading.no-spinner::before {
    display: none;
}

@keyframes megaMenuSpin {
    to { transform: rotate(360deg); }
}

/* Placeholder resim stili */
.mega-menu-content-area .mega-menu-no-image {
    background: linear-gradient(135deg, #166534 0%, #15803d 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mega-menu-content-area .mega-menu-no-image::after {
    content: '🌿';
    font-size: 36px;
}

/* ============================================
   Kategori Başlığı (Sağ üst)
   ============================================ */

.mega-menu-category-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 12px;
    border-bottom: 2px solid rgba(22, 101, 52, 0.15);
}

.mega-menu-category-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #166534;
}

.mega-menu-category-header .mega-menu-view-all {
    font-size: 13px;
    color: #166534;
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
}

.mega-menu-category-header .mega-menu-view-all:hover {
    color: #14532d;
    gap: 8px;
}

.mega-menu-category-header .mega-menu-view-all::after {
    content: '→';
}

/* ============================================
   RESPONSIVE - Tablet
   ============================================ */

@media (max-width: 1200px) {
    .newsx-desktop-menu .menu-item.mega-menu-full > .sub-menu {
        max-width: 95%;
    }
    
    .mega-menu-left-column {
        width: 180px;
        min-width: 180px;
    }
    
    .mega-menu-category-item a {
        padding: 11px 15px;
        font-size: 13px;
    }
}

@media (max-width: 1024px) {
    .mega-menu-content-area .mega-menu-post {
        width: calc(50% - 8px);
    }
    
    .mega-menu-content-area {
        padding: 15px;
        gap: 12px;
    }
    
    .mega-menu-content-area .mega-menu-post-image {
        height: 90px;
    }
}

/* ============================================
   RESPONSIVE - Mobile (991px ve altı)
   Mega menu gizlenir, normal dropdown gösterilir
   ============================================ */

@media (max-width: 991px) {
    /* Desktop mega menu'yu tamamen gizle */
    .newsx-desktop-menu .menu-item.mega-menu-full > .sub-menu {
        display: none !important;
    }
    
    /* Mobile menüde mega-menu class'ını devre dışı bırak */
    .newsx-mobile-menu .menu-item.mega-menu-full > .sub-menu {
        display: none;
    }
    
    .newsx-mobile-menu .menu-item.mega-menu-full > .sub-menu.active {
        display: block;
    }
}

/* ============================================
   Basit Mega Menu - Grid Görünümü
   (mega-menu class'ı için - alternatif)
   ============================================ */

.newsx-desktop-menu .menu-item.mega-menu {
    position: static;
}

.newsx-desktop-menu .menu-item.mega-menu > .sub-menu {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    width: calc(100% - 40px);
    max-width: 800px;
    left: 50% !important;
    transform: translateX(-50%) translateY(15px);
    padding: 20px;
    background-color: #fff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
}

.newsx-desktop-menu .menu-item.mega-menu:hover > .sub-menu,
.newsx-desktop-menu .menu-item.mega-menu > .sub-menu.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.newsx-desktop-menu .menu-item.mega-menu > .sub-menu > .menu-item {
    width: 100%;
    padding: 0;
    background: transparent;
}

.newsx-desktop-menu .menu-item.mega-menu > .sub-menu > .menu-item > a {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 18px 12px;
    border-radius: 10px;
    background-color: #f0fdf4;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 14px;
    color: #166534;
}

.newsx-desktop-menu .menu-item.mega-menu > .sub-menu > .menu-item > a:hover {
    background-color: #166534;
    color: #fff;
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(22, 101, 52, 0.3);
}

.newsx-desktop-menu .menu-item.mega-menu > .sub-menu > .menu-item > a .newsx-menu-item-label,
.newsx-desktop-menu .menu-item.mega-menu > .sub-menu .sub-menu-icon {
    display: none;
}

@media (max-width: 991px) {
    .newsx-desktop-menu .menu-item.mega-menu > .sub-menu {
        display: none !important;
    }
}

/* ============================================
   Animasyonlar
   ============================================ */

@keyframes megaMenuFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mega-menu-content-area .mega-menu-post {
    animation: megaMenuFadeIn 0.3s ease forwards;
}

.mega-menu-content-area .mega-menu-post:nth-child(1) { animation-delay: 0.05s; }
.mega-menu-content-area .mega-menu-post:nth-child(2) { animation-delay: 0.1s; }
.mega-menu-content-area .mega-menu-post:nth-child(3) { animation-delay: 0.15s; }
.mega-menu-content-area .mega-menu-post:nth-child(4) { animation-delay: 0.2s; }
.mega-menu-content-area .mega-menu-post:nth-child(5) { animation-delay: 0.25s; }
.mega-menu-content-area .mega-menu-post:nth-child(6) { animation-delay: 0.3s; }
