/**
 * Dynamic Menu System CSS
 * Menü sistemi için özel stiller
 */

/* Brand Logo Styling */
.brand-logo {
    max-height: 40px;
    width: auto;
}

.brand-text {
    font-weight: 600;
}

/* Menu Item Images */
.dropdown-item-with-image {
    display: flex;
    align-items: center;
    padding: 8px 16px;
}

.dropdown-image {
    flex-shrink: 0;
    margin-right: 12px;
    overflow: hidden;
}

.dropdown-image img {
    width: 32px;
    height: 32px;
    object-fit: cover;
    display: block;
}

.dropdown-image.circle {
    border-radius: 50%;
}

.dropdown-image.circle img {
    border-radius: 50%;
}

.dropdown-image.rounded {
    border-radius: 8px;
}

.dropdown-image.rounded img {
    border-radius: 8px;
}

.dropdown-image.square {
    border-radius: 4px;
}

.dropdown-image.square img {
    border-radius: 4px;
}

.dropdown-content {
    flex-grow: 1;
    min-width: 0;
}

.dropdown-title {
    font-weight: 500;
    color: #212529;
    margin-bottom: 2px;
}

.dropdown-description {
    font-size: 0.8rem;
    color: #6c757d;
    line-height: 1.3;
}

/* Menu Item Styling */
.menu-item-image {
    border: 1px solid #e9ecef;
}

/* Dropdown Enhancements */
.dropdown-menu {
    border: 1px solid #e3e6f0;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    border-radius: 0.35rem;
}

.dropdown-menu .dropdown-item {
    padding: 0.75rem 1rem;
    transition: all 0.15s ease-in-out;
}

.dropdown-menu .dropdown-item:hover {
    background-color: #f8f9fc;
    color: #5a5c69;
}

.dropdown-menu .dropdown-item:active {
    background-color: #5a5c69;
    color: #fff;
}

/* Mega Menu Styling */
.dropdown-menu.mega {
    min-width: 600px;
    padding: 20px;
}

.dropdown-menu.mega .dropdown-item-with-image {
    margin-bottom: 12px;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid transparent;
}

.dropdown-menu.mega .dropdown-item-with-image:hover {
    border-color: #e3e6f0;
    background-color: #f8f9fc;
}

/* Sidebar Dropdown */
.dropdown-menu.sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    margin: 0;
    border-radius: 0;
    transition: right 0.3s ease-in-out;
    z-index: 1050;
}

.dropdown-menu.sidebar.show {
    right: 0;
}

/* Vertical Navbar */
.navbar-vertical {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    flex-direction: column;
    padding: 0;
}

.navbar-vertical .navbar-nav {
    flex-direction: column;
    width: 100%;
}

.navbar-vertical .nav-item {
    width: 100%;
}

.navbar-vertical .nav-link {
    padding: 12px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar-vertical .dropdown-menu {
    position: static;
    float: none;
    width: 100%;
    margin: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background-color: rgba(0, 0, 0, 0.1);
}

.navbar-vertical .dropdown-item {
    padding-left: 40px;
    color: rgba(255, 255, 255, 0.8);
}

.navbar-vertical .dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Animation Classes */
.menu-fade-in {
    animation: menuFadeIn 0.3s ease-in-out;
}

.menu-slide-down {
    animation: menuSlideDown 0.3s ease-out;
}

.menu-scale-in {
    animation: menuScaleIn 0.2s ease-out;
}

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

@keyframes menuSlideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes menuScaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Hover Effects */
.nav-link {
    position: relative;
    transition: all 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: currentColor;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 80%;
}

/* Mobile Responsive */
@media (max-width: 991.98px) {
    .navbar-vertical {
        position: relative;
        width: 100%;
        height: auto;
    }
    
    .dropdown-menu.sidebar {
        position: absolute;
        top: 100%;
        right: 0;
        width: 100%;
        height: auto;
    }
    
    .dropdown-item-with-image {
        flex-direction: column;
        text-align: center;
    }
    
    .dropdown-image {
        margin-right: 0;
        margin-bottom: 8px;
    }
}

@media (max-width: 767.98px) {
    .dropdown-menu.mega {
        min-width: 300px;
        padding: 15px;
    }
    
    .dropdown-item-with-image {
        padding: 8px;
    }
    
    .dropdown-image img {
        width: 24px;
        height: 24px;
    }
    
    .brand-logo {
        max-height: 30px;
    }
}

/* Active States */
.nav-link.active {
    font-weight: 600;
    color: #fff !important;
}

.dropdown-item.active {
    background-color: var(--bs-primary);
    color: #fff;
}

/* Custom Theme Support */
.navbar[data-theme="dark"] {
    background-color: #2c3e50 !important;
}

.navbar[data-theme="light"] {
    background-color: #ecf0f1 !important;
}

.navbar[data-theme="light"] .nav-link {
    color: #2c3e50 !important;
}

.navbar[data-theme="light"] .nav-link:hover {
    color: #3498db !important;
}

/* Menu Loading States */
.menu-loading {
    position: relative;
    overflow: hidden;
}

.menu-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Menu Item Badges */
.menu-badge {
    position: absolute;
    top: -2px;
    right: -6px;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
}

.nav-item {
    position: relative;
}

/* Accessibility Improvements */
.nav-link:focus {
    outline: 2px solid #0066cc;
    outline-offset: 2px;
}

.dropdown-item:focus {
    outline: 2px solid #0066cc;
    outline-offset: -2px;
}

/* Print Styles */
@media print {
    .navbar,
    .dropdown-menu {
        display: none !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .nav-link {
        border: 1px solid transparent;
    }
    
    .nav-link:hover,
    .nav-link:focus {
        border-color: currentColor;
    }
    
    .dropdown-item {
        border: 1px solid transparent;
    }
    
    .dropdown-item:hover,
    .dropdown-item:focus {
        border-color: currentColor;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .nav-link,
    .dropdown-item,
    .dropdown-menu {
        transition: none !important;
        animation: none !important;
    }
}

/* Custom Scrollbar for Vertical Menu */
.navbar-vertical::-webkit-scrollbar {
    width: 6px;
}

.navbar-vertical::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.navbar-vertical::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.navbar-vertical::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Menu Search */
.menu-search {
    padding: 10px 15px;
    border-bottom: 1px solid #e9ecef;
}

.menu-search input {
    border: 1px solid #ced4da;
    border-radius: 20px;
    padding: 8px 15px;
    font-size: 0.875rem;
}

/* Menu Categories */
.menu-category {
    padding: 5px 15px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #6c757d;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

/* Social Menu Icons */
.social-menu {
    display: flex;
    gap: 10px;
    align-items: center;
}

.social-menu .nav-link {
    padding: 8px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.social-menu .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Language Switcher Enhancement */
.language-switcher .dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.language-flag {
    font-size: 1.2em;
}

/* Menu Performance Optimizations */
.dropdown-menu {
    will-change: transform, opacity;
}

.nav-link {
    will-change: color, background-color;
}

/* Menu Overlay for Mobile */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.menu-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Menu Close Button */
.menu-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6c757d;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
}

.menu-close:hover {
    color: #495057;
}

/* Menu Footer */
.menu-footer {
    margin-top: auto;
    padding: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Menu Item Counter */
.menu-counter {
    font-size: 0.7rem;
    background-color: #dc3545;
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    margin-left: 5px;
    min-width: 18px;
    text-align: center;
    display: inline-block;
}