/* WP Real Time Translator 樣式 */

.wp-rtt-selector {
    position: fixed;
    z-index: 9999;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

/* 位置變體 */
.wp-rtt-selector.position-top-right {
    top: 20px;
    right: 20px;
}

.wp-rtt-selector.position-top-left {
    top: 20px;
    left: 20px;
}

.wp-rtt-selector.position-bottom-right {
    bottom: 20px;
    right: 20px;
}

.wp-rtt-selector.position-bottom-left {
    bottom: 20px;
    left: 20px;
}

.wp-rtt-selector:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

#wp-rtt-language-select {
    background: transparent;
    border: none;
    outline: none;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    min-width: 120px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

#wp-rtt-language-select:focus {
    background: rgba(0, 123, 255, 0.1);
}

/* 響應式設計 */
@media (max-width: 768px) {
    .wp-rtt-selector {
        top: 10px;
        right: 10px;
        padding: 8px;
    }
    
    #wp-rtt-language-select {
        font-size: 12px;
        min-width: 100px;
    }
}

/* 翻譯載入狀態 */
.wp-rtt-translating {
    opacity: 0.6;
    pointer-events: none;
}

.wp-rtt-translating::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #007bff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: wp-rtt-spin 1s linear infinite;
}

@keyframes wp-rtt-spin {
    to {
        transform: rotate(360deg);
    }
}

/* 翻譯提示 */
.wp-rtt-translation-notice {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #28a745;
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 14px;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.wp-rtt-translation-notice.show {
    opacity: 1;
}

/* 翻譯後的元素樣式 */
.wp-rtt-translated {
    position: relative;
    transition: all 0.3s ease;
}

.wp-rtt-translated:hover {
    background-color: rgba(0, 123, 255, 0.05);
    border-radius: 3px;
}

.wp-rtt-translated:hover::after {
    content: attr(data-rtt-original);
    position: absolute;
    bottom: 100%;
    left: 0;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 10000;
    pointer-events: none;
    opacity: 0;
    animation: wp-rtt-tooltip 0.3s ease forwards;
}

@keyframes wp-rtt-tooltip {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 翻譯載入動畫 */
.wp-rtt-translating-element {
    position: relative;
    opacity: 0.7;
}

.wp-rtt-translating-element::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 123, 255, 0.3), transparent);
    animation: wp-rtt-shimmer 1.5s infinite;
}

@keyframes wp-rtt-shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* 深色主題支持 */
@media (prefers-color-scheme: dark) {
    .wp-rtt-selector {
        background: rgba(30, 30, 30, 0.95);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    #wp-rtt-language-select {
        color: #fff;
    }
    
    #wp-rtt-language-select:focus {
        background: rgba(0, 123, 255, 0.2);
    }
    
    .wp-rtt-translated:hover {
        background-color: rgba(0, 123, 255, 0.1);
    }
}
