﻿/* language-switcher.css */

/* Language Switcher Styles */
.language-switcher {
    margin-left: 2rem;
}

.language-dropdown {
    position: relative;
    display: inline-block;
}

.language-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: #4a4a4a;
    transition: all 0.3s ease;
    min-width: 75px;
}

    .language-button:hover {
        border-color: #0077b5;
        color: #0077b5;
        box-shadow: 0 2px 8px rgba(0, 119, 181, 0.1);
    }

    .language-button:focus {
        outline: none;
        border-color: #0077b5;
        box-shadow: 0 0 0 3px rgba(0, 119, 181, 0.1);
    }

.language-code {
    font-size: 0.85rem;
    font-weight: 600;
}

.dropdown-arrow {
    font-size: 0.7rem;
    transition: transform 0.3s ease;
    color: #777;
}

.language-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

/* Flag Icons */
.flag {
    width: 18px;
    height: 12px;
    border-radius: 2px;
    display: inline-block;
    background-size: cover;
    background-position: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.flag-en {
    background-image: url('https://flagcdn.com/16x12/gb.png');
    position: relative;
}

    .flag-en::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: linear-gradient(to right, transparent 40%, #fff 45%, #fff 55%, transparent 60%), linear-gradient(to bottom, transparent 40%, #fff 45%, #fff 55%, transparent 60%);
    }

    .flag-en::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: linear-gradient(to right, transparent 42%, #C8102E 47%, #C8102E 53%, transparent 58%), linear-gradient(to bottom, transparent 42%, #C8102E 47%, #C8102E 53%, transparent 58%);
    }

.flag-it {
    background-image: url('https://flagcdn.com/16x12/it.png');
}

.flag-es {
    background-image: url('https://flagcdn.com/16x12/es.png');
}
/* Language Menu */
.language-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    list-style: none;
    padding: 0.5rem 0;
    margin: 0.25rem 0 0;
    min-width: 140px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.language-dropdown.open .language-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-menu li {
    margin: 0;
}

.language-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    color: #4a4a4a;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background-color 0.2s ease;
    border: none;
    width: 100%;
}

    .language-option:hover {
        background-color: #f8f9fa;
        color: #0077b5;
    }

.language-name {
    flex: 1;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .language-switcher {
        margin-left: 1rem;
    }

    .language-button {
        padding: 0.4rem 0.6rem;
        min-width: 65px;
    }

    .language-code {
        font-size: 0.8rem;
    }

    .language-menu {
        min-width: 120px;
    }

    .language-option {
        padding: 0.5rem 0.8rem;
        font-size: 0.85rem;
    }
}

/* Update header container to accommodate language switcher */
.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

    .header-container nav {
        flex: 1;
        display: flex;
        justify-content: center;
    }

        .header-container nav ul {
            display: flex;
            list-style: none;
            margin: 0;
            padding: 0;
        }

@media (max-width: 768px) {
    .header-container {
        flex-wrap: wrap;
        padding: 0.5rem 0;
    }

        .header-container nav {
            order: 3;
            flex-basis: 100%;
            margin-top: 1rem;
        }

            .header-container nav ul {
                justify-content: center;
                flex-wrap: wrap;
                gap: 0.5rem;
            }

                .header-container nav ul li {
                    margin: 0;
                }

                    .header-container nav ul li a {
                        padding: 0.5rem;
                        font-size: 0.9rem;
                    }
}
