/* Language Switcher Styles */
.language-switcher {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    position: relative;
}

/* Remove all borders and outlines from language switcher links */
.language-switcher a,
.language-switcher a:link,
.language-switcher a:visited,
.language-switcher a:hover,
.language-switcher a:active,
.language-switcher a:focus {
    border: none !important;
    outline: none !important;
    text-decoration: none !important;
}

.lang-link {
    padding: 0.25rem 0.5rem;
    border: none; /* Remove border */
    border-radius: 3px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: bold;
    transition: all 0.3s ease;
    cursor: pointer;
    display: inline-block;
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1); /* Subtle background instead of border */
    outline: none; /* Remove focus outline */
}

.lang-link:focus {
    outline: none; /* Remove focus outline */
    box-shadow: 0 0 5px rgba(228, 76, 101, 0.5); /* Custom focus indicator */
}

.lang-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.lang-link:hover::before {
    left: 100%;
}

.lang-link:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.lang-link.active {
    background: #e44c65 !important;
    color: white !important;
    box-shadow: 0 0 10px rgba(228, 76, 101, 0.4) !important;
    transform: scale(1.05) !important;
}

/* Ensure only one can be active at a time */
.language-switcher .lang-link:not(.active) {
    background: rgba(255, 255, 255, 0.1) !important;
    color: rgba(255, 255, 255, 0.8) !important;
    transform: scale(1) !important;
    box-shadow: none !important;
}

.language-switcher .lang-link.active {
    background: #e44c65 !important;
    color: white !important;
    box-shadow: 0 0 10px rgba(228, 76, 101, 0.4) !important;
    transform: scale(1.05) !important;
}

/* Override any conflicting styles */
.language-switcher .lang-link {
    transition: all 0.3s ease !important;
}

.lang-link.active::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #e44c65, #ff6b8a, #e44c65);
    border-radius: 5px;
    z-index: -1;
    animation: activeGlow 2s ease-in-out infinite alternate;
}

@keyframes activeGlow {
    0% { opacity: 0.8; }
    100% { opacity: 1; }
}

/* Loading state for language switcher */
.language-switcher.loading {
    pointer-events: none;
}

.language-switcher.loading .lang-link {
    opacity: 0.6;
    transform: scale(0.95);
}

.language-switcher.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 3px solid transparent;
    border-top: 3px solid #e44c65;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 10;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Success feedback animation */
.language-switcher.switching {
    position: relative;
}

.language-switcher.switching::before {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #4CAF50;
    font-size: 16px;
    font-weight: bold;
    background: rgba(255,255,255,0.9);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: successPulse 0.6s ease-out;
    z-index: 10;
}

@keyframes successPulse {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
    50% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

/* Menu transition effects */
.main-nav a, .mobile-menu a {
    transition: all 0.3s ease;
    position: relative;
}

.main-nav a.updating, .mobile-menu a.updating {
    color: #e44c65;
    animation: textUpdate 0.5s ease-in-out;
}

@keyframes textUpdate {
    0% { opacity: 1; transform: translateY(0); }
    50% { opacity: 0.5; transform: translateY(-3px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Responsive language switcher */
@media (max-width: 768px) {
    .language-switcher {
        gap: 0.25rem;
    }
    
    .lang-link {
        padding: 0.2rem 0.4rem;
        font-size: 0.75rem;
    }
}

/* Page transition overlay */
.page-transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.page-transition-overlay.active {
    display: flex;
}

.transition-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255,255,255,0.3);
    border-top: 5px solid #e44c65;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Debug info for development */
.sibridges-debug {
    position: fixed;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 12px;
    z-index: 9999;
    display: none;
}

.sibridges-debug.show {
    display: block;
}

/* Flag icon styling for language switcher - FLAG ONLY */
.lang-link {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 32px !important;
    height: 24px !important;
    padding: 4px !important;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
}

.lang-link .flag-icon {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 24px !important;
    height: 18px !important;
    margin: 0 !important;
}

.lang-link .flag-icon img,
.lang-link .emoji {
    width: 24px !important;
    height: 18px !important;
    object-fit: cover;
    border-radius: 2px;
    display: block !important;
}

/* Active state for flag only */
.lang-link.active {
    background: #e44c65 !important;
    border-color: #e44c65 !important;
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(228, 76, 101, 0.4);
}

/* Hover effect for flag only */
.lang-link:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
}

.lang-link.active:hover {
    background: #e44c65 !important;
    transform: scale(1.05) translateY(-1px);
}

/* Ensure no text is displayed */
.lang-link {
    font-size: 0 !important;
    line-height: 0 !important;
    text-indent: -9999px !important;
    white-space: nowrap !important;
}

/* Force flag icon visibility */
.lang-link .flag-icon,
.lang-link .flag-icon img {
    font-size: initial !important;
    line-height: initial !important;
    text-indent: 0 !important;
}

/* Anti-flicker protection */
.lang-link {
    transition: all 0.3s ease !important;
}

.lang-link.flag-updating {
    opacity: 1 !important;
    transition: none !important;
}

/* Stable flag positioning */
.lang-link .flag-icon {
    position: relative;
    z-index: 1;
}

/* Prevent content jumping */
.language-switcher {
    min-height: 32px;
    align-items: center;
}

.lang-link {
    min-width: 32px;
    min-height: 24px;
}