/* Internationalization CSS Styles */
/* Language Picker Component */

.language-picker {
    position: relative;
    display: inline-block;
    font-family: 'Quicksand', sans-serif;
    z-index: 1000;
}

.language-picker-current {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.language-picker-current:hover {
    background: rgba(255, 255, 255, 1);
    border-color: #4CAF50;
    box-shadow: 0 4px 20px rgba(76, 175, 80, 0.2);
}

.language-flag {
    font-size: 18px;
    line-height: 1;
}

.language-name {
    font-weight: 600;
    min-width: 60px;
}

.language-arrow {
    font-size: 12px;
    transition: transform 0.3s ease;
    color: #666;
}

.language-picker-current:hover .language-arrow {
    color: #4CAF50;
}

.language-picker-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    max-height: 300px;
    overflow-y: auto;
    backdrop-filter: blur(10px);
}

.language-picker-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-picker-dropdown.show ~ .language-picker-current .language-arrow {
    transform: rotate(180deg);
}

.language-option {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 15px;
    background: none;
    border: none;
    text-align: left;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    border-bottom: 1px solid #f0f0f0;
}

.language-option:last-child {
    border-bottom: none;
}

.language-option:hover {
    background: #f8f9fa;
    color: #4CAF50;
}

.language-option.active {
    background: #e8f5e8;
    color: #4CAF50;
    font-weight: 600;
}

.language-option.active::after {
    content: '✓';
    margin-left: auto;
    font-weight: bold;
    color: #4CAF50;
}

/* RTL Support */
[dir="rtl"] .language-picker-current {
    flex-direction: row-reverse;
}

[dir="rtl"] .language-option {
    flex-direction: row-reverse;
    text-align: right;
}

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

/* RTL Typography and Layout Adjustments */
[dir="rtl"] {
    text-align: right;
}

[dir="rtl"] .hero h1,
[dir="rtl"] .hero p {
    text-align: right;
}

[dir="rtl"] .support-grid {
    direction: rtl;
}

[dir="rtl"] .support-card {
    text-align: right;
}

[dir="rtl"] .contact-form {
    direction: rtl;
}

[dir="rtl"] .contact-form input,
[dir="rtl"] .contact-form textarea,
[dir="rtl"] .contact-form select {
    text-align: right;
}

[dir="rtl"] .faq-question {
    text-align: right;
    flex-direction: row-reverse;
}

[dir="rtl"] .faq-answer {
    text-align: right;
}

/* Font Loading for Different Languages */
/* Arabic Font Support */
[lang="ar"] {
    font-family: 'Noto Sans Arabic', 'Tahoma', sans-serif;
}

/* Hebrew Font Support */
[lang="he"] {
    font-family: 'Noto Sans Hebrew', 'David', sans-serif;
}

/* Chinese Font Support */
[lang="zh"] {
    font-family: 'Noto Sans CJK SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}

/* Language Picker Positioning in Header */
header .language-picker,
nav .language-picker {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
}

[dir="rtl"] header .language-picker,
[dir="rtl"] nav .language-picker {
    right: auto;
    left: 20px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .language-picker-current {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .language-name {
        display: none;
    }
    
    .language-flag {
        font-size: 16px;
    }
    
    header .language-picker,
    nav .language-picker {
        right: 10px;
    }
    
    [dir="rtl"] header .language-picker,
    [dir="rtl"] nav .language-picker {
        left: 10px;
    }
}

/* Loading States */
.i18n-loading {
    cursor: wait;
}

.i18n-loading * {
    pointer-events: none;
}

/* Loading Overlay */
.i18n-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.i18n-loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 24px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.i18n-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #f0f0f0;
    border-top: 3px solid #4CAF50;
    border-radius: 50%;
    animation: i18n-spin 1s linear infinite;
}

@keyframes i18n-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.i18n-loading-content span {
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

/* Translation Fade Effect */
[data-i18n] {
    transition: opacity 0.2s ease;
}

.i18n-updating [data-i18n] {
    opacity: 0.8;
}

/* Smooth content transitions */
.i18n-updating {
    transition: all 0.2s ease;
}

/* Language-specific adjustments */
[lang="ar"] .language-picker-current,
[lang="he"] .language-picker-current {
    direction: rtl;
}

[lang="ar"] .language-picker-dropdown,
[lang="he"] .language-picker-dropdown {
    left: auto;
    right: 0;
    direction: rtl;
}

/* Accessibility Improvements */
.language-picker-current:focus,
.language-option:focus {
    outline: 2px solid #4CAF50;
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .language-picker-current {
        border-color: #000;
        color: #000;
    }
    
    .language-option:hover {
        background: #000;
        color: #fff;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .language-picker-current,
    .language-picker-dropdown,
    .language-option,
    [data-i18n] {
        transition: none;
    }
}

/* Print Styles */
@media print {
    .language-picker {
        display: none;
    }
}

/* Dark Mode Support (if implemented) */
@media (prefers-color-scheme: dark) {
    .language-picker-current {
        background: rgba(45, 45, 45, 0.95);
        border-color: #555;
        color: #fff;
    }
    
    .language-picker-dropdown {
        background: #2d2d2d;
        border-color: #555;
    }
    
    .language-option {
        color: #fff;
        border-bottom-color: #444;
    }
    
    .language-option:hover {
        background: #444;
    }
    
    .language-option.active {
        background: #2d5a2d;
    }
}

/* Custom scrollbar for language dropdown */
.language-picker-dropdown::-webkit-scrollbar {
    width: 6px;
}

.language-picker-dropdown::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.language-picker-dropdown::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.language-picker-dropdown::-webkit-scrollbar-thumb:hover {
    background: #999;
}