/**
 * WPTranslate Gemini - Frontend Styles
 */

/* Language Switcher - Common */
.wptg-language-switcher {
    display: inline-block;
    position: relative;
    font-family: inherit;
    font-size: 14px;
}

.wptg-flag {
    font-size: 1.2em;
    vertical-align: middle;
}

.wptg-name {
    vertical-align: middle;
}

/* Dropdown Style */
.wptg-dropdown {
    position: relative;
}

.wptg-dropdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: inherit;
    font-family: inherit;
    transition: all 0.2s ease;
}

.wptg-dropdown-toggle:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

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

.wptg-dropdown.open .wptg-arrow {
    transform: rotate(180deg);
}

.wptg-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    display: none;
    min-width: 150px;
    margin: 4px 0 0;
    padding: 4px 0;
    list-style: none;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.wptg-dropdown.open .wptg-dropdown-menu {
    display: block;
}

.wptg-dropdown-menu li {
    margin: 0;
    padding: 0;
}

.wptg-dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    color: #333;
    text-decoration: none;
    transition: background 0.2s ease;
}

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

.wptg-dropdown-menu .wptg-current a {
    background: #f0f0f0;
    font-weight: 600;
}

/* Flags Only Style */
.wptg-flags {
    display: inline-flex;
    gap: 8px;
    align-items: center;
}

.wptg-flag-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.wptg-flag-link:hover {
    opacity: 1;
    transform: scale(1.1);
}

.wptg-flag-link.wptg-current {
    opacity: 1;
    background: #f0f0f0;
}

.wptg-flag-link .wptg-flag {
    font-size: 1.5em;
}

/* List Style */
.wptg-list {
    display: inline-flex;
    gap: 0;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
}

.wptg-list li {
    margin: 0;
    padding: 0;
}

.wptg-list a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    color: inherit;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.wptg-list a:hover {
    opacity: 0.8;
}

.wptg-list .wptg-current a {
    font-weight: 600;
}

.wptg-separator {
    color: #ccc;
    padding: 0 4px;
    user-select: none;
}

/* Translation Loading State */
.wptg-translating {
    position: relative;
    opacity: 0.7;
}

.wptg-translating::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #ddd;
    border-top-color: #333;
    border-radius: 50%;
    animation: wptg-spin 0.8s linear infinite;
}

@keyframes wptg-spin {
    to {
        transform: rotate(360deg);
    }
}

/* RTL Support */
[dir="rtl"] .wptg-dropdown-menu {
    left: auto;
    right: 0;
}

[dir="rtl"] .wptg-list {
    flex-direction: row-reverse;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .wptg-dropdown-menu {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        border-radius: 16px 16px 0 0;
        max-height: 60vh;
        overflow-y: auto;
    }
    
    .wptg-dropdown-menu a {
        padding: 12px 16px;
    }
    
    .wptg-list {
        flex-wrap: wrap;
        gap: 4px;
    }
}
