/**
 * AUTO TESTER - Language Switcher Styles
 * Multilingual support with RTL/LTR switching
 */

/* Language Switcher Container */
.language-switcher {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    gap: 8px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    padding: 8px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Language Buttons */
.lang-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    position: relative;
    overflow: hidden;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.lang-btn.active {
    background: linear-gradient(135deg, #00f3ff, #ff00c1);
    color: #000000;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 243, 255, 0.4);
}

.lang-btn.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent);
    border-radius: 25px;
}

/* Language Icons */
.lang-btn::before {
    content: attr(data-flag);
    margin-right: 6px;
    font-size: 16px;
}

/* RTL Support */
[dir="rtl"] .language-switcher {
    right: auto;
    left: 20px;
}

[dir="rtl"] .lang-btn::before {
    margin-right: 0;
    margin-left: 6px;
}

/* Language Loading */
.language-loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.language-loader .spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid #00f3ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Language Direction Styles */
.lang-ar {
    direction: rtl;
    text-align: right;
}

.lang-en {
    direction: ltr;
    text-align: left;
}

/* Font Families */
.lang-ar {
    font-family: 'Cairo', 'Arial', sans-serif;
}

.lang-en {
    font-family: 'Arial', 'Helvetica', sans-serif;
}

/* RTL Layout Adjustments */
[dir="rtl"] .navbar {
    flex-direction: row-reverse;
}

[dir="rtl"] .sidebar {
    right: 0;
    left: auto;
}

[dir="rtl"] .sidebar.open {
    transform: translateX(0);
}

[dir="rtl"] .sidebar.closed {
    transform: translateX(100%);
}

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

[dir="rtl"] .table th,
[dir="rtl"] .table td {
    text-align: right;
}

[dir="rtl"] .form-group {
    text-align: right;
}

[dir="rtl"] .btn-group {
    flex-direction: row-reverse;
}

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

[dir="rtl"] .modal-content {
    text-align: right;
}

[dir="rtl"] .list-group-item {
    text-align: right;
}

[dir="rtl"] .breadcrumb {
    justify-content: flex-start;
}

[dir="rtl"] .pagination {
    justify-content: flex-start;
}

/* RTL Margins and Padding */
[dir="rtl"] .ml-3 {
    margin-left: 0;
    margin-right: 1rem;
}

[dir="rtl"] .mr-3 {
    margin-right: 0;
    margin-left: 1rem;
}

[dir="rtl"] .pl-3 {
    padding-left: 0;
    padding-right: 1rem;
}

[dir="rtl"] .pr-3 {
    padding-right: 0;
    padding-left: 1rem;
}

/* RTL Floats */
[dir="rtl"] .float-left {
    float: right !important;
}

[dir="rtl"] .float-right {
    float: left !important;
}

/* RTL Text Alignment */
[dir="rtl"] .text-left {
    text-align: right !important;
}

[dir="rtl"] .text-right {
    text-align: left !important;
}

/* Language Transition Effects */
.language-transition {
    transition: all 0.3s ease;
}

.language-transition * {
    transition: inherit;
}

/* Responsive Language Switcher */
@media (max-width: 768px) {
    .language-switcher {
        top: 10px;
        right: 10px;
        padding: 6px;
    }
    
    .lang-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    [dir="rtl"] .language-switcher {
        right: auto;
        left: 10px;
    }
}

@media (max-width: 480px) {
    .language-switcher {
        top: 5px;
        right: 5px;
        padding: 4px;
    }
    
    .lang-btn {
        padding: 4px 8px;
        font-size: 11px;
    }
    
    [dir="rtl"] .language-switcher {
        right: auto;
        left: 5px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .language-switcher {
        background: rgba(0, 0, 0, 0.9);
        border-color: rgba(255, 255, 255, 0.2);
    }
    
    .lang-btn {
        background: rgba(255, 255, 255, 0.05);
        color: #ffffff;
    }
    
    .lang-btn:hover {
        background: rgba(255, 255, 255, 0.15);
    }
}

/* Light Mode Support */
@media (prefers-color-scheme: light) {
    .language-switcher {
        background: rgba(255, 255, 255, 0.9);
        border-color: rgba(0, 0, 0, 0.1);
    }
    
    .lang-btn {
        background: rgba(0, 0, 0, 0.05);
        color: #000000;
    }
    
    .lang-btn:hover {
        background: rgba(0, 0, 0, 0.15);
    }
    
    .lang-btn.active {
        color: #ffffff;
    }
}

/* Animation Keyframes */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

/* Language Change Animation */
.language-change-animation {
    animation: fadeIn 0.5s ease;
}

/* Accessibility */
.lang-btn:focus {
    outline: 2px solid #00f3ff;
    outline-offset: 2px;
}

.lang-btn:hover:focus {
    outline: 2px solid #ff00c1;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .language-switcher {
        border: 2px solid #ffffff;
    }
    
    .lang-btn {
        border: 1px solid #ffffff;
    }
    
    .lang-btn.active {
        border: 2px solid #000000;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .lang-btn,
    .language-switcher,
    .language-transition * {
        transition: none;
    }
    
    .language-loader .spinner {
        animation: none;
    }
    
    .language-change-animation {
        animation: none;
    }
}

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