/* Floating Language Switcher */
#gt_switcher_wrapper {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 100000;
}

#gt_switcher_wrapper .gt_switcher_container {
    position: relative;
}

#gt_switcher_wrapper .gt_switcher_container::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    height: 10px; /* Invisible bridge to cover the gap */
}

#gt_switcher_wrapper .gt_selected_language {
    background-color: #23282d;
    color: #fff;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: all 0.2s ease-in-out;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

#gt_switcher_wrapper .gt_selected_language:hover {
    background-color: #333a40;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

#gt_switcher_wrapper .gt_selected_language img.gt-flag {
    display: none; /* Hide the img tag, we use it for the background */
}

#gt_switcher_wrapper .gt_languages_list {
    display: none;
    position: absolute;
    bottom: calc(100% + 10px); /* Position above the button, matching the bridge height */
    right: 0;
    background-color: #23282d;
    border-radius: 4px;
    list-style: none;
    margin: 0; /* Remove margin that creates hover dead zone */
    padding: 5px 0;
    width: 200px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    overflow: hidden; /* Ensure children conform to border radius */
}

#gt_switcher_wrapper .gt_switcher_container:hover .gt_languages_list {
    display: block;
}

#gt_switcher_wrapper .gt_languages_list li {
    margin: 0;
    padding: 0;
    border-top: 1px solid #40464d;
}
#gt_switcher_wrapper .gt_languages_list li:first-child {
    border-top: none;
}

#gt_switcher_wrapper .gt_languages_list li a {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    text-decoration: none;
    color: #fff;
    background-color: transparent;
    border: none;
    border-radius: 0;
    white-space: nowrap;
    gap: 10px; /* Space between flag and text */
    transition: background-color 0.2s ease-in-out;
}

#gt_switcher_wrapper .gt_languages_list li a:hover {
    background-color: #333a40;
}

#gt_switcher_wrapper .gt_languages_list li a .gt-flag {
    width: 24px;
    height: auto;
    border-radius: 2px;
}

/* General Switcher Styles */
.gt-switcher ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    position: relative; /* Needed for dropdown positioning */
}

.gt-switcher li {
    display: inline-block;
}

.gt-switcher a {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    text-decoration: none;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    white-space: nowrap;
    gap: 8px; /* Space between flag and text */
}

/* Container for the dropdown to manage hover area */
.gt-switcher .gt-current-lang {
    position: relative;
    padding-bottom: 10px; /* Invisible space to keep hover state */
    margin-bottom: -10px; /* Compensate for the padding */
}

/* Dropdown List */
.gt-switcher .gt-lang-list {
    display: none; /* Hidden by default */
    position: absolute;
    bottom: 100%; /* Position above the current language */
    left: 0;
    background-color: #fff;
    min-width: 100%;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    border-radius: 4px;
    margin-bottom: 5px; /* Space between button and list */
    padding: 5px;
    box-sizing: border-box;
}

.gt-switcher .gt-lang-list li {
    display: block; /* Make list items stack vertically */
}

.gt-switcher .gt-lang-list a {
    border: none;
    border-radius: 3px;
    padding: 6px 10px;
}

.gt-switcher .gt-lang-list a:hover {
    background-color: #f1f1f1;
}

/* Show dropdown on hover */
.gt-switcher .gt-current-lang:hover .gt-lang-list {
    display: block;
}

.gt-flag {
    width: 20px;
    height: auto;
    border: 1px solid #eee;
    background-color: #f9f9f9;
    flex-shrink: 0;
}

/* Dark Theme from Image */
.gt-switcher#gt-floating-switcher a,
.gt-switcher#gt-floating-switcher .gt-lang-list {
    background-color: #333;
    color: #fff;
    border-color: #555;
}
.gt-switcher#gt-floating-switcher .gt-lang-list a:hover {
    background-color: #444;
}

/* Menu Switcher Specifics */
.main-navigation .gt-switcher a {
    border: none; /* Less intrusive in main menu */
    background-color: transparent;
    color: inherit;
}

.main-navigation .gt-switcher .gt-lang-list {
    bottom: auto; /* Normal dropdown direction in menu */
    top: 100%;
    margin-bottom: 0;
    margin-top: 5px;
    background-color: #fff;
    color: #333;
    border: 1px solid #ddd;
}
.main-navigation .gt-switcher .gt-lang-list a {
    color: #333;
}
.main-navigation .gt-switcher .gt-lang-list a:hover {
    background-color: #f1f1f1;
} 

/* Menu Item Flag Styles */
.menu-item-has-flag {
    display: flex;
    align-items: center;
}

.menu-item-has-flag .menu-item-flag {
    width: 16px;
    height: auto;
    margin-right: 2px;
    vertical-align: middle;
    display: inline-block;
    background: transparent;
    border: none;
    box-shadow: none;
}

/* Reset flex display for mobile */
@media screen and (max-width: 782px) {
    .menu-item-has-flag {
        display: inherit;
    }
    
    .menu-item-has-flag a {
        display: inherit !important;
    }
    
    .menu-item-has-flag .menu-item-flag {
        vertical-align: middle;
        margin-top: -2px;
    }
}

/* Floating switcher styles */
#gt-floating-switcher-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    font-size: 14px;
}

#gt-floating-switcher-container ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

#gt-floating-switcher-container li {
    margin: 0;
    padding: 0;
}

#gt-floating-switcher-container a {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    color: #333;
    text-decoration: none;
    transition: background-color 0.2s;
}

#gt-floating-switcher-container a:hover {
    background-color: #f5f5f5;
}

#gt-floating-switcher-container .gt-lang-flag {
    width: 16px;
    height: 12px;
    margin-right: 8px;
    vertical-align: middle;
    background: transparent;
    border: none;
    box-shadow: none;
}

#gt-floating-switcher-container .current-language {
    border-bottom: 1px solid #eee;
}

#gt-floating-switcher-container .current-language a {
    font-weight: bold;
    background-color: #f8f9fa;
} 