/**
 * Compact Language Switcher Styles
 * Absolute positioned in top-right corner with clean dropdown
 */

/* Container for language switcher - absolute positioned top-right */
.epoxystone-compact-lang-switcher {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Main language button (current language) */
.epoxystone-lang-btn-current {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #e0e0e0;
    background: #ffffff;
    color: #333333;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    outline: none;
}

/* Current button hover state */
.epoxystone-lang-btn-current:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border-color: #007cba;
    background: #f7f7f7;
}

/* Active/open state for current button */
.epoxystone-compact-lang-switcher.open .epoxystone-lang-btn-current {
    background: #007cba;
    color: #ffffff;
    border-color: #005a87;
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.3);
}

/* Dropdown menu - clean, no background, no padding */
.epoxystone-lang-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    min-width: 100px;
    z-index: 10000;
}

/* Show dropdown when open */
.epoxystone-compact-lang-switcher.open .epoxystone-lang-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Language option button - clean list style */
.epoxystone-lang-option {
    display: block;
    width: 100%;
    padding: 8px 16px;
    border: none;
    background: rgba(255, 255, 255, 0.95);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    color: #333333;
    margin-bottom: 2px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
}

.epoxystone-lang-option:hover {
    background: rgba(0, 124, 186, 0.9);
    color: #ffffff;
    transform: translateX(-2px);
    box-shadow: 0 2px 8px rgba(0, 124, 186, 0.3);
}

.epoxystone-lang-option:active {
    transform: translateX(-1px);
}

/* Language code and name layout */
.epoxystone-lang-option .lang-code {
    display: inline-block;
    width: 24px;
    height: 24px;
    background: #007cba;
    color: #ffffff;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    margin-right: 8px;
    text-align: center;
    line-height: 24px;
    vertical-align: middle;
    flex-shrink: 0;
}

.epoxystone-lang-option:hover .lang-code {
    background: #ffffff;
    color: #007cba;
}

.epoxystone-lang-option .lang-name {
    color: inherit;
    font-weight: 500;
    vertical-align: middle;
}

/* Loading state */
.epoxystone-lang-option.loading {
    pointer-events: none;
    opacity: 0.7;
    position: relative;
}

.epoxystone-lang-option.loading::after {
    content: '';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    border: 2px solid transparent;
    border-top-color: #007cba;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: translateY(-50%) rotate(360deg); }
}

/* Click outside to close */
.epoxystone-lang-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9998;
    background: transparent;
    display: none;
}

.epoxystone-compact-lang-switcher.open ~ .epoxystone-lang-overlay,
.epoxystone-lang-overlay.show {
    display: block;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .epoxystone-compact-lang-switcher {
        top: 15px;
        right: 15px;
    }
    
    .epoxystone-lang-btn-current {
        width: 35px;
        height: 35px;
        font-size: 12px;
    }
    
    .epoxystone-lang-option {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .epoxystone-lang-option .lang-code {
        width: 20px;
        height: 20px;
        font-size: 9px;
        line-height: 20px;
        margin-right: 6px;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .epoxystone-compact-lang-switcher {
        top: 10px;
        right: 10px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .epoxystone-lang-btn-current {
        background: #2c2c2c;
        color: #e0e0e0;
        border-color: #444444;
    }
    
    .epoxystone-lang-btn-current:hover {
        background: #3a3a3a;
        border-color: #007cba;
    }
    
    .epoxystone-compact-lang-switcher.open .epoxystone-lang-btn-current {
        background: #007cba;
        color: #ffffff;
    }
    
    .epoxystone-lang-option {
        background: rgba(44, 44, 44, 0.95);
        color: #e0e0e0;
    }
    
    .epoxystone-lang-option:hover {
        background: rgba(0, 124, 186, 0.9);
        color: #ffffff;
    }
}

/* Tooltip for current language */
.epoxystone-lang-btn-current[title]::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 8px;
    padding: 4px 8px;
    background: #333;
    color: #fff;
    font-size: 11px;
    font-weight: normal;
    white-space: nowrap;
    border-radius: 4px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 10001;
}

.epoxystone-lang-btn-current:hover::after {
    opacity: 1;
}

/* Hide tooltip when dropdown is open */
.epoxystone-compact-lang-switcher.open .epoxystone-lang-btn-current::after {
    display: none;
}

/* Hide old language switchers */
.epoxystone-minicart-language-switcher,
.epoxystone-language-select,
#minicart-language-select,
.language-switcher:not(.epoxystone-compact-lang-switcher) {
    display: none !important;
}

/* Notification styles */
.epoxystone-notification {
    position: fixed;
    top: 80px;
    right: 20px;
    padding: 12px 16px;
    border-radius: 6px;
    z-index: 99999;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    font-size: 14px;
    font-family: inherit;
    max-width: 280px;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.epoxystone-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.epoxystone-notification-success {
    background: #4CAF50;
    color: white;
}

.epoxystone-notification-error {
    background: #f44336;
    color: white;
}

/* Ensure switcher stays on top of everything including minicart overlays */
.epoxystone-compact-lang-switcher {
    z-index: 9999999 !important;
}

.epoxystone-lang-dropdown {
    z-index: 10000000 !important;
}

.epoxystone-lang-overlay {
    z-index: 9999998 !important;
}