/* NewMenu-inspired Dropdown Menu */

/* Clean dropdown styling */
.newmenu-dropdown {
    position: relative;
}

.newmenu-menu {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%);
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15), 0 5px 15px rgba(0, 0, 0, 0.08);
    padding: 0;
    margin-top: 8px;
    min-width: 950px;
    max-width: 1100px;
    border: none;
    overflow: hidden;
    left: 50% !important;
    transform: translateX(-50%) !important;
    right: auto !important;
    backdrop-filter: blur(10px);
}

/* Create invisible bridge to prevent dropdown from closing */
.newmenu-menu::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 0;
    right: 0;
    height: 15px;
    background: transparent;
    z-index: 999;
}

/* Extend hover zone for better UX */
.newmenu-dropdown::after {
    content: '';
    position: absolute;
    top: 100%;
    left: -20px;
    right: -20px;
    height: 15px;
    background: transparent;
    z-index: 998;
}

/* Container for dropdown content */
.dropdown-container {
    display: flex;
    padding: 30px 0;
    background: linear-gradient(135deg, #ffffff 0%, #fafbff 100%);
}

/* Sections within dropdown */
.dropdown-section {
    flex: 1;
    padding: 0 30px;
    position: relative;
}

.dropdown-section:not(:last-child) {
    border-right: 1px solid #e5e7f0;
}

.dropdown-section:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 20px;
    bottom: 20px;
    width: 1px;
    background: linear-gradient(to bottom, transparent 0%, #e5e7f0 20%, #e5e7f0 80%, transparent 100%);
}

/* Section headers */
.dropdown-header {
    color: #3b82f6;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 18px;
    padding: 8px 0;
    border: none;
    background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
}

.dropdown-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 100%);
    border-radius: 1px;
}

/* Dropdown items */
.newmenu-menu .dropdown-item {
    padding: 14px 0;
    border: none;
    background: none;
    border-radius: 8px;
    margin: 2px 0;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.newmenu-menu .dropdown-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(5, 150, 105, 0.05) 50%, transparent 100%);
    transition: left 0.3s ease;
}

.newmenu-menu .dropdown-item:hover::before {
    left: 100%;
}

.newmenu-menu .dropdown-item:hover {
    background: linear-gradient(135deg, rgba(5, 150, 105, 0.05) 0%, rgba(16, 185, 129, 0.05) 100%);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.1);
}

/* Item content styling */
.item-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-left: 12px;
}

.item-content i {
    font-size: 1.1rem;
    color: #3b82f6;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(96, 165, 250, 0.1) 100%);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.newmenu-menu .dropdown-item:hover .item-content i {
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
    color: white;
    transform: scale(1.1);
}

.item-text strong {
    color: #374151;
    font-weight: 600;
    font-size: 0.85rem;
    transition: color 0.3s ease;
}

.item-text span {
    color: #6b7280;
    font-size: 0.75rem;
    margin-top: 2px;
    transition: color 0.3s ease;
}

.newmenu-menu .dropdown-item:hover .item-text strong {
    color: #3b82f6;
}

.newmenu-menu .dropdown-item:hover .item-text span {
    color: #374151;
}

.newmenu-menu .dropdown-item:hover {
    background-color: #f8fafc;
    color: inherit;
}

/* Item content layout */
.item-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding-left: 12px;
}

.item-content i {
    color: #667eea;
    font-size: 20px;
    margin-top: 2px;
    flex-shrink: 0;
}

/* Item text */
.item-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.item-text strong {
    color: #374151;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
}

.item-text span {
    color: #6b7280;
    font-size: 12px;
    line-height: 1.4;
}

/* Dropdown footer */
.dropdown-footer {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 20px 24px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
    position: relative;
}

.dropdown-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, #3b82f6 50%, transparent 100%);
}

.dropdown-footer .btn {
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
    border: none;
    color: white;
    font-size: 13px;
    font-weight: 600;
    padding: 10px 24px;
    border-radius: 8px;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.2);
    position: relative;
    overflow: hidden;
}

.dropdown-footer .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.2) 50%, transparent 100%);
    transition: left 0.5s ease;
}

.dropdown-footer .btn:hover::before {
    left: 100%;
}

.dropdown-footer .btn:hover {
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
}

/* Hover effects for items */
.newmenu-menu .dropdown-item:hover .item-content i {
    color: #5a67d8;
    transform: scale(1.05);
}

.newmenu-menu .dropdown-item:hover .item-text strong {
    color: #667eea;
}

/* Responsive design */
@media (min-width: 1400px) {
    .newmenu-menu {
        min-width: 1200px;
        max-width: 1400px;
    }
    
    .dropdown-section {
        padding: 0 40px;
    }
    
    .dropdown-item {
        padding: 16px 0;
    }
    
    .item-text strong {
        font-size: 0.8rem;
    }
    
    .item-text span {
        font-size: 0.7rem;
    }
}

@media (min-width: 1600px) {
    .newmenu-menu {
        min-width: 1400px;
        max-width: 1600px;
    }
    
    .dropdown-section {
        padding: 0 50px;
    }
    
    .dropdown-item {
        padding: 18px 0;
    }
    
    .item-text strong {
        font-size: 0.85rem;
    }
    
    .item-text span {
        font-size: 0.75rem;
    }
}

@media (max-width: 1199.98px) {
    .newmenu-menu {
        min-width: 800px;
        max-width: 950px;
    }
}

@media (max-width: 991.98px) {
    .newmenu-menu {
        min-width: 100%;
        max-width: none;
        margin-left: -15px;
        margin-right: -15px;
        border-radius: 0;
        left: 0 !important;
        transform: none !important;
    }
    
    .dropdown-container {
        flex-direction: column;
        padding: 16px 0;
    }
    
    .dropdown-section {
        padding: 0 20px;
        margin-bottom: 24px;
    }
    
    .dropdown-section:not(:last-child) {
        border-right: none;
        border-bottom: 1px solid #f3f4f6;
        padding-bottom: 24px;
    }
}

@media (max-width: 1000px) {
    .newmenu-menu {
        left: 0 !important;
        transform: none !important;
        min-width: 100vw;
        margin-left: -50vw;
        margin-right: -50vw;
    }
}

@media (max-width: 576px) {
    .newmenu-menu {
        margin-left: -20px;
        margin-right: -20px;
    }
    
    .dropdown-section {
        padding: 0 16px;
    }
    
    .dropdown-footer {
        padding: 12px 16px;
    }
}

/* Clean navbar link styling */
.navbar-nav .nav-link {
    color: #ffffff !important;
    font-weight: 500;
    padding: 8px 16px !important;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.navbar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff !important;
}

.navbar-nav .nav-link.active {
    background-color: rgba(255, 255, 255, 0.15);
    color: #ffffff !important;
}

/* Dropdown toggle styling */
.newmenu-dropdown .dropdown-toggle::after {
    margin-left: 0.5em;
    transition: transform 0.2s ease;
}

.newmenu-dropdown .dropdown-toggle[aria-expanded="true"]::after {
    transform: rotate(180deg);
}

/* Remove default Bootstrap dropdown styling conflicts */
.newmenu-menu.dropdown-menu {
    display: none;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: all 0.15s ease;
    pointer-events: auto;
}

.newmenu-menu.dropdown-menu.show {
    display: block;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

/* Improve hover zone connectivity */
.newmenu-dropdown {
    position: relative;
}

.newmenu-dropdown .dropdown-toggle {
    position: relative;
    z-index: 1001;
}

/* Enhanced bridge for seamless hover */
.newmenu-dropdown:hover .newmenu-menu::before {
    display: block;
}

/* Prevent menu from closing too quickly on accidental mouse exit */
.newmenu-menu {
    border-radius: 8px !important;
}

/* Add subtle hover transition to toggle */
.newmenu-dropdown .dropdown-toggle {
    transition: all 0.2s ease;
}

.newmenu-dropdown:hover .dropdown-toggle,
.newmenu-dropdown .dropdown-toggle[aria-expanded="true"] {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Focus states for accessibility */
.newmenu-menu .dropdown-item:focus {
    background-color: #f8fafc;
    outline: 2px solid #667eea;
    outline-offset: -2px;
}

.dropdown-footer .btn:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Simplified animation for dropdown items - faster and non-blocking */
.newmenu-menu.show {
    animation: fadeInMenu 0.15s ease-out;
}

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

/* Modern Language Selector */
.modern-lang-dropdown {
    position: relative;
}

.modern-lang-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 8px 12px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    min-width: 80px;
}

.modern-lang-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Hide Bootstrap default dropdown toggle arrow */
.modern-lang-btn::after {
    display: none !important;
}

.modern-lang-btn:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5);
    outline: none;
}

.lang-content {
    display: flex;
    align-items: center;
    gap: 6px;
}

.lang-content .bi-globe2 {
    font-size: 16px;
    opacity: 0.8;
}

.lang-text {
    font-weight: 600;
    letter-spacing: 0.5px;
}

.lang-content .bi-chevron-down {
    font-size: 12px;
    opacity: 0.7;
    transition: transform 0.2s ease;
}

.modern-lang-btn[aria-expanded="true"] .bi-chevron-down {
    transform: rotate(180deg);
}

/* Modern Language Menu */
.modern-lang-menu {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    padding: 8px;
    margin-top: 2px;
    min-width: 160px;
    border: none;
    overflow: hidden;
}

/* Create invisible bridge to prevent dropdown from closing */
.modern-lang-menu::before {
    content: '';
    position: absolute;
    top: -12px;
    left: 0;
    right: 0;
    height: 12px;
    background: transparent;
    z-index: 999;
}

.lang-option {
    border-radius: 8px;
    padding: 0;
    margin-bottom: 4px;
    transition: all 0.2s ease;
    border: none;
}

.lang-option:last-child {
    margin-bottom: 0;
}

.lang-option:hover {
    background: #f8fafc;
    transform: translateX(2px);
}

.lang-option.active {
    background: #eff6ff;
    border-left: 3px solid #3b82f6;
}

.lang-item-content {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 12px;
    width: 100%;
}

.lang-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.lang-name {
    font-weight: 500;
    color: #1f2937;
    font-size: 14px;
}

.lang-code {
    font-size: 12px;
    color: #6b7280;
    font-weight: 400;
}

.lang-check {
    color: #3b82f6;
    font-size: 16px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.lang-option.active .lang-check {
    opacity: 1;
}

/* Simplified animation for language menu */
.modern-lang-menu {
    animation: langMenuFadeIn 0.1s ease-out;
}

@keyframes langMenuFadeIn {
    from {
        opacity: 0;
        transform: translateY(-3px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .modern-lang-btn {
        padding: 6px 10px;
        min-width: 70px;
    }
    
    .lang-content {
        gap: 4px;
    }
    
    .lang-text {
        font-size: 13px;
    }
    
    .modern-lang-menu {
        min-width: 140px;
    }
}
