/**
 * Mega Menu Styles - Premium Hosting Design
 * Resimdeki tasarıma göre yeniden oluşturuldu
 * Desktop-menu.css'den bağımsız, kendi stilleriyle çalışıyor
 * 
 * @package Developer_Hosting
 */

/* Desktop-menu.css çakışmalarını override et */
.main-navigation .has-mega-menu > .sub-menu,
.main-navigation .mega-menu-dropdown {
    min-width: auto !important;
    display: block !important;
    grid-template-columns: none !important;
}

/* ===================================
   Primary Menu - Base Styles
   =================================== */

.primary-menu {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.primary-menu > li {
    position: relative;
}

.primary-menu > li > a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    position: relative;
}

.primary-menu > li > a:hover,
.primary-menu > li.current-menu-item > a,
.primary-menu > li.has-mega-menu:hover > a,
.primary-menu > li.menu-item-has-children:hover > a,
.primary-menu > li.menu-open > a {
    background: rgba(255, 122, 0, 0.08);
    color: #ff7a00;
}

/* Dropdown Arrow */
.primary-menu > li > a .dropdown-arrow {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.primary-menu > li.has-mega-menu:hover > a .dropdown-arrow,
.primary-menu > li.menu-item-has-children:hover > a .dropdown-arrow,
.primary-menu > li.menu-open > a .dropdown-arrow {
    transform: rotate(180deg);
}

/* ===================================
   Mega Menu Dropdown - Premium Design
   =================================== */

/* Invisible bridge to maintain hover */
@media (min-width: 1025px) {
    .primary-menu > li.has-mega-menu::after,
    .primary-menu > li.menu-item-has-children::after {
        content: '';
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        height: 20px;
        background: transparent;
    }
}

.primary-menu > li > .mega-menu-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    transform: translateY(10px);
    min-width: 1100px;
    max-width: 1300px;
    width: auto;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    z-index: 9999;
    padding: 0;
    list-style: none;
    margin: 0;
    display: block;
}

.mega-menu-dropdown > li > a {
    display: block;
    text-decoration: none;
    color: inherit;
}

.primary-menu > li:hover > .mega-menu-dropdown,
.primary-menu > li.menu-open > .mega-menu-dropdown {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

/* Remove arrow pointer for mega menu */
.primary-menu > li > .mega-menu-dropdown::before,
.primary-menu > li > .mega-menu-dropdown::after {
    display: none;
}

/* ===================================
   Mega Menu Content Container
   =================================== */

.mega-menu-content {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.15),
        0 8px 25px rgba(0, 0, 0, 0.1);
    padding: 20px;
    display: block;
    position: relative;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

/* ===================================
   Hosting Plans Grid (Left Side)
   =================================== */

.mega-menu-plans {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    width: 100%;
    align-items: stretch;
    list-style: none;
    margin: 0;
    padding: 0;
}

.mega-menu-dropdown > li {
    list-style: none;
    margin: 0;
    padding: 0;
    display: contents; /* Remove li from layout, let content flow directly into grid */
}

.mega-menu-dropdown > li > a {
    display: contents; /* Remove anchor from layout too */
    text-decoration: none;
    color: inherit;
}

.mega-menu-plan-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    color: inherit;
    height: 100%;
    box-sizing: border-box;
    width: 100%;
}

.mega-menu-plan-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #0ea5e9 0%, #3b82f6 100%);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.mega-menu-plan-card:hover {
    border-color: #0ea5e9;
    box-shadow: 0 8px 25px rgba(14, 165, 233, 0.15);
    transform: translateY(-4px);
    text-decoration: none;
    color: inherit;
}

.mega-menu-plan-card:hover::before {
    transform: scaleX(1);
}

.mega-menu-plan-card.popular {
    border-color: #0ea5e9;
    border-width: 2px;
}

.mega-menu-plan-card.popular::before {
    transform: scaleX(1);
}

.mega-menu-plan-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.mega-menu-plan-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #0ea5e9 0%, #3b82f6 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mega-menu-plan-icon svg {
    width: 16px;
    height: 16px;
    color: #ffffff;
}

.mega-menu-plan-title {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    line-height: 1.3;
}

.mega-menu-plan-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #0f172a;
    color: #ffffff;
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mega-menu-plan-description {
    font-size: 12px;
    color: #64748b;
    line-height: 1.4;
    margin: 0;
    flex: 1;
}

/* ===================================
   Free Site Builder Card (Right Side)
   =================================== */

.mega-menu-featured {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 20px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    width: 100%;
    box-sizing: border-box;
}

.mega-menu-featured::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

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

.mega-menu-featured-content {
    position: relative;
    z-index: 2;
}

.mega-menu-featured-title {
    font-size: 18px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 10px;
    line-height: 1.2;
}

.mega-menu-featured-description {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 16px;
    line-height: 1.4;
}

.mega-menu-featured-description svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.mega-menu-featured-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    background: #ffffff;
    color: #10b981;
    font-size: 13px;
    font-weight: 700;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    width: 100%;
    text-align: center;
}

.mega-menu-featured-button:hover {
    background: #f0fdf4;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.mega-menu-featured-visual {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 120px;
    height: 120px;
    opacity: 0.2;
    z-index: 1;
}

.mega-menu-featured-visual svg {
    width: 100%;
    height: 100%;
    color: rgba(255, 255, 255, 0.2);
}

/* ===================================
   SSL Banner (Bottom)
   =================================== */

.mega-menu-banner {
    background: #0f172a;
    border-radius: 10px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    width: 100%;
}

.mega-menu-banner-icon {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mega-menu-banner-icon svg {
    width: 18px;
    height: 18px;
    color: #ffffff;
}

.mega-menu-banner-text {
    font-size: 13px;
    color: #ffffff;
    line-height: 1.4;
    margin: 0;
    flex: 1;
}

.mega-menu-banner-text strong {
    color: #fbbf24;
    font-weight: 700;
}

/* ===================================
   Animation Effects
   =================================== */

.mega-menu-content {
    opacity: 0;
    transform: translateY(10px);
}

.primary-menu > li:hover .mega-menu-content,
.primary-menu > li.menu-open .mega-menu-content {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.mega-menu-plan-card {
    opacity: 0;
    transform: translateY(10px);
}

.primary-menu > li:hover .mega-menu-plan-card,
.primary-menu > li.menu-open .mega-menu-plan-card {
    opacity: 1;
    transform: translateY(0);
}

.mega-menu-plan-card:nth-child(1) { transition-delay: 0.05s; }
.mega-menu-plan-card:nth-child(2) { transition-delay: 0.1s; }
.mega-menu-plan-card:nth-child(3) { transition-delay: 0.15s; }
.mega-menu-plan-card:nth-child(4) { transition-delay: 0.2s; }
.mega-menu-plan-card:nth-child(5) { transition-delay: 0.25s; }
.mega-menu-plan-card:nth-child(6) { transition-delay: 0.3s; }

/* ===================================
   Mobile Responsive
   =================================== */

@media (max-width: 1024px) {
    .main-navigation {
        position: fixed;
        top: 0;
        left: -100%;
        width: 100%;
        max-width: 320px;
        height: 100vh;
        background: #ffffff;
        padding: 80px 20px 30px;
        overflow-y: auto;
        transition: left 0.3s ease;
        z-index: 10000;
        box-shadow: 5px 0 30px rgba(0, 0, 0, 0.2);
    }
    
    .main-navigation.toggled {
        left: 0 !important;
    }
    
    .primary-menu {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }
    
    .primary-menu > li {
        border-bottom: 1px solid #f1f5f9;
    }
    
    .primary-menu > li > a {
        padding: 16px;
        border-radius: 0;
        justify-content: space-between;
    }
    
    .primary-menu > li > a::after {
        display: none;
    }
    
    /* Mobile dropdown - aynı kalacak */
    .primary-menu > li > .mega-menu-dropdown {
        position: static;
        min-width: 100%;
        width: 100%;
        max-width: 100%;
        box-shadow: none;
        border-radius: 0;
        background: #f8fafc;
        margin-top: 0;
        padding: 8px 0;
        max-height: 0;
        overflow: hidden;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: none;
        transition: max-height 0.3s ease;
        left: auto;
    }
    
    .mega-menu-content {
        grid-template-columns: 1fr;
    }
    
    .primary-menu > li.menu-open > .mega-menu-dropdown {
        max-height: 2000px;
    }
    
    .mega-menu-content {
        padding: 20px;
        opacity: 1;
        transform: none;
    }
    
    .mega-menu-plans {
        grid-template-columns: 1fr;
    }
    
    .mega-menu-dropdown > li {
        display: block;
    }
    
    .mega-menu-featured {
        min-height: auto;
    }
    
    .mega-menu-banner {
        margin-top: 0;
    }
    
    /* Remove bridge on mobile */
    .primary-menu > li.has-mega-menu::after,
    .primary-menu > li.menu-item-has-children::after {
        display: none;
    }
    
    /* Mobile menu toggle */
    .menu-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        background: #f8fafc;
        border: none;
        border-radius: 10px;
        cursor: pointer;
    }
    
    .menu-toggle svg {
        width: 24px;
        height: 24px;
        color: #1e293b;
    }
}

/* Desktop - hide toggle */
@media (min-width: 1025px) {
    .menu-toggle {
        display: none !important;
    }
}

/* ===================================
   Dark Mode Support
   =================================== */

.dark-mode .primary-menu > li > a {
    color: #e2e8f0;
}

.dark-mode .primary-menu > li > a:hover,
.dark-mode .primary-menu > li.has-mega-menu:hover > a {
    background: rgba(255, 122, 0, 0.15);
    color: #ff7a00;
}

.dark-mode .mega-menu-content {
    background: #1e293b;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.4),
        0 8px 25px rgba(0, 0, 0, 0.3);
}

.dark-mode .mega-menu-plan-card {
    background: #0f172a;
    border-color: #334155;
}

.dark-mode .mega-menu-plan-title {
    color: #e2e8f0;
}

.dark-mode .mega-menu-plan-description {
    color: #94a3b8;
}
