/**
 * Wolf Digital - DJS i18n Fixes
 * Locale Selector Styles
 */

/* Locale Selector Dropdown */
.wolfd-locale-selector {
    display: inline-block;
}

.wolfd-locale-dropdown {
    padding: 5px 28px 5px 14px;
    border: 1.5px solid #002B49;
    border-radius: 4px;
    background-color: #fff;
    font-size: 14px;
    font-weight: 500;
    color: #002B49;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
    min-width: 85px;
    
    /* Custom dropdown arrow */
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4.5 5.5L0.5 1.5H8.5L4.5 5.5Z' fill='%23002B49'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 10px 6px;
}

.wolfd-locale-dropdown:hover {
    border-color: #DDBB63;
    background-color: #fafafa;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4.5 5.5L0.5 1.5H8.5L4.5 5.5Z' fill='%23DDBB63'/%3E%3C/svg%3E");
}

.wolfd-locale-dropdown:focus {
    border-color: #DDBB63;
    box-shadow: 0 0 0 2px rgba(221, 187, 99, 0.2);
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4.5 5.5L0.5 1.5H8.5L4.5 5.5Z' fill='%23DDBB63'/%3E%3C/svg%3E");
}

@media (max-width: 768px) {
    .wolfd-locale-dropdown {
        padding: 4px 20px 4px 10px;
        font-size: 13px;
        min-width: 75px;
        background-position: right 6px center;
    }
}

/* Language Switcher (Legacy) */
.djs-language-switcher {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.djs-language-label {
    font-size: 11px;
    color: #fff;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    opacity: 0.9;
    cursor: help;
}

.djs-language-switcher ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 6px;
    align-items: center;
}

.djs-language-switcher li {
    margin: 0;
    padding: 0;
}

.djs-language-switcher a {
    display: block;
    text-decoration: none;
}

/* Flag-only inline styles */
.djs-flags-inline svg {
    width: 28px;
    height: 14px;
    display: block;
    border-radius: 2px;
}

.djs-flags-inline .current-lang svg {
    outline: 2px solid #DDBB63;
    outline-offset: 1px;
}

/* Custom dropdown styles */
.djs-language-dropdown {
    position: relative;
}

.djs-language-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1px solid rgba(0, 42, 92, 0.2);
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    color: var(--e-global-color-785ce78, #002a5c);
    transition: all 0.3s ease;
}

.djs-language-dropdown-toggle:hover {
    border-color: var(--e-global-color-785ce78, #002a5c);
    background: rgba(0, 42, 92, 0.05);
}

/* Flag-only styles */
.djs-language-dropdown.flag-only .djs-language-dropdown-toggle {
    border: none;
    padding: 0;
    background: none !important;
}

.djs-language-dropdown.flag-only .djs-language-dropdown-toggle:hover {
    background: none !important;
    opacity: 0.8;
}

.djs-language-dropdown.flag-only .djs-language-dropdown-toggle img {
    width: 24px;
    height: auto;
    display: block;
    border-radius: 3px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    cursor: pointer;
}

.djs-language-dropdown-toggle .dropdown-arrow {
    width: 10px;
    height: 6px;
    transition: transform 0.3s ease;
}

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

.djs-language-dropdown-menu {
    position: absolute;
    top: calc(100% + 5px);
    right: 0;
    background: #fff;
    border: 1px solid rgba(0, 42, 92, 0.15);
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 9999;
    min-width: 120px;
    list-style: none;
    margin: 0;
    padding: 4px 0;
}

/* Compact menu for flag-only mode */
.djs-language-dropdown.flag-only .djs-language-dropdown-menu {
    min-width: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.djs-language-dropdown-toggle[aria-expanded="true"] + .djs-language-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.djs-language-dropdown-menu li {
    margin: 0;
    padding: 0;
}

.djs-language-dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    color: var(--e-global-color-785ce78, #002a5c);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s ease;
}

.djs-language-dropdown.flag-only .djs-language-dropdown-menu a {
    padding: 0;
    background: none;
}

.djs-language-dropdown.flag-only .djs-language-dropdown-menu a:hover {
    background: none;
    opacity: 0.8;
}

.djs-language-dropdown.flag-only .djs-language-dropdown-menu img {
    width: 24px;
    height: auto;
    display: block;
    border-radius: 3px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    cursor: pointer;
}

.djs-language-dropdown-menu a:hover {
    background: rgba(0, 42, 92, 0.05);
    opacity: 1;
}

.djs-language-dropdown-menu .current-lang a {
    font-weight: 700;
    position: relative;
}

.djs-language-dropdown-menu .current-lang a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: #DDBB63;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .djs-language-switcher {
        margin-left: 10px;
    }
    
    .djs-language-switcher ul {
        gap: 4px;
    }
    
    .djs-language-switcher a,
    .djs-language-dropdown-toggle {
        font-size: 12px;
    }
    
    
    .djs-language-dropdown-toggle {
        padding: 6px 10px;
    }
    
    /* Keep flag-only styles consistent on mobile */
    .djs-language-dropdown.flag-only .djs-language-dropdown-toggle {
        padding: 0;
    }
    
    .djs-language-dropdown.flag-only .djs-language-dropdown-toggle img,
    .djs-language-dropdown.flag-only .djs-language-dropdown-menu img {
        width: 20px;
        height: auto;
    }
}