/**
 * locale-switcher.css - Language Switcher Styling
 *
 * Clean, compact dropdown for language selection
 */

.locale-switcher {
    position: relative;
    display: inline-block;
}

/* Main Button */
.locale-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-secondary, #f5f5f5);
    border: 1px solid var(--border-color, #ddd);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary, #333);
    transition: all 0.2s ease;
}

.locale-button:hover {
    background: var(--bg-hover, #e8e8e8);
    border-color: var(--primary-purple, #8B7EC8);
}

.locale-button:active {
    transform: scale(0.98);
}

.locale-button.loading {
    opacity: 0.6;
    cursor: wait;
}

/* Button Elements */
.locale-icon {
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
}

.flag-svg {
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.locale-name {
    font-size: 14px;
    white-space: nowrap;
}

.locale-arrow {
    font-size: 10px;
    color: var(--text-secondary, #666);
    transition: transform 0.2s ease;
}

.locale-button:hover .locale-arrow {
    transform: translateY(2px);
}

/* Dropdown Menu */
.locale-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 200px;
    background: white;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    z-index: 1000;
    animation: dropdownSlideIn 0.2s ease;
}

@keyframes dropdownSlideIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dropdown Options */
.locale-option {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    background: white;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary, #333);
    text-align: left;
    transition: background 0.2s ease;
    position: relative;
}

.locale-option:hover {
    background: var(--bg-hover, #f5f5f5);
}

.locale-option:active {
    background: var(--bg-active, #e8e8e8);
}

.locale-option.active {
    background: linear-gradient(135deg,
        rgba(139, 126, 200, 0.1),
        rgba(127, 176, 105, 0.1));
    color: var(--primary-purple, #8B7EC8);
}

.locale-option.active:hover {
    background: linear-gradient(135deg,
        rgba(139, 126, 200, 0.15),
        rgba(127, 176, 105, 0.15));
}

.locale-option .locale-icon {
    font-size: 20px;
}

.locale-option .locale-name {
    flex: 1;
    font-size: 14px;
}

.locale-check {
    color: var(--primary-green, #7FB069);
    font-size: 16px;
    font-weight: bold;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .locale-button .locale-name {
        display: none;
    }

    .locale-dropdown {
        right: auto;
        left: 50%;
        transform: translateX(-50%);
        min-width: 180px;
    }

    @keyframes dropdownSlideIn {
        from {
            opacity: 0;
            transform: translate(-50%, -8px);
        }
        to {
            opacity: 1;
            transform: translate(-50%, 0);
        }
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .locale-button,
    .locale-option,
    .locale-arrow {
        transition: none;
    }

    .locale-dropdown {
        animation: none;
    }
}

/* Loading State */
.locale-button.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 8px;
    width: 12px;
    height: 12px;
    border: 2px solid var(--primary-purple, #8B7EC8);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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