
/**
 * Language-specific responsive CSS
 * Handles different text lengths for Korean, Vietnamese, and English
 */

/* Korean language adjustments */
html[lang="ko"] .brand-name {
    font-size: 20px;
    letter-spacing: -0.3px;
}

html[lang="ko"] .card-name {
    font-size: 24px;
    letter-spacing: -0.5px;
}

html[lang="ko"] .modal-title {
    font-size: 22px;
    line-height: 1.3;
}

html[lang="ko"] .notification {
    font-size: 14px;
    max-width: 350px;
}

html[lang="ko"] .btn-tooltip {
    font-size: 11px;
    white-space: nowrap;
}

html[lang="ko"] .quick-action-btn {
    font-size: 12px;
    padding: 10px 14px;
}

html[lang="ko"] .language-option .name {
    font-size: 13px;
}

/* English language adjustments */
html[lang="en"] .brand-name {
    font-size: 22px;
    letter-spacing: 0;
}

html[lang="en"] .card-name {
    font-size: 26px;
    letter-spacing: 0;
}

html[lang="en"] .modal-title {
    font-size: 22px;
    line-height: 1.4;
}

html[lang="en"] .notification {
    font-size: 14px;
    max-width: 400px;
}

html[lang="en"] .btn-tooltip {
    font-size: 11px;
    white-space: nowrap;
}

html[lang="en"] .quick-action-btn {
    font-size: 13px;
    padding: 10px 16px;
}

/* Vietnamese language adjustments */
html[lang="vi"] .brand-name {
    font-size: 21px;
    letter-spacing: -0.2px;
}

html[lang="vi"] .card-name {
    font-size: 25px;
    letter-spacing: -0.4px;
}

html[lang="vi"] .modal-title {
    font-size: 21px;
    line-height: 1.3;
}

html[lang="vi"] .notification {
    font-size: 14px;
    max-width: 380px;
}

html[lang="vi"] .btn-tooltip {
    font-size: 11px;
    white-space: nowrap;
}

html[lang="vi"] .quick-action-btn {
    font-size: 12px;
    padding: 10px 14px;
}

html[lang="vi"] .detail-item {
    font-size: 12px;
}

html[lang="vi"] .card-bio {
    font-size: 14px;
    line-height: 1.4;
}

/* Language Switcher Styles */
.language-switcher-container {
    position: fixed;
    top: 60px;
    right: 15px;
    z-index: 999;
    display: inline-block;
}

.language-switcher {
    position: relative;
}

.language-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    min-width: 120px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.language-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.language-btn .flag {
    font-size: 16px;
}

.language-btn .lang-name {
    font-weight: 500;
    flex: 1;
    text-align: left;
}

.language-btn i {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.language-btn.active i {
    transform: rotate(180deg);
}

.language-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 160px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

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

.language-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    color: #333;
    text-decoration: none;
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.language-option:hover {
    background-color: #f8f9fa;
    text-decoration: none;
    color: #333;
}

.language-option.active {
    background-color: #007bff;
    color: white;
}

.language-option.active:hover {
    background-color: #0056b3;
    color: white;
}

.language-option .flag {
    font-size: 18px;
}

.language-option .name {
    font-weight: 500;
}

/* Toast Notifications */
.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 15px;
    z-index: 9999;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    min-width: 250px;
}

.toast-notification.show {
    transform: translateX(0);
}

.toast-notification.toast-success {
    border-left: 4px solid #28a745;
}

.toast-notification.toast-error {
    border-left: 4px solid #dc3545;
}

.toast-notification.toast-info {
    border-left: 4px solid #17a2b8;
}

.toast-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.toast-message {
    font-weight: 500;
    color: #333;
}

.toast-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #666;
    margin-left: 10px;
}

.toast-close:hover {
    color: #333;
}

/* Language switcher responsive */
@media (max-width: 768px) {
    .language-switcher-container {
        top: 70px;
        right: 10px;
    }
    
    .language-btn {
        padding: 6px 10px;
        font-size: 13px;
        min-width: 100px;
    }
    
    .language-menu {
        min-width: 140px;
    }
    
    html[lang="ko"] .language-menu {
        min-width: 130px;
    }
    
    html[lang="vi"] .language-menu {
        min-width: 140px;
    }
    
    html[lang="ko"] .brand-name,
    html[lang="vi"] .brand-name {
        font-size: 18px;
    }
    
    html[lang="ko"] .card-name,
    html[lang="vi"] .card-name {
        font-size: 20px;
    }
    
    html[lang="ko"] .modal-title,
    html[lang="vi"] .modal-title {
        font-size: 20px;
    }
}

@media (max-width: 410px) {
    html[lang="ko"] .brand-name,
    html[lang="vi"] .brand-name {
        font-size: 16px;
    }
    
    html[lang="ko"] .brand-location,
    html[lang="vi"] .brand-location {
        font-size: 10px;
    }
    
    html[lang="ko"] .notification,
    html[lang="vi"] .notification {
        font-size: 13px;
        max-width: 85%;
    }
    
    html[lang="ko"] .quick-action-btn,
    html[lang="vi"] .quick-action-btn {
        font-size: 11px;
        padding: 8px 12px;
        min-width: 100px;
    }
}

/* Text overflow handling for long translations */
.truncate-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

html[lang="ko"] .card-bio,
html[lang="vi"] .card-bio {
    -webkit-line-clamp: 3;
    max-height: 65px;
}

/* Font loading for Korean characters */
@font-face {
    font-family: 'Noto Sans KR';
    font-style: normal;
    font-weight: 400;
    src: url('https://fonts.gstatic.com/s/notosanskr/v27/PbyxFmXiEBPT4ITbgNA5Cgms3VYcOA-vvnIzzuoyeLTq8H4hfeE.woff2') format('woff2');
    unicode-range: U+AC00-D7AF, U+1100-11FF, U+3130-318F, U+A960-A97F, U+D7B0-D7FF;
}

html[lang="ko"] body {
    font-family: 'Noto Sans KR', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Vietnamese diacritics support */
html[lang="vi"] body {
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    text-rendering: optimizeLegibility;
}

/* Language direction support (future: RTL languages) */
html[dir="rtl"] .language-menu {
    left: 0;
    right: auto;
}

html[dir="rtl"] .language-switcher {
    margin-left: 12px;
    margin-right: 0;
}

/* Smooth transitions for language changes */
.lang-transition {
    transition: all 0.3s ease;
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
