/* ============================================
   Chinese Character Tooltip Styles
   ============================================ */
.cn-tooltip {
    position: absolute;
    z-index: 9990;
    background: rgba(20, 26, 40, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(167, 139, 250, 0.3);
    border-radius: 12px;
    padding: 12px 16px;
    pointer-events: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 15px rgba(167, 139, 250, 0.1) inset;
    font-size: 14px;
    line-height: 1.5;
    max-width: calc(100vw - 24px);
    min-width: 160px;
    word-break: break-word;
    opacity: 1;
    transform: translateX(-50%) scale(1);
    transform-origin: top center;
    transition: opacity 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275),
                transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cn-tooltip--hidden { 
    opacity: 0; 
    transform: translateX(-50%) scale(0.95);
    pointer-events: none; 
}

.cn-tooltip__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 6px;
}

.cn-tooltip__chars {
    color: var(--text-primary, #ffffff);
    font-size: 24px;
    font-weight: 700;
    font-family: var(--font-cn, 'Noto Sans SC', sans-serif);
    letter-spacing: 2px;
}

.cn-tooltip__audio {
    background: rgba(167, 139, 250, 0.15);
    border: 1px solid rgba(167, 139, 250, 0.3);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--color-primary, #a78bfa);
    transition: all 0.2s ease;
}

.cn-tooltip__audio:hover {
    background: rgba(167, 139, 250, 0.3);
    transform: scale(1.05);
}

.cn-tooltip__audio svg {
    width: 16px;
    height: 16px;
}

.cn-tooltip__pinyin {
    font-family: var(--font-en, 'Inter', sans-serif);
    font-weight: 500;
    font-size: 15px;
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}

.cn-tooltip__pinyin span {
    display: inline-block;
    margin-right: 4px;
    background: transparent;
}

.cn-tooltip__pinyin .cn-tooltip__tone-1 { color: #ff6b6b; } /* Red */
.cn-tooltip__pinyin .cn-tooltip__tone-2 { color: #feca57; } /* Yellow/Orange */
.cn-tooltip__pinyin .cn-tooltip__tone-3 { color: #1dd1a1; } /* Green */
.cn-tooltip__pinyin .cn-tooltip__tone-4 { color: #54a0ff; } /* Blue */
.cn-tooltip__pinyin .cn-tooltip__tone-5 { color: #c8d6e5; } /* Neutral/Gray */

.cn-tooltip__meaning {
    color: var(--text-secondary, #94a3b8);
    font-size: 13.5px;
    line-height: 1.4;
}

.cn-tooltip__segments {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 250px;
    overflow-y: auto;
    padding-right: 4px; /* for scrollbar */
}

/* Custom scrollbar for segments */
.cn-tooltip__segments::-webkit-scrollbar {
    width: 4px;
}
.cn-tooltip__segments::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}
.cn-tooltip__segments::-webkit-scrollbar-thumb {
    background: rgba(167, 139, 250, 0.4);
    border-radius: 4px;
}

.cn-tooltip__segment {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 6px 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
}

.cn-tooltip__segment:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.cn-tooltip__segment-chars {
    font-family: var(--font-cn, 'Noto Sans SC', sans-serif);
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary, #ffffff);
    min-width: 40px;
    flex-shrink: 0;
}

.cn-tooltip__segment-details {
    display: flex;
    flex-direction: column;
}

.cn-tooltip__segment-pinyin {
    font-family: var(--font-en, 'Inter', sans-serif);
    font-weight: 500;
    font-size: 13px;
    margin-bottom: 2px;
}

.cn-tooltip__segment-pinyin span {
    display: inline-block;
    margin-right: 2px;
    background: transparent;
}

.cn-tooltip__segment-pinyin .cn-tooltip__tone-1 { color: #ff6b6b; }
.cn-tooltip__segment-pinyin .cn-tooltip__tone-2 { color: #feca57; }
.cn-tooltip__segment-pinyin .cn-tooltip__tone-3 { color: #1dd1a1; }
.cn-tooltip__segment-pinyin .cn-tooltip__tone-4 { color: #54a0ff; }
.cn-tooltip__segment-pinyin .cn-tooltip__tone-5 { color: #c8d6e5; }

.cn-tooltip__segment-meaning {
    color: var(--text-secondary, #94a3b8);
    font-size: 12px;
    line-height: 1.3;
}
