/**
 * YITP Translation System Styles
 * Maintains YITP branding while providing clean translation UI
 */

/* Simplified Language Button Styles */
.header__language {
    display: flex;
    align-items: center;
    margin-left: 10px;
}

.yitp-translate-btn {
    color: #1a2e53 !important;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    text-decoration: none;
    border: none;
    background: none;
    cursor: pointer;
}

.yitp-translate-btn:hover {
    background-color: rgba(255, 93, 21, 0.1) !important;
    color: #ff5d15 !important;
}

.yitp-translate-btn:focus {
    box-shadow: 0 0 0 2px rgba(255, 93, 21, 0.25);
    outline: none;
}

/* Language Dropdown Menu */
.yitp-language-menu {
    min-width: 200px;
    border: 1px solid rgba(26, 46, 83, 0.1);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 8px 0;
    margin-top: 8px;
}

.yitp-language-menu .dropdown-item {
    padding: 10px 16px;
    color: #1a2e53;
    font-weight: 500;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
    border: none;
    background: none;
}

.yitp-language-menu .dropdown-item:hover {
    background-color: rgba(255, 93, 21, 0.1);
    color: #ff5d15;
}

.yitp-language-menu .dropdown-item:active {
    background-color: rgba(255, 93, 21, 0.2);
    color: #ff5d15;
}

/* Language Option Elements */
.language-flag {
    font-size: 18px;
    margin-right: 10px;
    width: 24px;
    text-align: center;
}

.language-name {
    flex: 1;
    font-size: 14px;
}

/* Current Language Indicator */
#currentLanguageFlag {
    font-size: 16px;
    margin-right: 5px;
}

#currentLanguageName {
    font-size: 14px;
    margin-left: 2px;
}

/* Mobile Language Selector Styles */
.mobile__language {
    border-bottom: 1px solid rgba(26, 46, 83, 0.1);
    padding-bottom: 20px;
}

.mobile__menu-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.mobile__language-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.mobile__language-option {
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.mobile__language-option:hover .language__item {
    background-color: rgba(255, 93, 21, 0.1);
}

.mobile__language-option.active .language__item {
    background-color: rgba(255, 93, 21, 0.15);
    border: 1px solid rgba(255, 93, 21, 0.3);
}

.mobile__language-option .language__item {
    padding: 12px;
    border: 1px solid transparent;
    border-radius: 6px;
    display: flex;
    align-items: center;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .yitp-language-selector {
        margin-left: 5px;
    }

    .yitp-language-selector .dropdown-toggle {
        padding: 6px 8px;
    }

    .yitp-language-menu {
        min-width: 180px;
        right: 0;
        left: auto;
    }

    .language-name {
        font-size: 13px;
    }

    #currentLanguageName {
        display: none !important;
    }
}

@media (max-width: 576px) {
    .yitp-language-menu {
        min-width: 160px;
    }
    
    .yitp-language-menu .dropdown-item {
        padding: 8px 12px;
    }
    
    .language-flag {
        font-size: 16px;
        margin-right: 8px;
        width: 20px;
    }
}

/* Google Translate Widget Styling */
#google_translate_element {
    border: 1px solid rgba(26, 46, 83, 0.1);
    border-radius: 8px;
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#google_translate_element .goog-te-gadget {
    font-family: inherit;
    font-size: 14px;
}

#google_translate_element .goog-te-gadget-simple {
    background-color: transparent;
    border: none;
    font-size: 14px;
    display: inline-block;
    padding: 0;
    margin: 0;
}

/* Hide Google Translate banner */
.goog-te-banner-frame {
    display: none !important;
}

/* Style the language selector in the widget */
.goog-te-combo {
    margin: 5px 0;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* Ensure translated content maintains YITP styling */
body.translated {
    font-family: inherit !important;
}

.translated .navbar-brand,
.translated .btn,
.translated .card,
.translated .form-control {
    font-family: inherit !important;
}

/* Loading State */
.yitp-language-selector.loading .nav-link {
    opacity: 0.6;
    pointer-events: none;
}

.yitp-language-selector.loading .nav-link::after {
    content: '';
    width: 12px;
    height: 12px;
    border: 2px solid #ff5d15;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

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

/* Translation Status Indicator */
.translation-status {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 93, 21, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    z-index: 9999;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
}

.translation-status.show {
    opacity: 1;
    transform: translateY(0);
}

/* Accessibility Improvements */
.yitp-language-selector [role="button"] {
    cursor: pointer;
}

.yitp-language-selector .dropdown-item:focus {
    outline: 2px solid #ff5d15;
    outline-offset: -2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .yitp-language-selector .nav-link {
        border: 1px solid #1a2e53;
    }
    
    .yitp-language-menu {
        border: 2px solid #1a2e53;
    }
    
    .yitp-language-menu .dropdown-item:hover {
        background-color: #ff5d15;
        color: white;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .yitp-language-selector .nav-link,
    .yitp-language-menu .dropdown-item,
    .translation-status {
        transition: none;
    }
    
    .yitp-language-selector.loading .nav-link::after {
        animation: none;
    }
}

/* Print Styles */
@media print {
    .yitp-language-selector {
        display: none !important;
    }
    
    .translation-status {
        display: none !important;
    }
}
