/**
 * Public styles for Boost Languages plugin
 * Language switcher and public-facing elements
 *
 * @package BoostLanguages
 * @path boost-languages/assets/css/boost-languages-public.css
 */

/* ==========================================================================
   LANGUAGE SWITCHER - BASE STYLES
   ========================================================================== */

.boost-language-switcher {
    position: relative;
    display: inline-block;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 14px;
    line-height: 1.4;
    z-index: 1000;
}

.boost-language-switcher * {
    box-sizing: border-box;
}

/* ==========================================================================
   DROPDOWN STYLE
   ========================================================================== */

.boost-switcher-dropdown .boost-language-current {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.boost-switcher-dropdown .boost-language-current:hover {
    background: #f8f9fa;
    border-color: #999;
}

.boost-switcher-dropdown .boost-language-current:focus {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

.boost-switcher-dropdown .boost-dropdown-arrow {
    margin-left: auto;
    font-size: 10px;
    transition: transform 0.3s ease;
}

.boost-switcher-dropdown.boost-dropdown-open .boost-dropdown-arrow {
    transform: rotate(180deg);
}

.boost-switcher-dropdown .boost-language-list {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 100%;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    list-style: none;
    margin: 0;
    padding: 4px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1001;
}

.boost-switcher-dropdown.boost-dropdown-open .boost-language-list {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.boost-switcher-dropdown .boost-language-list li {
    margin: 0;
    padding: 0;
}

.boost-switcher-dropdown .boost-language-list a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    color: #333;
    text-decoration: none;
    transition: background 0.2s ease;
    white-space: nowrap;
}

.boost-switcher-dropdown .boost-language-list a:hover {
    background: #f8f9fa;
}

.boost-switcher-dropdown .boost-language-list a:focus {
    background: #e8f0fe;
    outline: none;
}

/* ==========================================================================
   LIST STYLE
   ========================================================================== */

.boost-switcher-list .boost-language-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
    background-color: transparent;
}

.boost-switcher-list .boost-language-list li {
    margin: 0;
}

.boost-switcher-list .boost-language-list a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 14px;
}

.boost-switcher-list .boost-language-list a:hover {
    background: #f8f9fa;
    border-color: #999;
    transform: translateY(-1px);
}

.boost-switcher-list .boost-language-list a:focus {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

.boost-switcher-list .boost-language-list li.boost-lang-current a {
    background: #2271b1;
    border-color: #2271b1;
    color: #fff;
    font-weight: 600;
}

/* ==========================================================================
   FLAGS ONLY STYLE
   ========================================================================== */

.boost-switcher-flags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.boost-switcher-flags .boost-lang-flag-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 50%;
    text-decoration: none;
    font-size: 20px;
    transition: all 0.2s ease;
}

.boost-switcher-flags .boost-lang-flag-link:hover {
    border-color: #2271b1;
    transform: scale(1.1);
}

.boost-switcher-flags .boost-lang-flag-link:focus {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

.boost-switcher-flags .boost-lang-flag-link.boost-lang-current {
    border-color: #2271b1;
    border-width: 3px;
    background: #f0f6fc;
}

/* ==========================================================================
   FLAGS & LANGUAGE NAMES
   ========================================================================== */

/* FLAGS & LANGUAGE NAMES */
.boost-lang-flag {
    font-size: 18px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
}

.boost-lang-name {
    font-size: 14px;
    font-weight: 500;
}

/* ==========================================================================
   FLOATING BUTTON POSITIONS
   ========================================================================== */

.boost-languages-floating-switcher {
    position: fixed;
    z-index: 9999;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Bottom Right (default) */
.boost-languages-floating-switcher.boost-position-bottom_right {
    bottom: 20px;
    right: 20px;
}

/* Bottom Left */
.boost-languages-floating-switcher.boost-position-bottom_left {
    bottom: 20px;
    left: 20px;
}

/* Top Right */
.boost-languages-floating-switcher.boost-position-top_right {
    top: 20px;
    right: 20px;
}

/* Top Left */
.boost-languages-floating-switcher.boost-position-top_left {
    top: 20px;
    left: 20px;
}

/* Floating button enhanced styles */
.boost-languages-floating-switcher .boost-language-switcher {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.boost-languages-floating-switcher .boost-language-current {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

@media (max-width: 768px) {
    
    /* Dropdown adjustments */
    .boost-switcher-dropdown .boost-language-list {
        min-width: 200px;
        max-width: 90vw;
    }
    
    /* List adjustments */
    .boost-switcher-list .boost-language-list {
        justify-content: center;
        background-color: transparent;
    }
    
    /* Floating button adjustments */
    .boost-languages-floating-switcher.boost-position-bottom_right,
    .boost-languages-floating-switcher.boost-position-bottom_left {
        bottom: 10px;
    }
    
    .boost-languages-floating-switcher.boost-position-bottom_right {
        right: 10px;
    }
    
    .boost-languages-floating-switcher.boost-position-bottom_left {
        left: 10px;
    }
    
    .boost-languages-floating-switcher.boost-position-top_right,
    .boost-languages-floating-switcher.boost-position-top_left {
        top: 10px;
    }
    
    .boost-languages-floating-switcher.boost-position-top_right {
        right: 10px;
    }
    
    .boost-languages-floating-switcher.boost-position-top_left {
        left: 10px;
    }
}

@media (max-width: 480px) {
    
    /* Smaller font sizes on mobile */
    .boost-language-switcher {
        font-size: 13px;
    }
    
    .boost-lang-flag {
        font-size: 16px;
    }
    
    .boost-lang-name {
        font-size: 13px;
    }
    
    /* Smaller padding on mobile */
    .boost-switcher-dropdown .boost-language-current,
    .boost-switcher-dropdown .boost-language-list a {
        padding: 8px 12px;
    }
    
    .boost-switcher-list .boost-language-list a {
        padding: 6px 10px;
        font-size: 13px;
        background-color: transparent;
    }
    
    /* Smaller flags on mobile */
    .boost-switcher-flags .boost-lang-flag-link {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
}

/* ==========================================================================
   ACCESSIBILITY
   ========================================================================== */

/* Focus states for keyboard navigation */
.boost-language-switcher a:focus,
.boost-language-switcher button:focus {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .boost-language-switcher {
        border: 2px solid currentColor;
    }
    
    .boost-switcher-dropdown .boost-language-current,
    .boost-switcher-list .boost-language-list a {
        border-width: 2px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .boost-language-switcher *,
    .boost-languages-floating-switcher {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */

@media print {
    .boost-languages-floating-switcher {
        display: none;
    }
}