/**
 * Language Switcher Styles
 *
 * Styles for the frontend language switcher dropdown.
 *
 * @package Antimanual
 * @since 2.2.0
 */

/* Language Switcher Container */
.atml-language-switcher {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    margin: 16px 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
}

.atml-language-switcher:hover {
    border-color: #adb5bd;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

/* Label */
.atml-lang-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #495057;
    font-weight: 500;
    cursor: default;
}

.atml-lang-label svg {
    color: #6c757d;
    flex-shrink: 0;
}

/* Select Dropdown */
.atml-lang-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding: 6px 32px 6px 12px;
    font-size: 14px;
    font-weight: 500;
    color: #212529;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    cursor: pointer;
    min-width: 140px;
    transition: all 0.15s ease;
}

.atml-lang-select:hover {
    border-color: #80bdff;
}

.atml-lang-select:focus {
    outline: none;
    border-color: #80bdff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

.atml-lang-select option {
    padding: 8px 12px;
}

/* Loading Spinner */
.atml-lang-loading {
    display: inline-flex;
    align-items: center;
}

.atml-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #e9ecef;
    border-top-color: #007bff;
    border-radius: 50%;
    animation: atml-spin 0.8s linear infinite;
}

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

/* Disabled State */
.atml-language-switcher.atml-loading .atml-lang-select {
    opacity: 0.6;
    pointer-events: none;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .atml-language-switcher {
        background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
        border-color: #4a5568;
    }

    .atml-lang-label {
        color: #e2e8f0;
    }

    .atml-lang-label svg {
        color: #a0aec0;
    }

    .atml-lang-select {
        background-color: #2d3748;
        color: #e2e8f0;
        border-color: #4a5568;
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23a0aec0' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    }

    .atml-lang-select:hover {
        border-color: #63b3ed;
    }

    .atml-lang-select:focus {
        border-color: #63b3ed;
        box-shadow: 0 0 0 3px rgba(99, 179, 237, 0.2);
    }

    .atml-spinner {
        border-color: #4a5568;
        border-top-color: #63b3ed;
    }
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .atml-language-switcher {
        flex-wrap: wrap;
        justify-content: center;
        padding: 12px;
    }

    .atml-lang-select {
        width: 100%;
        min-width: unset;
    }
}

/* RTL Support */
[dir="rtl"] .atml-language-switcher {
    flex-direction: row-reverse;
}

[dir="rtl"] .atml-lang-label {
    flex-direction: row-reverse;
}

[dir="rtl"] .atml-lang-select {
    padding: 6px 12px 6px 32px;
    background-position: left 8px center;
}

/* Animation for content change */
.atml-content-transitioning {
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.atml-content-loaded {
    opacity: 1;
    transition: opacity 0.3s ease;
}
