/**
 * Language Switcher Styles
 * RYC Leading Theme
 */

/* Base Language Switcher */
.ryc-language-switcher {
    position: relative;
    z-index: 1000;
}

/* Dropdown Style */
.ryc-language-dropdown {
    position: relative;
    display: inline-block;
}

.ryc-language-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.ryc-language-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.ryc-current-flag {
    font-size: 16px;
    line-height: 1;
}

.ryc-current-name {
    font-weight: 600;
}

.ryc-language-arrow {
    transition: transform 0.3s ease;
    color: currentColor;
}

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

/* Language Menu */
.ryc-language-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    min-width: 160px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    list-style: none;
    margin: 0;
    padding: 4px;
}

.ryc-language-dropdown:hover .ryc-language-menu,
.ryc-language-toggle[aria-expanded="true"] + .ryc-language-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.ryc-language-menu li {
    margin: 0;
}

.ryc-language-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: #374151;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 14px;
}

.ryc-language-option:hover {
    background: #f3f4f6;
    color: #111827;
}

.ryc-language-flag {
    font-size: 16px;
    line-height: 1;
}

.ryc-language-name {
    font-weight: 500;
}

/* Inline Style */
.ryc-language-inline {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ryc-language-inline .ryc-language-option {
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #ffffff;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 13px;
}

.ryc-language-inline .ryc-language-option:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.ryc-language-inline .ryc-language-active {
    background: var(--accent-color, #3b82f6);
    border-color: var(--accent-color, #3b82f6);
    color: #ffffff;
}

.ryc-language-inline .ryc-language-name {
    font-weight: 600;
}

/* Navigation Integration */
.menu-item-language-switcher {
    margin-left: auto;
}

@media (max-width: 768px) {
    .ryc-language-inline {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
        margin-top: 10px;
    }
    
    .ryc-language-inline .ryc-language-option {
        flex: 0 0 auto;
    }
    
    .ryc-language-dropdown .ryc-language-toggle {
        padding: 6px 10px;
        font-size: 13px;
    }
    
    .ryc-language-menu {
        right: 0;
        left: 0;
        min-width: auto;
    }
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
    .ryc-language-menu {
        background: #1f2937;
        border-color: #374151;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    }
    
    .ryc-language-option {
        color: #e5e7eb;
    }
    
    .ryc-language-option:hover {
        background: #374151;
        color: #ffffff;
    }
}

/* Accessibility */
.ryc-language-toggle:focus,
.ryc-language-option:focus {
    outline: 2px solid var(--accent-color, #3b82f6);
    outline-offset: 2px;
}

/* Loading state */
.ryc-language-switcher.loading .ryc-language-toggle {
    opacity: 0.6;
    pointer-events: none;
}

.ryc-language-switcher.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: ryc-spin 0.8s linear infinite;
}

@keyframes ryc-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Footer variant */
.footer-language-switcher .ryc-language-inline .ryc-language-option {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

.footer-language-switcher .ryc-language-inline .ryc-language-option:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.footer-language-switcher .ryc-language-inline .ryc-language-active {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    color: #ffffff;
}
