/**
 * AI Domain Translator - Language Switcher Styles
 */

/* Base Switcher */
.aidt-language-switcher {
    position: relative;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    z-index: 9999;
}

/* Floating Position */
.aidt-floating {
    position: fixed;
    bottom: 20px;
    right: 20px;
}

/* Toggle Button */
.aidt-switcher-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
    font-size: 14px;
    line-height: 1.4;
    color: #333;
}

.aidt-switcher-toggle:hover {
    border-color: #0073aa;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.aidt-arrow {
    font-size: 10px;
    transition: transform 0.2s;
}

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

/* Dropdown */
.aidt-switcher-dropdown {
    display: none;
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 5px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    list-style: none;
    padding: 4px;
    margin: 0 0 5px 0;
    min-width: 160px;
    max-height: 300px;
    overflow-y: auto;
}

.aidt-language-switcher.aidt-open .aidt-switcher-dropdown {
    display: block;
    animation: aidtSlideUp 0.2s ease;
}

/* Non-floating: dropdown goes down */
.aidt-language-switcher:not(.aidt-floating) .aidt-switcher-dropdown {
    bottom: auto;
    top: 100%;
    margin-top: 5px;
    margin-bottom: 0;
}

/* Dropdown Items */
.aidt-switcher-item {
    list-style: none;
    margin: 0;
    padding: 0;
}

.aidt-switcher-item a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    text-decoration: none;
    color: #333;
    border-radius: 4px;
    transition: background 0.15s;
}

.aidt-switcher-item a:hover {
    background: #f0f6fc;
    color: #0073aa;
}

.aidt-switcher-item.aidt-active a {
    background: #f0f0f0;
    font-weight: 600;
}

/* Inline Style */
.aidt-switcher-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.aidt-style-inline .aidt-switcher-item a {
    padding: 6px 10px;
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 4px;
    font-size: 13px;
    color: rgba(255,255,255,0.75);
}

.aidt-style-inline .aidt-switcher-item a:hover {
    color: #fff;
    border-color: rgba(255,255,255,0.5);
    background: rgba(255,255,255,0.08);
}

.aidt-style-inline .aidt-switcher-item.aidt-active a {
    border-color: rgba(255,255,255,0.6);
    background: rgba(255,255,255,0.12);
    color: #fff;
    font-weight: 600;
}

/* Pills Style — segmented control, works on dark and light backgrounds */
.aidt-switcher-pills {
    display: inline-flex;
    list-style: none;
    padding: 3px;
    margin: 0;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 50px;
    gap: 0;
}

.aidt-style-pills .aidt-switcher-item a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    color: rgba(255,255,255,0.65);
    border-radius: 50px;
    transition: color 0.18s ease, background 0.18s ease;
    white-space: nowrap;
    line-height: 1.4;
}

.aidt-style-pills .aidt-switcher-item a:hover {
    color: #fff;
    background: rgba(255,255,255,0.12);
}

.aidt-style-pills .aidt-switcher-item.aidt-active a {
    background: #fff;
    color: #111;
    font-weight: 600;
}

/* Pills on light background */
.aidt-theme-light.aidt-style-pills .aidt-switcher-pills {
    background: rgba(0,0,0,0.06);
    border-color: rgba(0,0,0,0.15);
}

.aidt-theme-light.aidt-style-pills .aidt-switcher-item a {
    color: rgba(0,0,0,0.55);
}

.aidt-theme-light.aidt-style-pills .aidt-switcher-item a:hover {
    color: #111;
    background: rgba(0,0,0,0.06);
}

.aidt-theme-light.aidt-style-pills .aidt-switcher-item.aidt-active a {
    background: #111;
    color: #fff;
}

/* Dark theme overrides for dropdown / inline styles */
.aidt-theme-dark .aidt-switcher-toggle {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.2);
    color: #fff;
    box-shadow: none;
}

.aidt-theme-dark .aidt-switcher-toggle:hover {
    background: rgba(255,255,255,0.14);
    border-color: rgba(255,255,255,0.35);
}

.aidt-theme-dark .aidt-switcher-dropdown {
    background: #222;
    border-color: rgba(255,255,255,0.15);
    box-shadow: 0 6px 20px rgba(0,0,0,0.5);
}

.aidt-theme-dark .aidt-switcher-item a {
    color: rgba(255,255,255,0.8);
}

.aidt-theme-dark .aidt-switcher-item a:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

.aidt-theme-dark .aidt-switcher-item.aidt-active a {
    background: rgba(255,255,255,0.12);
    color: #fff;
}

.aidt-theme-dark.aidt-style-inline .aidt-switcher-item a {
    border-color: rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.75);
    border-radius: 4px;
}

.aidt-theme-dark.aidt-style-inline .aidt-switcher-item.aidt-active a {
    border-color: rgba(255,255,255,0.6);
    background: rgba(255,255,255,0.1);
    color: #fff;
}

/* Flag icons (flag-icons library) */
.aidt-flag {
    display: inline-block;
    width: 1.33em;
    height: 1em;
    vertical-align: middle;
    border-radius: 2px;
    overflow: hidden;
    flex-shrink: 0;
}

/* Language Name */
.aidt-lang-name {
    white-space: nowrap;
}

/* Animation */
@keyframes aidtSlideUp {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* RTL Support */
[dir="rtl"] .aidt-floating {
    right: auto;
    left: 20px;
}

[dir="rtl"] .aidt-switcher-dropdown {
    right: auto;
    left: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .aidt-floating {
        bottom: 10px;
        right: 10px;
    }

    .aidt-switcher-toggle {
        padding: 6px 10px;
        font-size: 13px;
    }
}
