/* ==============================================================================
   TranslateBeam TDN Language Switcher Styles
   Platform: https://translatebeam.com
   ============================================================================== */

.tdn-switcher-wrap {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    box-sizing: border-box;
    line-height: 1.5;
}

.tdn-switcher-wrap * {
    box-sizing: border-box;
}

/* Positioning */
.tdn-pos-bottom-right {
    bottom: 24px;
    right: 24px;
}

.tdn-pos-bottom-left {
    bottom: 24px;
    left: 24px;
}

.tdn-pos-top-right {
    top: 24px;
    right: 24px;
}

.tdn-pos-top-left {
    top: 24px;
    left: 24px;
}

.tdn-pos-inline {
    position: relative;
    display: inline-block;
}

/* Switcher Button */
.tdn-switcher-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #0f172a;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 8px 14px;
    border-radius: 9999px;
    cursor: pointer;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}

.tdn-switcher-btn:hover {
    background: #1e293b;
    border-color: #38bdf8;
    transform: translateY(-2px);
    box-shadow: 0 14px 28px -5px rgba(56, 189, 248, 0.25);
}

.tdn-flag-icon {
    width: 20px;
    height: 15px;
    border-radius: 2px;
    object-fit: cover;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.tdn-btn-label {
    font-weight: 500;
    white-space: nowrap;
}

.tdn-chevron {
    width: 16px;
    height: 16px;
    color: #94a3b8;
    transition: transform 0.2s ease;
}

.tdn-switcher-btn[aria-expanded="true"] .tdn-chevron {
    transform: rotate(180deg);
}

/* Dropdown Menu */
.tdn-dropdown-menu {
    position: absolute;
    bottom: calc(100% + 10px);
    right: 0;
    width: 270px;
    max-height: 440px;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 14px;
    box-shadow: 0 20px 30px -5px rgba(0, 0, 0, 0.6), 0 10px 15px -5px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.95);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.tdn-pos-bottom-left .tdn-dropdown-menu {
    right: auto;
    left: 0;
}

.tdn-pos-top-right .tdn-dropdown-menu,
.tdn-pos-top-left .tdn-dropdown-menu {
    bottom: auto;
    top: calc(100% + 10px);
}

.tdn-dropdown-menu.tdn-show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.tdn-dropdown-header {
    padding: 10px 14px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    border-bottom: 1px solid #1e293b;
    background: #090d16;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tdn-count-badge {
    font-size: 10px;
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    padding: 2px 7px;
    border-radius: 9999px;
    font-weight: 600;
    letter-spacing: 0;
}

.tdn-search-box {
    padding: 8px 10px;
    border-bottom: 1px solid #1e293b;
    background: #0b0f19;
}

.tdn-search-input {
    width: 100%;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 6px;
    color: #f8fafc;
    padding: 6px 10px;
    font-size: 12px;
    outline: none;
    transition: border-color 0.15s ease;
}

.tdn-search-input:focus {
    border-color: #38bdf8;
}

.tdn-search-input::placeholder {
    color: #64748b;
}

.tdn-options-list {
    overflow-y: auto;
    max-height: 310px;
    padding: 6px;
}

.tdn-options-list::-webkit-scrollbar {
    width: 6px;
}
.tdn-options-list::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}
.tdn-options-list::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

.tdn-lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border-radius: 6px;
    color: #cbd5e1;
    cursor: pointer;
    transition: all 0.15s ease;
}

.tdn-lang-option:hover {
    background: #1e293b;
    color: #ffffff;
}

.tdn-lang-option.tdn-opt-active {
    background: #0284c7;
    color: #ffffff;
    font-weight: 600;
}

.tdn-lang-name {
    flex: 1;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tdn-lang-code {
    font-size: 10px;
    padding: 2px 5px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: #94a3b8;
}

.tdn-lang-option.tdn-opt-active .tdn-lang-code {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.2);
}

.tdn-powered-by {
    padding: 8px 12px;
    text-align: center;
    border-top: 1px solid #1e293b;
    background: #090d16;
    font-size: 10px;
}

.tdn-powered-by a {
    color: #38bdf8;
    text-decoration: none;
    font-weight: 500;
}

.tdn-powered-by a:hover {
    text-decoration: underline;
}

@media (max-width: 640px) {
    .tdn-pos-bottom-right,
    .tdn-pos-bottom-left {
        bottom: 16px;
        right: 16px;
    }
    .tdn-dropdown-menu {
        width: 200px;
    }
}
