/**
 * Apple-Inspired Professional Navigation Menu
 * Premium Design System - macOS/iOS Style
 * Version: 2.0
 */

/* ============================================
   NAVBAR - Apple macOS Style
   ============================================ */
.navbar {
    background: rgba(251, 251, 253, 0.72);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    box-shadow: 0 0.5px 0 rgba(0, 0, 0, 0.08), 0 1px 0 rgba(255, 255, 255, 0.5) inset;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 9999;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.06);
}

.navbar.scrolled {
    background: rgba(251, 251, 253, 0.88);
    backdrop-filter: blur(40px) saturate(200%);
    -webkit-backdrop-filter: blur(40px) saturate(200%);
    padding: 0.75rem 0;
    box-shadow: 0 0.5px 0 rgba(0, 0, 0, 0.1), 0 1px 0 rgba(255, 255, 255, 0.6) inset;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 600;
    background: linear-gradient(135deg, #e63946 0%, #ff6b9d 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    letter-spacing: -0.5px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    padding: 0;
    margin: 0;
    line-height: 1;
}

.navbar-brand:hover {
    transform: scale(1.02);
    opacity: 0.9;
}

.site-logo {
    height: 40px !important;
    width: auto !important;
    max-width: 150px !important;
    object-fit: contain;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: block;
    margin: 0;
    padding: 0;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* ============================================
   NAVBAR COLLAPSE - Apple Style
   ============================================ */
.navbar-collapse {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.navbar-collapse.show {
    display: flex !important;
}

/* ============================================
   DESKTOP NAVBAR - Horizontal Layout
   ============================================ */
@media (min-width: 992px) {
    .navbar-collapse {
        display: flex !important;
    }
    
    .navbar-nav {
        gap: 0.125rem;
        display: flex;
        flex-direction: row;
        align-items: center;
        width: auto;
        margin-left: auto;
    }
    
    .navbar-nav .nav-item {
        width: auto;
        margin: 0;
        position: relative;
    }
    
    .navbar-nav .nav-link {
        padding: 0.5rem 0.875rem !important;
        width: auto;
        white-space: nowrap;
        font-size: 0.8125rem;
        font-weight: 500;
        border-radius: 6px;
        transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
        color: var(--text-dark) !important;
        position: relative;
        letter-spacing: -0.01em;
        font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Inter', sans-serif;
        display: flex;
        align-items: center;
        gap: 0.375rem;
    }
    
    .navbar-nav .nav-link::before {
        content: '';
        position: absolute;
        inset: 0;
        background: rgba(230, 57, 70, 0.08);
        border-radius: 6px;
        opacity: 0;
        transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1);
        z-index: -1;
    }
    
    .navbar-nav .nav-link:hover {
        color: var(--primary-color) !important;
    }
    
    .navbar-nav .nav-link:hover::before {
        opacity: 1;
    }
    
    .navbar-nav .nav-link.active {
        background: rgba(230, 57, 70, 0.12);
        color: var(--primary-color) !important;
        font-weight: 600;
    }
    
    .navbar-nav .nav-link.active::before {
        opacity: 1;
        background: rgba(230, 57, 70, 0.12);
    }
    
    /* Dropdown Toggle - Apple Style */
    .navbar-nav .dropdown-toggle {
        cursor: pointer;
        position: relative;
        padding-right: 1.75rem !important;
    }
    
    .navbar-nav .dropdown-toggle .dropdown-arrow {
        position: absolute;
        right: 0.625rem;
        top: 50%;
        transform: translateY(-50%);
        font-size: 0.625rem;
        transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        opacity: 0.6;
        display: inline-block;
    }
    
    .navbar-nav .dropdown-toggle:hover .dropdown-arrow {
        opacity: 0.8;
    }
    
    .navbar-nav .dropdown-toggle[aria-expanded="true"] .dropdown-arrow {
        transform: translateY(-50%) rotate(180deg);
        opacity: 1;
    }
    
    /* Dropdown Menu - Apple macOS Style */
    .navbar-nav .dropdown-menu {
        position: absolute !important;
        top: calc(100% + 6px) !important;
        left: auto !important;
        right: 0 !important;
        margin-top: 0;
        min-width: 220px;
        width: auto;
        border-radius: 10px;
        padding: 6px;
        box-shadow: 
            0 10px 40px rgba(0, 0, 0, 0.12),
            0 0 0 0.5px rgba(0, 0, 0, 0.08),
            inset 0 1px 0 rgba(255, 255, 255, 0.6);
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(50px) saturate(200%);
        -webkit-backdrop-filter: blur(50px) saturate(200%);
        border: 0.5px solid rgba(0, 0, 0, 0.08);
        opacity: 0;
        transform: translateY(-4px) scale(0.98);
        transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        pointer-events: none;
        display: block;
        z-index: 10010 !important;
    }
    
    .navbar-nav .dropdown-menu.show {
        opacity: 1;
        transform: translateY(0) scale(1);
        pointer-events: auto;
        z-index: 10010 !important;
    }
    
    /* Bootstrap compatibility */
    .navbar-nav .dropdown-menu[style*="display: block"],
    .navbar-nav .dropdown.show > .dropdown-menu {
        opacity: 1 !important;
        transform: translateY(0) scale(1) !important;
        pointer-events: auto !important;
        z-index: 10010 !important;
    }
    
    /* Dropdown açık olduğunda parent'ı da yükselt */
    .navbar-nav .dropdown.show,
    .navbar-nav .nav-item.dropdown.show {
        z-index: 10009 !important;
        position: relative;
    }
    
    .navbar-nav .nav-item.dropdown {
        position: relative;
        z-index: 10009;
    }
    
    /* Dropdown hover effect - Desktop only */
    .navbar-nav .nav-item.dropdown:hover .dropdown-menu {
        opacity: 1;
        transform: translateY(0) scale(1);
        pointer-events: auto;
    }
    
    .navbar-nav .dropdown-menu-end {
        right: 0 !important;
        left: auto !important;
    }
    
    /* Dropdown Items - Apple Style */
    .navbar-nav .dropdown-item {
        padding: 8px 10px;
        border-radius: 6px;
        font-size: 0.8125rem;
        margin-bottom: 2px;
        transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
        color: var(--text-dark);
        display: flex;
        align-items: center;
        gap: 0.5rem;
        font-weight: 400;
        letter-spacing: -0.01em;
        position: relative;
    }
    
    .navbar-nav .dropdown-item:last-child {
        margin-bottom: 0;
    }
    
    .navbar-nav .dropdown-item i {
        width: 16px;
        text-align: center;
        font-size: 0.875rem;
        opacity: 0.7;
        transition: opacity 0.2s;
    }
    
    .navbar-nav .dropdown-item:hover {
        background: rgba(230, 57, 70, 0.08);
        color: var(--primary-color);
    }
    
    .navbar-nav .dropdown-item:hover i {
        opacity: 1;
    }
    
    .navbar-nav .dropdown-item.active {
        background: rgba(230, 57, 70, 0.12);
        color: var(--primary-color);
        font-weight: 600;
    }
    
    .navbar-nav .dropdown-item.active i {
        opacity: 1;
    }
    
    /* Dropdown Hover Effect */
    .navbar-nav .nav-item.dropdown:hover .dropdown-menu {
        opacity: 1;
        transform: translateY(0) scale(1);
        pointer-events: auto;
    }
    
    /* Dropdown Item Content - For Rich Dropdown Items */
    .navbar-nav .dropdown-item-content {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 0;
    }
    
    .navbar-nav .dropdown-item-icon {
        width: 36px;
        height: 36px;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-size: 1rem;
        flex-shrink: 0;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }
    
    .navbar-nav .dropdown-item-text {
        flex: 1;
        min-width: 0;
    }
    
    .navbar-nav .dropdown-item-title {
        font-size: 0.875rem;
        font-weight: 600;
        color: var(--text-dark);
        margin-bottom: 2px;
        letter-spacing: -0.01em;
    }
    
    .navbar-nav .dropdown-item-desc {
        font-size: 0.75rem;
        color: var(--text-medium);
        opacity: 0.8;
        line-height: 1.3;
    }
}

/* ============================================
   MOBILE NAVBAR - iOS Style
   ============================================ */
@media (max-width: 991.98px) {
    .navbar {
        padding: 1rem 0;
    }
    
    .navbar-collapse {
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        max-width: 340px;
        height: 100vh;
        background: rgba(251, 251, 253, 0.98);
        backdrop-filter: blur(40px) saturate(200%);
        -webkit-backdrop-filter: blur(40px) saturate(200%);
        transition: left 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        z-index: 10050 !important;
        padding: 80px 24px 24px;
        box-shadow: 
            2px 0 30px rgba(0, 0, 0, 0.15),
            0 0 0 0.5px rgba(0, 0, 0, 0.08) inset;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        margin-top: 0;
        border-top: none;
    }
    
    .navbar-collapse.show {
        left: 0;
    }
    
    .navbar-nav {
        gap: 0.25rem;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }
    
    .navbar-nav .nav-link {
        padding: 0.875rem 1rem !important;
        width: 100%;
        font-size: 0.9375rem;
        font-weight: 500;
        border-radius: 10px;
        margin-bottom: 2px;
        letter-spacing: -0.01em;
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }
    
    .navbar-nav .nav-link i {
        width: 20px;
        text-align: center;
        font-size: 1rem;
        opacity: 0.8;
    }
    
    .navbar-nav .nav-link.active {
        background: rgba(230, 57, 70, 0.12);
        color: var(--primary-color) !important;
        font-weight: 600;
    }
    
    .navbar-nav .nav-link.active i {
        opacity: 1;
    }
    
    /* Mobile Dropdown */
    .navbar-nav .dropdown-menu {
        position: static !important;
        margin-top: 0.5rem;
        margin-left: 0;
        box-shadow: none;
        border: none;
        background: rgba(245, 245, 247, 0.6);
        border-radius: 10px;
        padding: 8px;
        opacity: 1;
        transform: none;
        display: block;
    }
    
    .navbar-nav .dropdown-menu.show {
        display: block !important;
    }
    
    .navbar-nav .dropdown-item {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
        border-radius: 8px;
        margin-bottom: 2px;
    }
    
    .navbar-nav .dropdown-item:last-child {
        margin-bottom: 0;
    }
    
    .navbar-nav .dropdown-toggle .dropdown-arrow {
        margin-left: auto;
        font-size: 0.625rem;
        opacity: 0.5;
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }
    
    .navbar-nav .dropdown-toggle[aria-expanded="true"] .dropdown-arrow {
        transform: rotate(180deg);
        opacity: 1;
    }
    
    /* Navbar Toggler - Apple Style */
    .navbar-toggler {
        border: none;
        padding: 0.5rem;
        border-radius: 8px;
        transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: transparent;
    }
    
    .navbar-toggler:hover {
        background: rgba(0, 0, 0, 0.05);
    }
    
    .navbar-toggler:active {
        transform: scale(0.95);
    }
    
    .navbar-toggler:focus {
        box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.15);
        outline: none;
    }
    
    .navbar-toggler-icon {
        width: 22px;
        height: 16px;
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(29, 29, 31, 0.85)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
    }
    
    /* Mobile Menu Overlay */
    body.menu-open {
        overflow: hidden;
    }
    
    body.menu-open .navbar {
        z-index: 9998 !important;
    }
    
    body.menu-open .navbar-brand,
    body.menu-open .navbar-toggler {
        z-index: 10051;
        position: relative;
    }
}

/* ============================================
   NAVBAR PANEL VARIANT
   ============================================ */
.navbar-panel {
    background: rgba(251, 251, 253, 0.8);
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.06);
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
.navbar-nav .nav-link:focus-visible,
.navbar-nav .dropdown-item:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .navbar,
    .navbar-nav .nav-link,
    .navbar-nav .dropdown-menu,
    .navbar-nav .dropdown-item {
        transition: none;
    }
}
