/**
 * i18n Internationalization Styles for Review Agent
 * 
 * This stylesheet provides styling for the internationalization system
 * including the language popup and direction support.
 * 
 * @author Review Agent Team
 * @version 1.0.0
 * @created 2025-01-16
 */

/* Language Popup Styles */
.language-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.language-popup-content {
    background: var(--color-surface, #ffffff);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    max-width: 480px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.language-popup.show .language-popup-content {
    transform: translateY(0);
}

.language-popup-header {
    display: flex;
    align-items: center;
    padding: 24px 24px 16px;
    border-bottom: 1px solid var(--glass-border, rgba(0,0,0,0.08));
    position: relative;
}

.language-popup-header .language-flag {
    font-size: 32px;
    margin-right: 12px;
    line-height: 1;
}

.language-popup-header h3 {
    margin: 0;
    flex: 1;
    font-size: 20px;
    font-weight: 600;
    color: var(--color-text, #1d1d1f);
}

.language-popup-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--color-text-muted, rgba(0,0,0,0.6));
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
    line-height: 1;
}

.language-popup-close:hover {
    background: rgba(0,0,0,0.04);
    color: var(--color-text, #1d1d1f);
}

.language-popup-body {
    padding: 24px;
}

.language-popup-body p {
    margin: 0 0 24px;
    color: var(--color-text, #1d1d1f);
    line-height: 1.6;
    font-size: 16px;
}

.language-popup-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.language-popup-buttons .btn {
    flex: 1;
    min-width: 120px;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    text-decoration: none;
    display: inline-block;
}

.language-popup-buttons .btn-primary {
    background: rgba(14,108,255,0.10);
    color: var(--color-primary, #0e6cff);
    border-color: rgba(14,108,255,0.25);
}

.language-popup-buttons .btn-primary:hover {
    background: rgba(14,108,255,0.14);
    border-color: rgba(14,108,255,0.30);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.language-popup-buttons .btn-secondary {
    background: var(--color-surface, #ffffff);
    color: var(--color-text, #1d1d1f);
    border-color: rgba(0,0,0,0.12);
}

.language-popup-buttons .btn-secondary:hover {
    background: rgba(0,0,0,0.03);
    border-color: rgba(0,0,0,0.18);
}

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

[dir="rtl"] .language-popup-header .language-flag {
    margin-left: 12px;
    margin-right: 0;
}

/* Mobile Responsive */
@media (max-width: 640px) {
    .language-popup-content {
        width: 95%;
        margin: 20px;
    }
    
    .language-popup-header {
        padding: 20px 20px 16px;
    }
    
    .language-popup-body {
        padding: 20px;
    }
    
    .language-popup-buttons {
        flex-direction: column;
    }
    
    .language-popup-buttons .btn {
        flex: none;
        width: 100%;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .language-popup {
        background: rgba(0, 0, 0, 0.8);
    }
    
    .language-popup-content {
        border: 2px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .language-popup,
    .language-popup-content {
        transition: none;
    }
    
    .language-popup.show .language-popup-content {
        transform: none;
    }
}

/* Focus styles for accessibility */
.language-popup-close:focus,
.language-option:focus {
    outline: 2px solid var(--focus-ring, rgba(59, 122, 87, 0.55));
    outline-offset: 2px;
}

.language-popup-buttons .btn:focus {
    outline: 2px solid var(--focus-ring, rgba(59, 122, 87, 0.55));
    outline-offset: 2px;
}

/* Animation for language switching - Enhanced smooth transitions */
.language-switching {
    opacity: 0.8;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform: scale(0.98);
}

.language-switching-complete {
    opacity: 1;
    transform: scale(1);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Smooth transitions for all translatable elements */
[data-i18n] {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

[data-i18n-html] {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Smooth content transitions */
.content,
.main-content {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Language change animation wrapper */
.language-change-animation {
    position: relative;
    overflow: hidden;
}

.language-change-animation::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: languageChangeSwipe 0.8s ease-out;
    pointer-events: none;
    z-index: 1;
}

@keyframes languageChangeSwipe {
    0% {
        left: -100%;
    }
    50% {
        left: 0%;
    }
    100% {
        left: 100%;
    }
}

/* Smooth font changes for different languages */
.lang-en,
.lang-el,
.lang-de {
    transition: font-family 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    font-family: var(--font-sans), "Inter", "Noto Sans", "Noto Sans Greek", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}


/* Utility classes for language-specific styling */
.text-ltr {
    direction: ltr;
    text-align: left;
}

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