/**
 * WPML Floating Language Switcher Styles
 */

.wpml-floating-switcher {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Positions */
.wpml-floating-switcher[data-position="bottom-right"] {
    bottom: 100px;
    right: 20px;
}

.wpml-floating-switcher[data-position="bottom-left"] {
    bottom: 100px;
    left: 20px;
}

.wpml-floating-switcher[data-position="top-right"] {
    top: 20px;
    right: 20px;
}

.wpml-floating-switcher[data-position="top-left"] {
    top: 20px;
    left: 20px;
}

/* Trigger button */
.wpml-fs-trigger {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 50%;
    padding: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.wpml-floating-switcher.active .wpml-fs-trigger {
    border-radius: 25px;
    padding: 10px 16px;
    gap: 8px;
}

.wpml-fs-trigger:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.wpml-fs-trigger img {
    width: 20px;
    height: 15px;
    object-fit: cover;
    border-radius: 2px;
}

.wpml-fs-trigger span {
    max-width: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.3s ease;
}

.wpml-floating-switcher.active .wpml-fs-trigger span {
    max-width: 50px;
    opacity: 1;
    margin-left: 8px;
}

.wpml-fs-trigger svg {
    transition: transform 0.3s ease;
    max-width: 0;
    overflow: hidden;
    opacity: 0;
}

.wpml-floating-switcher.active .wpml-fs-trigger svg {
    transform: rotate(180deg);
    max-width: 12px;
    opacity: 1;
    margin-left: 5px;
}

/* Dropdown */
.wpml-fs-dropdown {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 10px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    min-width: 150px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.wpml-floating-switcher.active .wpml-fs-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Position adjustments for dropdown */
.wpml-floating-switcher[data-position*="top"] .wpml-fs-dropdown {
    bottom: auto;
    top: 100%;
    margin-bottom: 0;
    margin-top: 10px;
}

.wpml-floating-switcher[data-position*="left"] .wpml-fs-dropdown {
    right: auto;
    left: 0;
}

/* Mobile - force left alignment */
@media (max-width: 768px) {
    .wpml-fs-dropdown {
        right: auto !important;
        left: 0 !important;
    }
}

/* Language items */
.wpml-fs-lang {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: #333;
    text-decoration: none;
    transition: background 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.wpml-fs-lang:last-child {
    border-bottom: none;
}

.wpml-fs-lang:hover {
    background: #f8f8f8;
}

.wpml-fs-lang img {
    width: 20px;
    height: 15px;
    object-fit: cover;
    border-radius: 2px;
}

.wpml-fs-lang span {
    font-size: 14px;
    font-weight: 500;
}

/* Mobile responsive */
@media (max-width: 768px) {
    /* Force bottom-left on mobile (opposite side of arrow/navigation) */
    .wpml-floating-switcher[data-position="bottom-right"],
    .wpml-floating-switcher[data-position="bottom-left"] {
        bottom: 80px !important;
        left: 15px !important;
        right: auto !important;
    }
    
    .wpml-floating-switcher[data-position="top-right"],
    .wpml-floating-switcher[data-position="top-left"] {
        left: 15px !important;
        right: auto !important;
    }
    
    .wpml-fs-trigger {
        padding: 10px;
        font-size: 13px;
    }
    
    .wpml-floating-switcher.active .wpml-fs-trigger {
        padding: 8px 12px;
    }
    
    .wpml-fs-trigger img {
        width: 18px;
        height: 13px;
    }
    
    .wpml-fs-dropdown {
        min-width: 130px;
    }
    
    .wpml-fs-lang {
        padding: 10px 12px;
        font-size: 13px;
    }
}
