/* Premium Google Translate UI - 最高レベルの翻訳インターフェース */

/* Container */
.premium-translate-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10001;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Language Selector */
.language-selector-premium {
    position: relative;
}

.language-toggle-btn {
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid rgba(255, 182, 193, 0.3);
    border-radius: 15px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #2d3748;
    backdrop-filter: blur(10px);
    box-shadow: 
        0 4px 20px rgba(255, 182, 193, 0.2),
        0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    min-width: 140px;
    justify-content: space-between;
}

.language-toggle-btn:hover {
    background: rgba(255, 255, 255, 1);
    border-color: rgba(255, 182, 193, 0.5);
    transform: translateY(-2px);
    box-shadow: 
        0 6px 25px rgba(255, 182, 193, 0.3),
        0 4px 15px rgba(0, 0, 0, 0.15);
}

.language-toggle-btn:active {
    transform: translateY(0);
}

.current-flag {
    font-size: 16px;
}

.current-lang {
    flex: 1;
    text-align: left;
}

.dropdown-arrow {
    font-size: 10px;
    transition: transform 0.3s ease;
    color: rgba(255, 182, 193, 0.8);
}

.language-toggle-btn:hover .dropdown-arrow {
    transform: rotate(180deg);
}

/* Dropdown */
.language-dropdown-premium {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 20px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.15),
        0 8px 25px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 182, 193, 0.2);
    min-width: 320px;
    max-height: 500px;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 1000;
}

.language-dropdown-premium.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Search */
.language-search {
    position: relative;
    padding: 20px 20px 16px;
    border-bottom: 1px solid rgba(255, 182, 193, 0.1);
}

.language-search input {
    width: 100%;
    padding: 12px 40px 12px 16px;
    border: 2px solid rgba(255, 182, 193, 0.2);
    border-radius: 12px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
    outline: none;
}

.language-search input:focus {
    border-color: rgba(255, 182, 193, 0.5);
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 0 0 4px rgba(255, 182, 193, 0.1);
}

.search-icon {
    position: absolute;
    right: 32px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: rgba(255, 182, 193, 0.6);
}

/* Language Sections */
.language-sections {
    max-height: 350px;
    overflow-y: auto;
    padding: 16px 20px;
}

.language-sections::-webkit-scrollbar {
    width: 6px;
}

.language-sections::-webkit-scrollbar-track {
    background: rgba(255, 182, 193, 0.1);
    border-radius: 3px;
}

.language-sections::-webkit-scrollbar-thumb {
    background: rgba(255, 182, 193, 0.4);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.language-sections::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 182, 193, 0.6);
}

.language-section {
    margin-bottom: 20px;
}

.language-section:last-child {
    margin-bottom: 0;
}

.language-section h4 {
    margin: 0 0 12px 0;
    font-size: 13px;
    font-weight: 600;
    color: #4a5568;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.language-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 8px;
}

/* Language Options */
.language-option-premium {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 182, 193, 0.2);
    border-radius: 12px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #2d3748;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-align: left;
    outline: none;
}

.language-option-premium:hover {
    background: rgba(255, 182, 193, 0.1);
    border-color: rgba(255, 182, 193, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 182, 193, 0.2);
}

.language-option-premium:active {
    transform: translateY(0);
}

.lang-flag {
    font-size: 16px;
    flex-shrink: 0;
}

.lang-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Footer */
.translate-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 182, 193, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 182, 193, 0.05);
}

.powered-by {
    font-size: 11px;
    color: #718096;
    font-weight: 500;
}

.reset-btn {
    background: linear-gradient(135deg, 
        rgba(255, 182, 193, 0.1) 0%, 
        rgba(255, 192, 203, 0.05) 100%);
    border: 1px solid rgba(255, 182, 193, 0.3);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 500;
    color: #2d3748;
    cursor: pointer;
    transition: all 0.3s ease;
}

.reset-btn:hover {
    background: linear-gradient(135deg, 
        rgba(255, 182, 193, 0.2) 0%, 
        rgba(255, 192, 203, 0.1) 100%);
    border-color: rgba(255, 182, 193, 0.5);
}

/* Translation Status */
.translation-status {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 16px 24px;
    box-shadow: 
        0 8px 30px rgba(255, 182, 193, 0.3),
        0 4px 15px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 182, 193, 0.2);
    z-index: 10002;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.translation-status.active {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.status-content {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    color: #2d3748;
}

.status-icon {
    font-size: 16px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Translation Suggestion */
.translation-suggestion {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.15),
        0 8px 25px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 182, 193, 0.2);
    z-index: 10002;
    max-width: 350px;
    animation: slideInUp 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.suggestion-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.suggestion-text {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #2d3748;
}

.suggestion-icon {
    font-size: 20px;
}

.suggestion-actions {
    display: flex;
    gap: 12px;
}

.suggestion-yes,
.suggestion-no {
    flex: 1;
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    outline: none;
}

.suggestion-yes {
    background: linear-gradient(135deg, 
        rgba(255, 182, 193, 0.9) 0%, 
        rgba(255, 192, 203, 0.8) 100%);
    border: none;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.suggestion-yes:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 182, 193, 0.4);
}

.suggestion-no {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 182, 193, 0.3);
    color: #2d3748;
}

.suggestion-no:hover {
    background: rgba(255, 182, 193, 0.1);
    border-color: rgba(255, 182, 193, 0.5);
}

/* Translation Error */
.translation-error {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(254, 226, 226, 0.98);
    border: 2px solid rgba(248, 113, 113, 0.3);
    border-radius: 15px;
    padding: 16px 20px;
    z-index: 10002;
    animation: slideInDown 0.4s ease-out;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.error-content {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #991b1b;
}

.error-icon {
    font-size: 16px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .premium-translate-container {
        top: 16px;
        right: 16px;
        z-index: 999999;
        position: fixed !important;
    }
    
    .language-toggle-btn {
        padding: 8px 12px;
        font-size: 12px;
        min-width: 100px;
        background: rgba(255, 255, 255, 0.98) !important;
        border: 2px solid rgba(255, 182, 193, 0.8) !important;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2) !important;
    }
    
    .language-dropdown-premium {
        min-width: 300px;
        max-width: calc(100vw - 20px);
        right: 0;
        z-index: 999999;
        position: absolute !important;
        background: rgba(255, 255, 255, 0.98) !important;
        backdrop-filter: blur(20px);
        border: 2px solid rgba(255, 182, 193, 0.5) !important;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2) !important;
    }
    
    .language-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .language-option-premium {
        padding: 12px 10px;
        font-size: 13px;
        background: rgba(255, 255, 255, 0.9) !important;
        border: 1px solid rgba(255, 182, 193, 0.3) !important;
        transition: all 0.2s ease;
    }
    
    .language-option-premium:hover {
        background: rgba(255, 182, 193, 0.2) !important;
        transform: translateY(-1px);
    }
    
    .translation-suggestion {
        left: 10px;
        right: 10px;
        bottom: 20px;
        max-width: none;
        z-index: 999998;
    }
    
    .translation-status {
        left: 10px;
        right: 10px;
        top: 80px;
        transform: translateY(-100px);
        z-index: 999998;
    }
    
    .translation-status.active {
        transform: translateY(0);
    }
    
    /* モバイルメニューとの競合を完全に解消 */
    .mobile-menu-overlay.active ~ * .premium-translate-container {
        z-index: 10 !important;
    }
    
    /* モバイル専用の翻訳ボタンスタイル */
    .language-toggle-btn::before {
        content: '🌐';
        font-size: 16px;
        margin-right: 4px;
    }
    
    /* タッチ対応の改善 */
    .language-option-premium {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* 小さなスマートフォン対応 */
    @media (max-width: 480px) {
        .language-dropdown-premium {
            min-width: 280px;
            max-width: calc(100vw - 16px);
            right: -4px;
        }
        
        .language-grid {
            grid-template-columns: 1fr;
        }
        
        .language-option-premium {
            padding: 14px 12px;
            font-size: 14px;
        }
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .language-toggle-btn {
        background: rgba(51, 65, 85, 0.95);
        color: #e2e8f0;
        border-color: rgba(255, 182, 193, 0.3);
    }
    
    .language-dropdown-premium {
        background: rgba(51, 65, 85, 0.98);
        color: #e2e8f0;
    }
    
    .language-search input {
        background: rgba(30, 41, 59, 0.8);
        color: #e2e8f0;
        border-color: rgba(255, 182, 193, 0.3);
    }
    
    .language-option-premium {
        background: rgba(30, 41, 59, 0.8);
        color: #e2e8f0;
        border-color: rgba(255, 182, 193, 0.2);
    }
    
    .language-option-premium:hover {
        background: rgba(255, 182, 193, 0.1);
    }
    
    .translation-status {
        background: rgba(51, 65, 85, 0.95);
        color: #e2e8f0;
    }
    
    .translation-suggestion {
        background: rgba(51, 65, 85, 0.98);
        color: #e2e8f0;
    }
}

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

body {
    top: 0 !important;
}

/* Enhanced Google Translate integration */
.translation-active {
    position: relative;
}

.translation-active::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, 
        rgba(255, 182, 193, 0.8) 0%, 
        rgba(255, 192, 203, 1) 50%,
        rgba(255, 182, 193, 0.8) 100%);
    z-index: 10003;
    animation: translationProgress 2s ease-in-out infinite;
}

@keyframes translationProgress {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}