/* =========================================
   Custom Language Selector (Dropdown)
   ========================================= */

.custom-select-wrapper {
    position: relative;
    user-select: none;
    margin-right: 20px;
    z-index: 1002;
}

.custom-select {
    position: relative;
    display: flex;
    flex-direction: column;
}

.custom-select-trigger {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 14px;
    font-size: 0.85rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.95);
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 130px;
    min-height: 44px;
}

.custom-select-trigger:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.3);
}

.flag-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.flag-icon svg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.lang-text {
    margin-right: auto;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.arrow {
    transition: transform 0.3s ease;
    opacity: 0.8;
    display: flex;
    align-items: center;
}

.custom-select.open .arrow {
    transform: rotate(180deg);
}

.custom-options {
    position: absolute;
    display: block;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #FFFFFF;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1003;
    overflow: hidden;
    padding: 4px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.custom-select.open .custom-options {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
    transform: translateY(0);
}

.custom-option {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 10px;
    min-height: 44px;
}

.custom-option:hover {
    background-color: var(--bg-light);
    color: var(--primary-hover);
}

.custom-option.selected {
    background-color: var(--bg-light);
    color: var(--primary-color);
    font-weight: 700;
}

.custom-option .flag-icon {
    width: 18px;
    height: 18px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
}

/* Focus styles for custom dropdown */
.custom-select-trigger:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.9);
    outline-offset: 2px;
}

.custom-option:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: -2px;
}

/* Typing Active Animation (Text Refresh) */
.typing-active {
    animation: fadeInText 0.5s ease-out forwards;
}

@keyframes fadeInText {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Adjustment — lang selector is now inside the fullscreen menu */

