/* IKAROS Website - Internationalization CSS */

/* Language Switcher Styles */
.language-switcher {
    position: relative;
    display: inline-block;
}

.current-lang {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 8px 12px;
    background-color: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    min-width: 120px;
}

.current-lang:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 4px var(--shadow-light);
}

.current-lang .flag {
    font-size: 1.125rem;
}

.current-lang .name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-dark);
}

.current-lang .arrow {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-left: auto;
    transition: transform var(--transition-fast);
}

.language-switcher:hover .current-lang .arrow {
    transform: rotate(180deg);
}

.lang-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-md);
    box-shadow: 0 4px 12px var(--shadow-medium);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-medium);
    z-index: 1000;
    margin-top: 4px;
}

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

.lang-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 10px 12px;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: background-color var(--transition-fast);
    font-size: 0.875rem;
}

.lang-option:hover {
    background-color: var(--bg-light);
}

.lang-option.active {
    background-color: var(--primary-color);
    color: var(--text-white);
}

.lang-option.active .name {
    color: var(--text-white);
}

.lang-option .flag {
    font-size: 1rem;
}

.lang-option .name {
    font-weight: 500;
    color: var(--text-dark);
}

/* Footer Language Switcher */
.language-switcher-footer {
    margin-top: 1rem;
}

.language-switcher-footer .current-lang {
    background-color: transparent;
    border-color: #374151;
    color: var(--text-light);
}

.language-switcher-footer .current-lang:hover {
    border-color: var(--primary-color);
}

.language-switcher-footer .current-lang .name {
    color: var(--text-light);
}

.language-switcher-footer .lang-dropdown {
    background-color: var(--bg-dark);
    border-color: #374151;
}

.language-switcher-footer .lang-option {
    color: var(--text-light);
}

.language-switcher-footer .lang-option:hover {
    background-color: #374151;
}

.language-switcher-footer .lang-option .name {
    color: var(--text-light);
}

/* RTL Support */
[dir="rtl"] {
    text-align: right;
}

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

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

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

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

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

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

[dir="rtl"] .about-content {
    direction: rtl;
}

[dir="rtl"] .about-text {
    padding-right: 0;
    padding-left: 2rem;
}

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

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

[dir="rtl"] .footer-content {
    direction: rtl;
}

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

/* RTL Carousel Controls */
[dir="rtl"] .carousel-btn.prev {
    right: 1rem;
    left: auto;
}

[dir="rtl"] .carousel-btn.next {
    left: 1rem;
    right: auto;
}

/* RTL Language Switcher */
[dir="rtl"] .current-lang {
    flex-direction: row-reverse;
}

[dir="rtl"] .current-lang .arrow {
    margin-left: 0;
    margin-right: auto;
}

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

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

/* Language-specific Typography Adjustments */
[lang="ar"], [lang="he"], [lang="fa"] {
    font-family: 'Noto Sans Arabic', 'Noto Sans Hebrew', 'Noto Sans', var(--font-secondary);
}

[lang="el"] {
    font-family: 'Inter', 'Roboto', 'Noto Sans Greek', var(--font-primary);
}

[lang="de"] {
    word-break: break-word;
    hyphens: auto;
}

[lang="fr"] {
    quotes: "«" "»" "‹" "›";
}

[lang="it"] {
    font-style: normal;
}

/* Language-specific Content Adjustments */
[lang="de"] .hero-title,
[lang="de"] .section-title {
    font-size: 0.95em; /* Slightly smaller for longer German words */
}

[lang="fr"] .nav-menu {
    gap: 1.75rem; /* Slightly more space for longer French text */
}

[lang="it"] .service-title {
    line-height: 1.3; /* Better line height for Italian text */
}

/* Mobile RTL Adjustments */
@media screen and (max-width: 768px) {
    [dir="rtl"] .nav-toggle {
        order: -1;
    }

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

    [dir="rtl"] .hero-buttons {
        flex-direction: column;
    }

    [dir="rtl"] .about-text {
        padding-left: 0;
    }

    [dir="rtl"] .contact-item {
        flex-direction: column;
        text-align: center;
    }

    [dir="rtl"] .carousel-btn.prev {
        right: 0.5rem;
    }

    [dir="rtl"] .carousel-btn.next {
        left: 0.5rem;
    }
}

/* Loading States for Language Switching */
.language-switching {
    opacity: 0.7;
    pointer-events: none;
    transition: opacity var(--transition-medium);
}

.language-switching::after {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid var(--border-light);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 10000;
}

/* Language Fade Transition */
.language-fade-out {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.language-fade-in {
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* Text Direction Utilities */
.ltr {
    direction: ltr;
    text-align: left;
}

.rtl {
    direction: rtl;
    text-align: right;
}

/* Language-specific Animations */
[dir="rtl"] .animate-fade-in-left {
    animation: fadeInRight 0.6s ease forwards;
}

[dir="rtl"] .animate-fade-in-right {
    animation: fadeInLeft 0.6s ease forwards;
}

/* Accessibility Improvements for Language Switcher */
.language-switcher:focus-within .lang-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: -2px;
    background-color: var(--bg-light);
}

.lang-option.active:focus {
    outline-color: var(--text-white);
}

/* Screen Reader Support */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Language Indicator */
.current-language-indicator {
    position: fixed;
    top: 100px;
    right: 20px;
    background-color: var(--primary-color);
    color: var(--text-white);
    padding: 4px 8px;
    border-radius: var(--border-radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-medium);
    z-index: 1000;
}

.current-language-indicator.show {
    opacity: 1;
    visibility: visible;
}

[dir="rtl"] .current-language-indicator {
    right: auto;
    left: 20px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .language-switcher .current-lang {
        border-width: 2px;
        border-color: var(--text-dark);
    }

    .lang-dropdown {
        border-width: 2px;
        border-color: var(--text-dark);
    }

    .lang-option:hover {
        background-color: var(--text-dark);
        color: var(--text-white);
    }

    .lang-option.active {
        background-color: var(--text-dark);
        border: 2px solid var(--primary-color);
    }
}

/* Reduced Motion for Language Switching */
@media (prefers-reduced-motion: reduce) {
    .lang-dropdown {
        transition: none;
    }

    .language-switching::after {
        animation: none;
    }

    .language-fade-out,
    .language-fade-in {
        transition: none;
    }
}

