/**
 * Language Switcher Styles
 * Modern dropdown with flags design
 */

.language-switcher {
    position: relative;
    display: inline-block;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Dropdown Container */
.language-dropdown-container {
    position: relative;
    display: inline-block;
}

/* Dropdown Button - Override Bootstrap */
.language-dropdown-btn {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 8px 12px !important;
    background: white !important;
    border: 2px solid #e0e0e0 !important;
    border-radius: 6px !important;
    color: #333 !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    min-width: 100px !important;
    justify-content: space-between !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    vertical-align: middle !important;
    user-select: none !important;
    line-height: 1.5 !important;
    text-align: center !important;
    box-sizing: border-box !important;
}

.language-dropdown-btn:hover {
    border-color: #4ea351;
    box-shadow: 0 2px 8px rgba(78, 163, 81, 0.1);
}

.language-dropdown-btn:focus {
    outline: none;
    border-color: #4ea351;
    box-shadow: 0 0 0 3px rgba(78, 163, 81, 0.1);
}

.language-dropdown-btn .flag {
    font-size: 16px;
    line-height: 1;
}

.language-dropdown-btn .current-lang {
    font-weight: 600;
    color: #4ea351;
}

.language-dropdown-btn .dropdown-arrow {
    font-size: 12px;
    color: #666;
    transition: transform 0.3s ease;
}

.language-dropdown-btn[aria-expanded="true"] .dropdown-arrow {
    transform: rotate(180deg);
}

/* Dropdown Menu - Override Bootstrap */
.language-dropdown-menu {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    background: white !important;
    border: 2px solid #e0e0e0 !important;
    border-top: none !important;
    border-radius: 0 0 6px 6px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    z-index: 9999 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(-10px) !important;
    transition: all 0.3s ease !important;
    margin-top: -2px !important;
    display: none !important;
    min-width: 150px !important;
    float: none !important;
    padding: 0 !important;
    margin: 0 !important;
    font-size: inherit !important;
    text-align: left !important;
    list-style: none !important;
    background-clip: padding-box !important;
}

.language-dropdown-menu.show {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    display: block !important;
}

/* Hover support for desktop */
@media (min-width: 769px) {
    .language-dropdown-container:hover .language-dropdown-menu {
        opacity: 1 !important;
        visibility: visible !important;
        transform: translateY(0) !important;
        display: block !important;
    }
    
    .language-dropdown-container:hover .language-dropdown-btn .dropdown-arrow {
        transform: rotate(180deg) !important;
    }
}

/* Dropdown Items - Override Bootstrap */
.language-dropdown-item {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    width: 100% !important;
    padding: 10px 12px !important;
    background: none !important;
    border: none !important;
    color: #333 !important;
    font-size: 14px !important;
    cursor: pointer !important;
    transition: background 0.2s ease !important;
    position: relative !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    clear: both !important;
    font-weight: 400 !important;
    line-height: 1.5 !important;
    text-align: inherit !important;
}

.language-dropdown-item:hover {
    background: #f8f9fa !important;
    color: #333 !important;
    text-decoration: none !important;
}

.language-dropdown-item.active {
    background: #4ea351 !important;
    color: white !important;
}

.language-dropdown-item:focus {
    background: #f8f9fa !important;
    color: #333 !important;
    text-decoration: none !important;
    outline: none !important;
}

.language-dropdown-item .flag {
    font-size: 16px;
    line-height: 1;
    min-width: 20px;
}

.language-dropdown-item .name {
    flex: 1;
    text-align: left;
}

.language-dropdown-item .active-icon {
    font-size: 12px;
    color: #4ea351;
    margin-left: auto;
}

.language-dropdown-item.active .active-icon {
    color: white;
}

/* Header Language Switcher */
.header-language-switcher {
    display: flex;
    align-items: center;
    margin-left: 20px;
}







/* Custom Mobile Menu */
.custom-mobile-menu {
    position: fixed;
    top: 0;
    left: -100%;
    width: 280px;
    height: 100vh;
    background: white;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    z-index: 9999;
    transition: left 0.3s ease;
    overflow-y: auto;
}

.custom-mobile-menu.active {
    left: 0;
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 15px;
    background: #4ea351;
    color: white;
}

.mobile-menu-title {
    font-size: 18px;
    font-weight: 600;
}

.mobile-menu-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-menu-items {
    padding: 0;
}

.mobile-menu-item {
    display: block;
    padding: 15px 20px;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #f0f0f0;
    font-size: 16px;
    transition: background 0.3s ease;
}

.mobile-menu-item:hover {
    background: #f8f9fa;
    color: #4ea351;
}

.mobile-language-flags {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 20px 15px;
    margin-top: 10px;
    border-top: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.mobile-language-flags .lang-flag {
    display: inline-block;
    font-size: 24px;
    padding: 8px;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    background: white;
    border: 2px solid #e0e0e0;
    min-width: 40px;
    text-align: center;
    line-height: 1;
}

.mobile-language-flags .lang-flag:hover {
    border-color: #4ea351;
    box-shadow: 0 2px 8px rgba(78, 163, 81, 0.2);
    transform: translateY(-2px);
}

.mobile-language-flags .lang-flag.active {
    border-color: #4ea351;
    background: #4ea351;
    color: white;
    box-shadow: 0 2px 8px rgba(78, 163, 81, 0.3);
}

/* Flags container under SlickNav responsive menu */
.simple-language-flags { 
  display: none; 
  justify-content: center; 
  align-items: center; 
  gap: 12px; 
  padding: 12px 0; 
  border-top: 1px solid #e0e0e0; 
  background: #f8f9fa; 
}
.responsive-menu .simple-language-flags { display: flex; }
.simple-language-flags .lang-flag { 
  display: inline-block; 
  font-size: 22px; 
  padding: 6px 8px; 
  border-radius: 8px; 
  background: #fff; 
  border: 2px solid #e0e0e0; 
  text-decoration: none; 
}
.simple-language-flags .lang-flag.active { 
  border-color: #4ea351; 
  background: #4ea351; 
  color: #fff; 
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-language-switcher {
        margin-left: 0;
        margin-top: 15px;
        width: 100%;
        justify-content: center;
    }
    
    .language-dropdown-btn {
        min-width: 120px;
        padding: 10px 16px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .header-language-switcher {
        margin-top: 10px;
    }
    
    /* Show mobile language switcher in responsive menu */
    .mobile-language-switcher {
        display: block;
    }
    
    /* Hide desktop language switcher on mobile */
    .header-language-switcher {
        display: none;
    }
    
    .mobile-language-switcher .language-dropdown-btn {
        min-width: 150px;
        padding: 12px 16px;
        font-size: 16px;
    }
    
    .mobile-language-switcher .language-dropdown-item {
        padding: 12px 16px;
        font-size: 16px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .language-dropdown-btn {
        background: #2d2d2d;
        color: #e0e0e0;
        border-color: #555;
    }
    
    .language-dropdown-menu {
        background: #2d2d2d;
        border-color: #555;
    }
    
    .language-dropdown-item {
        color: #e0e0e0;
    }
    
    .language-dropdown-item:hover {
        background: #3d3d3d;
    }
}

/* Accessibility */
.language-dropdown-btn:focus {
    outline: 2px solid #4ea351;
    outline-offset: 2px;
}

.language-dropdown-item:focus {
    outline: 2px solid #4ea351;
    outline-offset: -2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .language-dropdown-btn {
        border-width: 3px;
    }
    
    .language-dropdown-menu {
        border-width: 3px;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .language-dropdown-btn,
    .language-dropdown-menu,
    .dropdown-arrow {
        transition: none;
    }
}

/* Overlay for custom mobile menu */
.custom-mobile-menu-overlay { display:none; position:fixed; inset:0; background: rgba(0,0,0,0.35); z-index:9998; }
.custom-mobile-menu.active + .custom-mobile-menu-overlay { display:block; }
