/**
 * Frontend styles for Region Language Selector
 */

/* Toggle Button */
.rls-toggle-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    appearance: none;
    background: none;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    /* box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); */
    font-size: 23px;
    position: relative;
    z-index: 1;
    pointer-events: auto;
}

.rls-toggle-button:hover {
    /* background: #090238; */
    /* box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15); */
    /* transform: translateY(-1px); */
}

.rls-toggle-button:active {
    /* transform: translateY(0); */
    /* box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); */
}

.rls-toggle-text {
    flex: 1;
}

.rls-toggle-arrow {
    font-size: 10px;
    transition: transform 0.3s ease;
}

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

/* Modal Styles */
.rls-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(4px);
    padding: 20px;
    overflow-y: auto;
}

.rls-modal-overlay.rls-modal-active {
    opacity: 1;
    visibility: visible;
}

.rls-modal-content {
    position: relative;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    margin: auto;
    transform: scale(0.9) translateY(-20px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.rls-modal-overlay.rls-modal-active .rls-modal-content {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.rls-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 50%;
    cursor: pointer;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 0;
    margin: 0;
}

.rls-modal-close svg {
    width: 16px;
    height: 16px;
    display: block;
}

.rls-modal-close:hover {
    background: #f0f0f0;
    border-color: #999;
    color: #000;
}

.rls-modal-close:focus {
    outline: 2px solid #090238;
    outline-offset: 2px;
}

body.rls-modal-open {
    overflow: hidden;
}

/* Regular Selector (hidden when modal is used) */
.rls-region-selector {
    margin: 20px 0;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Hide regular selector when toggle is used */
.rls-selector-hidden,
body.rls-has-toggle .rls-region-selector:not(.rls-modal-content) {
    display: none !important;
}

.rls-intro-text {
    margin: 0 0 15px 0;
    font-weight: 500;
    color: #333;
}

.rls-regions-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rls-region-item {
    padding: 15px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    transition: box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.rls-region-item:hover {
    /* box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); */
}

.rls-region-item.rls-current-region {
    background-color: rgba(9, 2, 56, 0.05);
    /* border-color: #090238; */
    /* border-width: 2px; */
}

.rls-region-name {
    font-size: 16px;
    color: #090238;
    font-weight: 600;
    flex-shrink: 0;
    margin: 0;
}

.rls-region-languages {
    font-size: 14px;
    color: #555;
    line-height: 1.6;
    flex: 1;
    text-align: right;
    min-width: 0;
}

.rls-language-link {
    display: inline-block;
    color: #090238;
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 20px;
    transition: all 0.2s ease;
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    font-size: 13px;
    line-height: 1.4;
    margin: 2px 4px;
}

.rls-language-link:hover {
    background-color: #e0e0e0;
    color: #090238;
    border-color: #bbb;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.rls-language-link:focus {
    outline: 2px solid #090238;
    outline-offset: 2px;
    background-color: #e0e0e0;
    border-color: #090238;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.2);
}

.rls-language-link.rls-current {
    font-weight: 600;
    color: #fff;
    background-color: #090238;
    border-color: #090238;
}

.rls-language-link.rls-current:hover {
    background-color: #090238;
    border-color: #090238;
    color: #fff;
}

.rls-language-link.rls-current:focus {
    outline: 2px solid #090238;
    outline-offset: 2px;
    background-color: #090238;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.3);
}

/* Responsive design */
@media (max-width: 768px) {
    .rls-region-selector {
        padding: 15px;
    }

    .rls-region-item {
        padding: 12px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .rls-region-name {
        font-size: 15px;
        width: 100%;
    }

    .rls-region-languages {
        font-size: 13px;
        text-align: left;
        width: 100%;
    }
}
