/* Multilingual System Styles */

/* Language Switcher */
.language-switcher {
    position: static;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #71717a;
}

.lang-btn {
    display: inline-flex;
    align-items: center;
    padding: 4px 2px;
    background: transparent;
    border: 0;
    border-radius: 0;
    color: #a1a1aa;
    text-decoration: none;
    font-weight: 700;
    font-size: 12px;
    transition: all 0.3s ease;
}

.lang-btn:hover {
    background: transparent;
    color: #0cd4ff;
    transform: none;
    box-shadow: none;
}

.lang-btn.active { color: #0cd4ff; }

/* Current Language Indicator */
.current-language-indicator {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.lang-text {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
}

.lang-switch-btn {
    padding: 4px 12px;
    background: rgba(0, 212, 255, 0.2);
    border: 1px solid rgba(0, 212, 255, 0.4);
    border-radius: 15px;
    color: #0cd4ff;
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.lang-switch-btn:hover {
    background: rgba(0, 212, 255, 0.3);
    border-color: #0cd4ff;
    color: white;
}

/* Language Suggestion Modal */
.lang-suggestion-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.lang-suggestion-modal.show {
    opacity: 1;
    visibility: visible;
}

.lang-suggestion-content {
    background: white;
    padding: 40px;
    border-radius: 16px;
    max-width: 400px;
    text-align: center;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.lang-suggestion-modal.show .lang-suggestion-content {
    transform: scale(1);
}

.lang-suggestion-content h3 {
    color: #0c1445;
    margin-bottom: 16px;
    font-size: 1.5rem;
}

.lang-suggestion-content p {
    color: #666;
    margin-bottom: 24px;
    line-height: 1.5;
}

.lang-suggestion-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 16px;
}

.lang-suggestion-actions .button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lang-suggestion-actions .button-primary {
    background: #0cd4ff;
    color: white;
}

.lang-suggestion-actions .button-primary:hover {
    background: #0ab3e6;
    transform: translateY(-1px);
}

.lang-suggestion-actions .button {
    background: #f0f0f0;
    color: #333;
}

.lang-suggestion-actions .button:hover {
    background: #e0e0e0;
}

.dismiss-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    transition: color 0.3s ease;
}

.dismiss-btn:hover {
    color: #333;
}

/* Language Preference Notice */
.lang-notice {
    position: fixed;
    top: 80px;
    right: 20px;
    background: white;
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-width: 300px;
    z-index: 1000;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.lang-notice.show {
    opacity: 1;
    transform: translateX(0);
}

.lang-notice p {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #333;
}

.switch-link {
    color: #0cd4ff;
    text-decoration: none;
    font-weight: 600;
}

.switch-link:hover {
    text-decoration: underline;
}

.dismiss-notice {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    font-size: 16px;
    color: #999;
    cursor: pointer;
}

/* Loading Overlay */
.lang-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.lang-loading-spinner {
    text-align: center;
    color: white;
}

.lang-loading-spinner .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #0cd4ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

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

/* Fade Effects */
.fade-out {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.language-switching {
    pointer-events: none;
}

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

.translation-modal.show {
    opacity: 1;
    visibility: visible;
}

.translation-modal-content {
    background: white;
    padding: 40px;
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.translation-modal.show .translation-modal-content {
    transform: scale(1);
}

.translation-modal-content h2 {
    color: #0c1445;
    margin-bottom: 24px;
    text-align: center;
}

.translation-progress-container {
    margin-bottom: 24px;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, #0cd4ff, #0ab3e6);
    border-radius: 10px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    text-align: center;
    font-weight: 600;
    color: #333;
}

.translation-log {
    margin-bottom: 24px;
}

.translation-log h3 {
    color: #333;
    margin-bottom: 12px;
}

.log-content {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
    background: #f9f9f9;
}

.log-entry {
    padding: 4px 0;
    font-size: 13px;
    border-bottom: 1px solid #e0e0e0;
}

.log-entry:last-child {
    border-bottom: none;
}

.log-entry.success {
    color: #28a745;
}

.log-entry.error {
    color: #dc3545;
}

.log-time {
    color: #666;
    font-size: 11px;
}

/* API Key Validation */
.api-key-loading {
    color: #666;
    font-style: italic;
    margin-left: 8px;
}

.api-key-valid {
    color: #28a745;
    font-weight: 600;
    margin-left: 8px;
}

.api-key-invalid {
    color: #dc3545;
    font-weight: 600;
    margin-left: 8px;
}

/* Translation Preview */
.translation-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.translation-preview-modal.show {
    opacity: 1;
    visibility: visible;
}

.translation-preview-content {
    background: white;
    padding: 40px;
    border-radius: 16px;
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.translation-preview-modal.show .translation-preview-content {
    transform: scale(1);
}

.translation-preview-content h2 {
    color: #0c1445;
    margin-bottom: 24px;
    text-align: center;
}

.preview-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.preview-original,
.preview-translated {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
}

.preview-original h3,
.preview-translated h3 {
    color: #333;
    margin-bottom: 16px;
    font-size: 1.1rem;
}

.preview-content h4 {
    color: #0c1445;
    margin-bottom: 12px;
}

.preview-excerpt {
    color: #666;
    line-height: 1.5;
    font-size: 14px;
}

.preview-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* Button States */
.button-success {
    background: #28a745 !important;
    color: white !important;
}

.button-error {
    background: #dc3545 !important;
    color: white !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .language-switcher {
        top: 10px;
        right: 10px;
    }
    
    .lang-btn {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .lang-suggestion-content {
        padding: 24px;
        margin: 20px;
    }
    
    .lang-suggestion-actions {
        flex-direction: column;
    }
    
    .lang-notice {
        right: 10px;
        max-width: 280px;
    }
    
    .preview-comparison {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .translation-modal-content,
    .translation-preview-content {
        padding: 24px;
        margin: 20px;
    }
    
    .preview-actions {
        flex-direction: column;
    }
}

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

[dir="rtl"] .current-language-indicator {
    flex-direction: row-reverse;
}

[dir="rtl"] .lang-notice {
    right: auto;
    left: 20px;
    transform: translateX(-100%);
}

[dir="rtl"] .lang-notice.show {
    transform: translateX(0);
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .lang-btn {
        background: white;
        border-color: #000;
        color: #000;
    }
    
    .lang-btn:hover {
        background: #000;
        color: white;
    }
}
