/* Language Switcher Component Styles */

/* Header language switcher */
.language-switcher {
    display: none;
}

.mobile .language-switcher {
    display: none;
}

.web .language-switcher {
    display: block;
}

/* Language options grid */
.language-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.web .header-actions .language-options {
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
}

/* Language option button */
.language-option {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    /* Фикс: шрифт языка не зависит от переключателя serif/sans */
    font-family: var(--sans-primary);
    text-transform: uppercase;
    font-size: var(--xs);
    font-weight: var(--md);
    transition: all 0.3s;
    min-width: 35px;
}

.web .header-actions .language-option {
    font-size: 11px;
    min-width: 30px;
}

.language-option:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--white);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.language-option.active {
    background-color: #FFCC00;
    color: #000D0C;
    border-color: #FFCC00;
    font-weight: var(--bd);
}

/* Cycler mode styles */
.language-cycler {
    display: inline-block;
    margin-bottom: 0;
}

.language-cycler .language-options {
    display: inline-flex;
    gap: 0;
    width: auto;
}

.language-cycler .language-option {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-family: var(--sans-primary);
    font-size: var(--xs);
    font-weight: var(--sb);
    text-transform: uppercase;
    background-color: #FFCC00;
    color: #000000;
    border: 1px solid #FFCC00;
    box-shadow:
        1px 5px 30px 0px rgba(255, 204, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        box-shadow 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.language-cycler .language-option:hover {
    filter: brightness(1.1) saturate(1.1);
    box-shadow:
        0 0 20px 0px rgba(255, 204, 0, 0.8),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.language-cycler .language-option:active {
    transform: translateY(-1px) scale(1.02);
    box-shadow:
        1px 20px 25px 0px rgba(255, 204, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Sidebar language list (mobile) */
.language-list {
    color: rgba(255,255,255,0.6);
    font-size: var(--sm);
}

@media (min-width: 769px) {
    .language-list {
        display: none;
    }
}

@media (max-width: 768px) {
    .language-list {
        display: block;
    }
}

/* Sidebar language switcher buttons */
.sidebar-language-switcher {
    padding-top: var(--xxl);
    margin: 0;
}

.sidebar-language-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-bottom: 0;
}

/* Responsive grid for sidebar languages */
@media (max-width: 480px) {
    .sidebar-language-options {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .sidebar-language-options {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }
}

@media (min-width: 769px) {
    .sidebar-language-options {
        grid-template-columns: repeat(6, 1fr);
        gap: 4px;
    }
}

.sidebar-language-option {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-family: var(--sans-secondary);
    text-transform: uppercase;
    font-size: var(--xs);
    font-weight: var(--md);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    min-width: 35px;
    min-height: 32px;
    padding: 6px 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.sidebar-language-option:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--white);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.sidebar-language-option.active {
background-color: #FFCC00 !important;
    color: #000D0C !important;
    border-color: #FFCC00;
    font-weight: var(--bd) !important;
    box-shadow: 0 2px 10px rgba(255, 204, 0, 0.3) !important;
}

/* Enhanced hover effects */
.sidebar-language-option:active {
    transform: translateY(0px) scale(0.98);
}

.sidebar-language-option:focus {
    outline: 2px solid rgba(255, 204, 0, 0.5);
    outline-offset: 2px;
}

.language-link {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-family: var(--sans-secondary);

    opacity: 0.5;
    text-transform: uppercase;
}

.language-link:hover {
    color: var(--white);
    text-decoration: underline;
}

.language-link.active {
    font-weight: var(--bd);
    color: #FFCC00;
}

/* Language prompt overlay */
.language-prompt-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(7, 8, 13, 0.68);
    backdrop-filter: blur(4px);
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.language-prompt-overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.language-prompt {
    position: relative;
    width: min(480px, 100%);
    padding: 28px;
    border-radius: 16px;
    background: rgba(12, 14, 22, 0.95);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.language-prompt__close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: var(--white);
    font-size: 20px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.language-prompt__close:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.05);
}

.language-prompt__title {
    margin: 0 0 8px;
    font-size: 1.35rem;
    font-weight: var(--bd);
    color: var(--white);
}

.language-prompt__message {
    margin: 0 0 20px;
    font-size: 0.95rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.75);
}

.language-prompt__primary {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.language-prompt__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: var(--bd);
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    border: none;
}

.language-prompt__action--primary {
    background: #ffcc00;
    color: #05060b;
    box-shadow: 0 12px 28px rgba(255, 204, 0, 0.35);
}

.language-prompt__action--primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 32px rgba(255, 204, 0, 0.45);
}

.language-prompt__action--secondary {
    background: transparent;
    color: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.language-prompt__action--secondary:hover {
    background: rgba(255, 255, 255, 0.08);
}

.language-prompt__options {
    margin-top: 24px;
}

.language-prompt__options-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.5);
}

.language-prompt__options-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.language-prompt__option {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 0.9rem;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.16);
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.language-prompt__option:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    color: var(--white);
    transform: translateY(-1px);
}

.language-prompt__option.is-recommended {
    border-color: rgba(255, 204, 0, 0.5);
    color: #ffcc00;
}

.language-prompt__option.is-current {
    border-color: rgba(120, 220, 255, 0.4);
}

@media (max-width: 640px) {
    .language-prompt {
        padding: 24px 20px;
    }

    .language-prompt__primary {
        flex-direction: column;
        align-items: stretch;
    }

    .language-prompt__action--secondary {
        width: 100%;
    }

    .language-prompt__options-list {
        gap: 8px;
    }

    .language-prompt__option {
        flex: 1 1 calc(50% - 8px);
        text-align: center;
    }
}
