/**
 * AIAM Multilingual - Frontend Styles
 * Language switcher (floating + inline)
 */

/* =========================================================================
   Floating Switcher
   ========================================================================= */

.aiam-ml-switcher-floating {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.aiam-ml-switcher-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    font-size: 14px;
}

.aiam-ml-switcher-toggle:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
    transform: translateY(-1px);
}

.aiam-ml-switcher-arrow {
    font-size: 10px;
    color: #666;
    transition: transform 0.3s ease;
}

.aiam-ml-switcher-floating.open .aiam-ml-switcher-arrow {
    transform: rotate(180deg);
}

.aiam-ml-switcher-floating .aiam-ml-switcher-list {
    position: absolute;
    bottom: 100%;
    left: 0;
    margin-bottom: 8px;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    min-width: 180px;
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all 0.25s ease;
}

.aiam-ml-switcher-floating.open .aiam-ml-switcher-list {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* =========================================================================
   Switcher Items (shared)
   ========================================================================= */

.aiam-ml-switcher-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    text-decoration: none;
    color: #333;
    border-radius: 8px;
    transition: background 0.15s ease;
    font-size: 14px;
    line-height: 1.4;
}

.aiam-ml-switcher-item:hover {
    background: #f0f4ff;
    color: #1a1a1a;
    text-decoration: none;
}

.aiam-ml-switcher-item.active {
    background: #e8f0fe;
    font-weight: 600;
    color: #1a73e8;
}

.aiam-ml-switcher-item .aiam-ml-flag {
    width: 24px;
    height: 17px;
    border-radius: 3px;
    object-fit: cover;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.08);
    flex-shrink: 0;
}

.aiam-ml-switcher-label {
    flex: 1;
}

/* =========================================================================
   Inline Switcher (shortcode)
   ========================================================================= */

.aiam-ml-switcher-inline {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

.aiam-ml-switcher-inline .aiam-ml-switcher-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

.aiam-ml-switcher-inline .aiam-ml-switcher-item {
    padding: 4px 10px;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    font-size: 13px;
    gap: 6px;
}

.aiam-ml-switcher-inline .aiam-ml-switcher-item:hover {
    border-color: #1a73e8;
}

.aiam-ml-switcher-inline .aiam-ml-switcher-item.active {
    border-color: #1a73e8;
    background: #e8f0fe;
}

.aiam-ml-switcher-inline .aiam-ml-flag {
    width: 18px;
    height: 13px;
}

/* =========================================================================
   Dark mode support
   ========================================================================= */

@media (prefers-color-scheme: dark) {
    .aiam-ml-switcher-toggle {
        background: #2d2d2d;
        border-color: rgba(255,255,255,0.1);
        color: #e0e0e0;
    }

    .aiam-ml-switcher-floating .aiam-ml-switcher-list {
        background: #2d2d2d;
        border-color: rgba(255,255,255,0.08);
    }

    .aiam-ml-switcher-item {
        color: #e0e0e0;
    }

    .aiam-ml-switcher-item:hover {
        background: #3a3a3a;
        color: #fff;
    }

    .aiam-ml-switcher-item.active {
        background: #1a3a5c;
        color: #90caf9;
    }
}

/* =========================================================================
   Mobile
   ========================================================================= */

@media (max-width: 768px) {
    .aiam-ml-switcher-floating {
        bottom: 12px;
        left: 12px;
    }

    .aiam-ml-switcher-toggle {
        padding: 6px 10px;
        font-size: 13px;
    }

    .aiam-ml-switcher-floating .aiam-ml-switcher-list {
        min-width: 160px;
    }
}

/* =========================================================================
   Close on outside click (handled via CSS only for simple approach)
   ========================================================================= */

.aiam-ml-switcher-floating.open::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
}
