/* Flag styles - overriding any existing language selector styles */
.language-selector {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 40px;
    position: relative;
    width: 100%;
}

/* Language selector container - for standalone usage */
.language-selector-container {
    display: flex;
    justify-content: center;
    margin: 10px auto;
    padding: 5px 0;
    background-color: rgba(13, 25, 45, 0.8);
}

/* Reset any previous button styles and set up for flags */
.language-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    opacity: 0.5;
    transition: all 0.3s ease;
    position: relative;
    display: flex !important;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 30px;
    overflow: hidden;
    /* Remove any text styling */
    font-size: 0; /* Hide any text content */
    color: transparent;
    letter-spacing: 0;
    text-indent: -9999px;
    line-height: 0;
}

/* Make sure SVGs and images are properly displayed */
.language-btn img,
.language-btn svg {
    display: block !important;
    width: 32px;
    height: auto;
    max-height: 22px;
    border: none;
    border-radius: 0;
    box-shadow: none;
    /* These ensure proper rendering across browsers */
    object-fit: contain;
    max-width: 100%;
    pointer-events: none; /* Prevents flickering on hover in some browsers */
}

/* Button hover and active states */
.language-btn:hover {
    opacity: 1;
    transform: scale(1.15);
    background: transparent;
    border: none;
    outline: none;
}

.language-btn.active {
    opacity: 1;
    transform: scale(1.2);
    background: transparent;
    border: none;
    outline: none;
    box-shadow: none;
}

/* Handle flag aspect ratios */
.language-btn[data-lang="en"] img {
    /* Maintain UK flag aspect ratio */
    aspect-ratio: 2 / 1;
}

.language-btn[data-lang="sk"] img {
    /* Maintain Slovak flag aspect ratio */
    aspect-ratio: 3 / 2;
}

/* Browser compatibility fixes */
@supports (-webkit-appearance: none) or (-moz-appearance: none) or (appearance: none) {
    /* Safari/Chrome specific fixes */
    .language-btn img {
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
    }
}

/* Firefox specific fixes */
@-moz-document url-prefix() {
    .language-btn img {
        image-rendering: -moz-crisp-edges;
    }
}

/* Responsive styles */
@media (max-width: 768px) {
    .language-selector {
        margin-top: 30px;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .language-selector {
        margin-top: 25px;
    }
    
    .language-btn {
        padding: 3px;
        min-width: 36px;
        min-height: 28px;
    }
    
    .language-btn img {
        width: 28px;
        max-height: 20px;
    }
}
