/* AUTO TESTER - Language Switcher Styles */

/* Language Toggle Button */
.lang-toggle {
    background: transparent;
    border: 2px solid var(--secondary, #ffd700);
    color: var(--primary, #002b5c);
    padding: 8px 16px;
    border-radius: 50px;
    cursor: pointer;
    font-family: 'Cairo', 'Tajawal', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    white-space: nowrap;
}

.lang-toggle:hover {
    background: var(--secondary, #ffd700);
    color: var(--primary, #002b5c);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

.lang-toggle:active {
    transform: translateY(0);
}

.lang-toggle i {
    font-size: 0.8rem;
}

/* Language Direction Support */
html[lang="en"] {
    direction: ltr;
}

html[lang="en"] .container,
html[lang="en"] .nav-container {
    direction: ltr;
}

html[lang="en"] .hero-text,
html[lang="en"] .section-title {
    text-align: left;
}

html[lang="en"] .section-title h2::after {
    left: 0;
    right: auto;
    transform: none;
}

html[lang="en"] .stats-grid,
html[lang="en"] .features-grid,
html[lang="en"] .steps-grid,
html[lang="en"] .testimonials-grid,
html[lang="en"] .faq-grid {
    direction: ltr;
}

html[lang="en"] .footer-grid {
    direction: ltr;
}

html[lang="en"] .contact-info li {
    text-align: left;
}

html[lang="en"] .social-links {
    justify-content: flex-start;
}

/* RTL Adjustments for English */
html[lang="en"] .nav-links {
    flex-direction: row;
}

html[lang="en"] .nav-links li {
    margin-left: 0;
    margin-right: 20px;
}

html[lang="en"] .btn {
    margin-left: 0;
    margin-right: 10px;
}

html[lang="en"] .type-card {
    margin-left: 0;
    margin-right: 20px;
}

html[lang="en"] .stats-item {
    text-align: left;
}

html[lang="en"] .feature-card {
    text-align: left;
}

html[lang="en"] .step-card {
    text-align: left;
}

html[lang="en"] .testimonial-card {
    text-align: left;
}

html[lang="en"] .faq-question {
    text-align: left;
}

html[lang="en"] .faq-answer {
    text-align: left;
}

/* Language Switch Animation */
.language-transition {
    transition: all 0.3s ease;
}

html[lang="en"] .language-transition {
    opacity: 0.8;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .lang-toggle {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .lang-toggle i {
        font-size: 0.7rem;
    }
    
    html[lang="en"] .nav-links {
        flex-direction: column;
        align-items: center;
    }
    
    html[lang="en"] .nav-links li {
        margin-left: 0;
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    html[lang="en"] .type-card {
        margin-left: 0;
        margin-right: 0;
        margin-bottom: 20px;
    }
    
    html[lang="en"] .stats-grid,
    html[lang="en"] .features-grid,
    html[lang="en"] .steps-grid {
        grid-template-columns: 1fr;
    }
    
    html[lang="en"] .testimonial-card {
        text-align: center;
    }
    
    html[lang="en"] .faq-question,
    html[lang="en"] .faq-answer {
        text-align: center;
    }
}

/* Language Loading State */
.lang-loading {
    opacity: 0.6;
    pointer-events: none;
}

.lang-loading::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 5px;
}

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

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .lang-toggle {
        border-width: 3px;
        font-weight: 700;
    }
    
    .lang-toggle:hover {
        box-shadow: 0 0 0 3px var(--secondary, #ffd700);
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .lang-toggle,
    .language-transition {
        transition: none;
    }
    
    .lang-toggle:hover {
        transform: none;
    }
    
    .lang-loading::after {
        animation: none;
    }
}

/* Focus Styles for Accessibility */
.lang-toggle:focus {
    outline: 2px solid var(--secondary, #ffd700);
    outline-offset: 2px;
}

.lang-toggle:focus:not(:focus-visible) {
    outline: none;
}

/* Print Styles */
@media print {
    .lang-toggle {
        display: none;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .lang-toggle {
        border-color: var(--secondary, #ffd700);
        color: var(--secondary, #ffd700);
    }
    
    .lang-toggle:hover {
        background: var(--secondary, #ffd700);
        color: var(--primary, #002b5c);
    }
}

/* Custom Properties */
:root {
    --lang-toggle-size: 0.9rem;
    --lang-toggle-padding: 8px 16px;
    --lang-toggle-border-width: 2px;
    --lang-toggle-border-radius: 50px;
}

/* Compact Mode */
.lang-toggle.compact {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 20px;
}

.lang-toggle.compact i {
    font-size: 0.7rem;
}

/* Icon Only Mode */
.lang-toggle.icon-only {
    padding: 8px;
    min-width: 40px;
    justify-content: center;
}

.lang-toggle.icon-only span {
    display: none;
}

/* Tooltip Support */
.lang-toggle[data-tooltip] {
    position: relative;
}

.lang-toggle[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 5px;
}

/* Language Indicator */
.lang-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    opacity: 0.8;
}

.lang-indicator::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--secondary, #ffd700);
}

/* Animation for language change */
@keyframes languageSwitch {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.language-switching {
    animation: languageSwitch 0.3s ease;
}

/* Responsive Grid Adjustments */
html[lang="en"] .footer-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

html[lang="en"] .cta-buttons {
    flex-direction: row;
    justify-content: center;
    gap: 20px;
}

@media (max-width: 768px) {
    html[lang="en"] .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
}
