/* =============================================================
   KATS GMBH - LANGUAGE SWITCHER
   Intelligenter Sprachen-Switcher mit Flaggen-Icons
============================================================= */

.language-switcher {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.language-switcher.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-option {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    border: 3px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.language-option:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.language-option.current {
    border-color: var(--primary);
    box-shadow: 0 4px 16px rgba(24, 129, 221, 0.4), 0 0 0 4px rgba(24, 129, 221, 0.1);
    transform: scale(1.1);
    background: rgba(255, 255, 255, 1);
}

.language-option.current:hover {
    transform: translateY(-2px) scale(1.1);
    cursor: default;
}

.flag-icon {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    transition: all 0.3s ease;
    background: transparent;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.flag-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    transition: all 0.3s ease;
    filter: brightness(1.1) contrast(1.1);
}

.language-option:hover .flag-icon img {
    transform: scale(1.1);
}

.language-option:hover .flag-icon {
    transform: scale(1.05);
}

.language-tooltip {
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-50%) translateX(-10px);
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 10000;
}

.language-tooltip::before {
    content: '';
    position: absolute;
    left: -4px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    border-right: 4px solid rgba(0, 0, 0, 0.9);
}

.language-option:hover .language-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}

/* Responsive Design */
@media (max-width: 768px) {
    .language-switcher {
        bottom: 1.5rem;
        left: 1.5rem;
        gap: 0.6rem;
    }
    
    .language-option {
        width: 44px;
        height: 44px;
    }
    
    .language-tooltip {
        display: none; /* Verstecke Tooltips auf Mobile */
    }
}

@media (max-width: 480px) {
    .language-switcher {
        bottom: 1rem;
        left: 1rem;
        gap: 0.5rem;
    }
    
    .language-option {
        width: 40px;
        height: 40px;
    }
}

/* Keyframes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Accessibility */
.language-option:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.language-option:focus .language-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}

/* Loading State */
.language-switcher.loading .language-option {
    pointer-events: none;
    opacity: 0.6;
}

.language-switcher.loading .language-option::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
