/* ============================================
   AIT SWITCHER - MAIN STYLES
   ============================================ */

.ait-switcher {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
}

/* ============================================
   FLOATING CONTAINER
   ============================================ */

.ait-switcher-floating {
    position: fixed;
    padding: 16px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 8px;
}

.ait-switcher-floating.ait-switcher-position-bottom-right {
    bottom: 20px;
    right: 20px;
}

.ait-switcher-floating.ait-switcher-position-bottom-left {
    bottom: 20px;
    left: 20px;
}

.ait-switcher-floating.ait-switcher-position-top-right {
    top: 20px;
    right: 20px;
}

.ait-switcher-floating.ait-switcher-position-top-left {
    top: 20px;
    left: 20px;
}

/* ============================================
   SELECT DROPDOWN
   ============================================ */

.ait-language-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ait-language-select:hover {
    border-color: #0073aa;
}

.ait-language-select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.ait-language-select img {
    margin-right: 4px;
    vertical-align: middle;
}

/* ============================================
   CUSTOM DROPDOWN
   ============================================ */

.ait-switcher-dropdown {
    position: relative;
    display: inline-block;
}

.ait-switcher-dropdown-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.ait-switcher-dropdown-btn:hover {
    border-color: #0073aa;
    background: #f9f9f9;
}

.ait-switcher-dropdown-btn:active {
    border-color: #0073aa;
    background: #f0f9ff;
}

.ait-switcher-dropdown-btn img {
    width: 20px;
    height: 14px;
    flex-shrink: 0;
}

.ait-switcher-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 200px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
    display: none;
}

.ait-switcher-dropdown-menu.active {
    display: block;
}

.ait-switcher-dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    color: #333;
    text-decoration: none;
    transition: background 0.15s;
    border-bottom: 1px solid #f0f0f0;
}

.ait-switcher-dropdown-menu a:last-child {
    border-bottom: none;
}

.ait-switcher-dropdown-menu a:hover {
    background: #f5f5f5;
}

.ait-switcher-dropdown-menu a.active {
    background: #e7f5ff;
    color: #0073aa;
    font-weight: 600;
}

.ait-switcher-dropdown-menu a img {
    width: 20px;
    height: 14px;
    flex-shrink: 0;
}

.ait-switcher-dropdown-menu a span {
    flex: 1;
}

/* ============================================
   INLINE LINKS
   ============================================ */

.ait-switcher-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.ait-switcher-inline a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
    padding: 4px 0;
    border-bottom: 2px solid transparent;
}

.ait-switcher-inline a:hover {
    color: #0073aa;
    border-bottom-color: #0073aa;
}

.ait-switcher-inline a.active {
    color: #0073aa;
    border-bottom-color: #0073aa;
    font-weight: 600;
}

.ait-switcher-inline a img {
    width: 16px;
    height: 12px;
}

.ait-switcher-inline .separator {
    color: #ccc;
    margin: 0 -4px;
}

/* ============================================
   BUTTON GROUP
   ============================================ */

.ait-switcher-button {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.ait-switcher-button .ait-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    background: white;
    color: #333;
    margin-right: 4px;
}

.ait-switcher-button .ait-btn:last-child {
    margin-right: 0;
}

.ait-switcher-button .ait-btn:hover {
    background: #f0f0f0;
    border-color: #0073aa;
}

.ait-switcher-button .ait-btn.active {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
    font-weight: 600;
}

.ait-switcher-button .ait-btn img {
    width: 18px;
    height: 12px;
    flex-shrink: 0;
}

.ait-switcher-button .ait-btn span {
    flex: 1;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .ait-switcher-floating {
        padding: 12px;
    }
    
    .ait-switcher-floating.ait-switcher-position-bottom-right,
    .ait-switcher-floating.ait-switcher-position-bottom-left {
        bottom: 10px;
    }
    
    .ait-switcher-floating.ait-switcher-position-bottom-right {
        right: 10px;
    }
    
    .ait-switcher-floating.ait-switcher-position-bottom-left {
        left: 10px;
    }
    
    .ait-switcher-floating.ait-switcher-position-top-right {
        top: 10px;
        right: 10px;
    }
    
    .ait-switcher-floating.ait-switcher-position-top-left {
        top: 10px;
        left: 10px;
    }
    
    .ait-switcher-dropdown-menu {
        min-width: 150px;
    }
    
    .ait-switcher-button .ait-btn {
        padding: 6px 10px;
        font-size: 13px;
        margin-right: 4px;
    }
}

/* ============================================
   SCROLLBAR FOR DROPDOWN MENU
   ============================================ */

.ait-switcher-dropdown-menu::-webkit-scrollbar {
    width: 6px;
}

.ait-switcher-dropdown-menu::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.ait-switcher-dropdown-menu::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.ait-switcher-dropdown-menu::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* ============================================
   FLOATING FLAG DROPDOWN
   ============================================ */

.ait-switcher-floating.ait-switcher-floating-flag-only,
.ait-switcher-floating.ait-switcher-floating-type-flag-dropdown {
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    z-index: 100001 !important;
}

.ait-switcher-floating.ait-switcher-floating-flag-only .ait-switcher,
.ait-switcher-floating.ait-switcher-floating-type-flag-dropdown .ait-switcher {
    line-height: 1;
}

.ait-switcher-floating.ait-switcher-floating-flag-only .ait-switcher-flag-dropdown,
.ait-switcher-floating.ait-switcher-floating-flag-only .ait-switcher-flag-dropdown *,
.ait-switcher-floating.ait-switcher-floating-type-flag-dropdown .ait-switcher-flag-dropdown,
.ait-switcher-floating.ait-switcher-floating-type-flag-dropdown .ait-switcher-flag-dropdown * {
    border: 0 !important;
    box-shadow: none !important;
    outline: none !important;
}

.ait-switcher-flag-dropdown {
    position: relative;
}

.ait-switcher-floating.ait-switcher-floating-flag-only .ait-switcher-dropdown-btn.ait-switcher-flag-btn,
.ait-switcher-floating.ait-switcher-floating-type-flag-dropdown .ait-switcher-dropdown-btn.ait-switcher-flag-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    min-height: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    gap: 0 !important;
}

.ait-switcher-floating.ait-switcher-floating-flag-only .ait-switcher-dropdown-btn.ait-switcher-flag-btn:hover,
.ait-switcher-floating.ait-switcher-floating-flag-only .ait-switcher-dropdown-btn.ait-switcher-flag-btn:active,
.ait-switcher-floating.ait-switcher-floating-flag-only .ait-switcher-dropdown-btn.ait-switcher-flag-btn:focus,
.ait-switcher-floating.ait-switcher-floating-flag-only .ait-switcher-dropdown-btn.ait-switcher-flag-btn:focus-visible,
.ait-switcher-floating.ait-switcher-floating-type-flag-dropdown .ait-switcher-dropdown-btn.ait-switcher-flag-btn:hover,
.ait-switcher-floating.ait-switcher-floating-type-flag-dropdown .ait-switcher-dropdown-btn.ait-switcher-flag-btn:active,
.ait-switcher-floating.ait-switcher-floating-type-flag-dropdown .ait-switcher-dropdown-btn.ait-switcher-flag-btn:focus,
.ait-switcher-floating.ait-switcher-floating-type-flag-dropdown .ait-switcher-dropdown-btn.ait-switcher-flag-btn:focus-visible {
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    outline: none !important;
}

.ait-switcher-flag-icon {
    display: inline-flex;
    width: 96px;
    height: 64px;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    line-height: 0;
}

.ait-switcher-flag-icon img {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    display: block;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    object-fit: cover !important;
    object-position: center center !important;
}

.ait-switcher-flag-fallback {
    display: inline-flex;
    width: 96px;
    height: 64px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 0;
    background: #eef2f7;
    color: #465365;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    flex-shrink: 0;
}

.ait-switcher-flag-menu {
    right: 0;
    left: auto;
    min-width: 0;
    width: auto;
    padding: 2px;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    display: block;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(4px);
    transition: opacity 0.12s ease, transform 0.12s ease, visibility 0.12s ease;
}

.ait-switcher-flag-menu.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.ait-switcher-flag-menu a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 96px;
    height: 64px;
    margin: 0;
    padding: 0;
    border: 0 !important;
    border-radius: 0 !important;
    border-bottom: 0 !important;
    background: transparent !important;
    color: inherit;
    overflow: hidden;
}

.ait-switcher-flag-menu a + a {
    margin-top: 4px;
}

.ait-switcher-flag-menu a:hover {
    background: transparent !important;
    transform: scale(1.05);
}

.ait-switcher-flag-menu a.active {
    background: transparent !important;
    opacity: 0.85;
}

.ait-switcher-floating.ait-switcher-position-top-left .ait-switcher-flag-menu,
.ait-switcher-floating.ait-switcher-position-bottom-left .ait-switcher-flag-menu {
    left: 0;
    right: auto;
}

.ait-switcher-floating.ait-switcher-position-bottom-right .ait-switcher-flag-menu,
.ait-switcher-floating.ait-switcher-position-bottom-left .ait-switcher-flag-menu {
    top: auto;
    bottom: calc(100% + 8px);
}

body.admin-bar .ait-switcher-floating.ait-switcher-position-top-right.ait-switcher-floating-flag-only,
body.admin-bar .ait-switcher-floating.ait-switcher-position-top-left.ait-switcher-floating-flag-only,
body.admin-bar .ait-switcher-floating.ait-switcher-position-top-right.ait-switcher-floating-type-flag-dropdown,
body.admin-bar .ait-switcher-floating.ait-switcher-position-top-left.ait-switcher-floating-type-flag-dropdown {
    top: 52px !important;
}

@media (max-width: 768px) {
    .ait-switcher-flag-icon,
    .ait-switcher-flag-fallback {
        width: 66px !important;
        height: 44px !important;
    }

    .ait-switcher-flag-menu a {
        width: 66px;
        height: 44px;
    }
}

@media screen and (max-width: 782px) {
    body.admin-bar .ait-switcher-floating.ait-switcher-position-top-right.ait-switcher-floating-flag-only,
    body.admin-bar .ait-switcher-floating.ait-switcher-position-top-left.ait-switcher-floating-flag-only,
    body.admin-bar .ait-switcher-floating.ait-switcher-position-top-right.ait-switcher-floating-type-flag-dropdown,
    body.admin-bar .ait-switcher-floating.ait-switcher-position-top-left.ait-switcher-floating-type-flag-dropdown {
        top: 66px !important;
    }
}
