/* Language Switcher - Health Istanbul Translation */

/* Menu item container reset */
li.language-switcher,
li[class*="language-switcher"] {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Hide original placeholder link */
li.language-switcher a[rel="language-switcher"],
li[class*="language-switcher"] a[rel="language-switcher"] {
    display: none !important;
}

/* Container */
#language-switcher {
    display: inline-block;
}

/* Trigger Button - Menu Style */
.hi-lang-trigger {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white !important;
    border: none !important;
    border-radius: 6px;
    padding: 8px 14px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none !important;
    line-height: 1.4 !important;
    margin: 0 !important;
}

.hi-lang-trigger:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    background: linear-gradient(135deg, #5568d3 0%, #6a3f8f 100%);
}

.hi-lang-trigger svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.hi-lang-current {
    font-weight: 700;
    letter-spacing: 0.5px;
    color: white !important;
}

/* Modal - FIXED positioning to escape header */
.hi-lang-modal {
    display: none;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 999999 !important;
    animation: hi-fadeIn 0.2s ease;
    padding: 0 !important;
    margin: 0 !important;
}

.hi-lang-modal.active {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

/* Modal Content */
.hi-lang-modal-content {
    background: white;
    border-radius: 16px;
    max-width: 650px;
    width: 90%;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: hi-slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    margin: 20px;
}

/* Modal Header */
.hi-lang-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.hi-lang-modal-header h3 {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 22px !important;
    font-weight: 700 !important;
    color: #1f2937 !important;
    line-height: 1.2 !important;
}

.hi-lang-modal-close {
    background: none !important;
    border: none !important;
    font-size: 32px !important;
    line-height: 1 !important;
    cursor: pointer;
    color: #9ca3af !important;
    transition: color 0.2s;
    padding: 0 !important;
    margin: 0 !important;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hi-lang-modal-close:hover {
    color: #4b5563 !important;
    background: none !important;
}

/* Language Grid */
.hi-lang-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); /* 160px → 120px */
    gap: 10px; /* 12px → 10px */
    padding: 20px; /* 24px → 20px */
    overflow-y: auto;
    max-height: calc(85vh - 100px);
}

/* Language Item */
.hi-lang-item {
    position: relative;
    display: flex !important;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 14px 10px !important;
    border: 2px solid #e5e7eb !important;
    border-radius: 10px !important;
    text-decoration: none !important;
    color: #374151 !important;
    transition: all 0.2s
    ease;
    background: white !important;
    margin: 0 !important;
    height: 45px !important;
}

.hi-lang-item:hover {
    border-color: #667eea !important;
    background: #f9fafb !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15) !important;
    text-decoration: none !important;
}

.hi-lang-item.active {
    border-color: #667eea !important;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%) !important;
}

.hi-lang-flag {
    font-size: 28px; /* 36px → 28px */
    line-height: 1;
}

.hi-lang-name {
    font-size: 13px !important; /* 14px → 13px */
    font-weight: 600 !important;
    text-align: center;
    color: #374151 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.hi-lang-check {
    position: absolute;
    top: 8px;
    right: 8px;
    color: #667eea;
}

/* Animations */
@keyframes hi-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes hi-slideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .hi-lang-modal-content {
        width: 95%;
        max-height: 90vh;
        margin: 10px;
    }

    .hi-lang-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); /* 130px → 100px */
        gap: 8px; /* 10px → 8px */
        padding: 16px; /* 20px → 16px */
    }

    .hi-lang-item {
        padding: 12px 8px !important; /* 14px 10px → 12px 8px */
    }

    .hi-lang-flag {
        font-size: 24px; /* 30px → 24px */
    }

    .hi-lang-name {
        font-size: 12px !important; /* 13px → 12px */
    }
}

/* Ensure modal is above everything */
body.hi-modal-open {
    overflow: hidden !important;
}