/**
 * AHC Language Switcher Styles
 */

/* Container */
.ahc-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;
    z-index: 9999;
}

/* Current Language Button */
.ahc-current-language {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #ffffff;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #333;
}

.ahc-current-language:hover {
    background: #f5f5f5;
    border-color: #ccc;
    color: #333 !important;
}

.ahc-current-language:hover .ahc-lang-label {
    color: #333 !important;
}

.ahc-current-language:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* Flag Image */
.ahc-flag {
    width: 24px;
    height: 16px;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 0 1px rgba(0,0,0,0.2);
}

/* Language Label */
.ahc-lang-label {
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Arrow Icon */
.ahc-arrow {
    width: 10px;
    height: 6px;
    transition: transform 0.2s ease;
    margin-left: 4px;
}

.ahc-language-switcher.ahc-open .ahc-arrow {
    transform: rotate(180deg);
}

/* Dropdown Menu */
.ahc-language-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: auto;
    margin: 4px 0 0 0;
    padding: 4px 0;
    background: #ffffff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    list-style: none;
    min-width: 140px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

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

/* Dropdown Items */
.ahc-language-dropdown li {
    margin: 0;
    padding: 0;
}

.ahc-language-dropdown li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: #333 !important;
    text-decoration: none !important;
    transition: background 0.15s ease;
}

.ahc-language-dropdown li a:hover {
    background: #f5f5f5;
    color: #333 !important;
}

.ahc-language-dropdown li a:hover .ahc-lang-label,
.ahc-language-dropdown li a:hover .ahc-lang-name {
    color: #333 !important;
}

.ahc-language-dropdown li.ahc-current a {
    background: #f0f7ff;
    color: #333 !important;
    font-weight: 500;
}

.ahc-language-dropdown li.ahc-current a:hover {
    color: #333 !important;
}

.ahc-language-dropdown li.ahc-current a .ahc-lang-label,
.ahc-language-dropdown li.ahc-current a .ahc-lang-name {
    color: #333 !important;
}

.ahc-language-dropdown .ahc-lang-name {
    flex: 1;
}

/* =============================================
   STYLE VARIATIONS
   ============================================= */

/* Minimal Style */
.ahc-style-minimal .ahc-current-language {
    background: transparent;
    border: none;
    padding: 6px 8px;
}

.ahc-style-minimal .ahc-current-language:hover {
    background: rgba(0, 0, 0, 0.05);
}

.ahc-style-minimal .ahc-language-dropdown {
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

/* Rounded Style */
.ahc-style-rounded .ahc-current-language {
    border-radius: 20px;
    padding: 8px 16px;
}

.ahc-style-rounded .ahc-language-dropdown {
    border-radius: 12px;
}

.ahc-style-rounded .ahc-flag {
    border-radius: 50%;
    width: 20px;
    height: 20px;
}

/* Dark Style */
.ahc-style-dark .ahc-current-language {
    background: #2c2c2c;
    border-color: #444;
    color: #fff;
}

.ahc-style-dark .ahc-current-language:hover {
    background: #3a3a3a;
    border-color: #555;
    color: #fff !important;
}

.ahc-style-dark .ahc-current-language:hover .ahc-lang-label {
    color: #fff !important;
}

.ahc-style-dark .ahc-language-dropdown {
    background: #2c2c2c;
    border-color: #444;
}

.ahc-style-dark .ahc-language-dropdown li a {
    color: #fff !important;
}

.ahc-style-dark .ahc-language-dropdown li a:hover {
    background: #3a3a3a;
    color: #fff !important;
}

.ahc-style-dark .ahc-language-dropdown li a:hover .ahc-lang-label,
.ahc-style-dark .ahc-language-dropdown li a:hover .ahc-lang-name {
    color: #fff !important;
}

.ahc-style-dark .ahc-language-dropdown li.ahc-current a {
    background: #404040;
    color: #66b3ff !important;
}

.ahc-style-dark .ahc-language-dropdown li.ahc-current a .ahc-lang-label,
.ahc-style-dark .ahc-language-dropdown li.ahc-current a .ahc-lang-name {
    color: #66b3ff !important;
}

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

@media (max-width: 768px) {
    .ahc-current-language {
        padding: 6px 10px;
    }
    
    .ahc-flag {
        width: 20px;
        height: 14px;
    }
    
    .ahc-lang-label {
        font-size: 12px;
    }
    
    .ahc-language-dropdown {
        min-width: 120px;
    }
    
    .ahc-language-dropdown li a {
        padding: 8px 12px;
        font-size: 13px;
    }
}

/* =============================================
   RTL SUPPORT (Arabic)
   ============================================= */

[dir="rtl"] .ahc-language-switcher,
.rtl .ahc-language-switcher {
    direction: rtl;
}

[dir="rtl"] .ahc-language-dropdown,
.rtl .ahc-language-dropdown {
    left: auto;
    right: 0;
}

[dir="rtl"] .ahc-arrow,
.rtl .ahc-arrow {
    margin-left: 0;
    margin-right: 4px;
}

/* =============================================
   ANIMATIONS
   ============================================= */

@keyframes ahc-fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ahc-language-switcher.ahc-open .ahc-language-dropdown {
    animation: ahc-fadeIn 0.2s ease forwards;
}
