/* Main Container */
.lyrics-player {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 3rem 0;
    font-family: 'Noto Serif KR', serif;
}

/* Video Wrapper */
.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Controls (Dropdown) */
.lyrics-controls {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 0.5rem;
    /* Tight spacing */
    position: relative;
    background-color: #f7f7f7;
    border-radius: 8px;
    padding: 0.5rem 0.8rem;
    width: 100%;
    box-sizing: border-box;
}

.view-dropdown {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    position: relative;
}

.settings-label {
    font-weight: 700;
    font-size: 0.85rem;
    color: #333;
    font-family: 'Noto Serif KR', serif;
}

.lyrics-dd-trigger {
    display: inline-flex;
    align-items: center;
    background: transparent;
    border: none;
    font-size: 0.85rem;
    color: #555;
    font-family: 'Noto Serif KR', serif;
    cursor: pointer;
    padding: 0;
}

.lyrics-dd-trigger:focus,
.lyrics-dd-trigger:active {
    background: transparent !important;
    outline: none;
}

.lyrics-dd-trigger:hover {
    color: #333;
    background: transparent !important;
}

.current-label {
    font-weight: 400;
    /* Regular */
    margin-right: 6px;
}

.arrow-icon {
    stroke: currentColor;
    width: 14px;
    height: 14px;
}

.lyrics-dd-menu {
    display: none;
    position: absolute;
    right: 0;
    left: auto;
    top: 100%;
    margin-top: 8px;
    background: #fff;
    min-width: 140px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 0.5rem 0;
    z-index: 100;
    border: 1px solid #eee;
}

.lyrics-dd-menu.show {
    padding: 4px;
    display: block;
}

.lyrics-dd-item {
    display: block;
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    padding: 0.8rem 1.2rem;
    font-size: 0.9rem;
    color: #555;
    font-family: 'Noto Serif KR', serif;
    cursor: pointer;
    transition: background 0.2s;
}

.lyrics-dd-item:hover {
    background: #f7f7f7 !important;
    color: #000;
}

/* Lyrics Display Area */
.lyrics-display {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0;
    padding-bottom: 3rem;
    position: relative;
    border-radius: 8px;
    z-index: 0;
    border: none !important;
    box-shadow: none !important;
}

/* Master Timeline Line (Background Pattern) */
.lyrics-display::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 1.57rem;
    bottom: 4.5rem;
    width: 2px;
    background: radial-gradient(circle, #ddd 0.75px, transparent 0.75px) repeat-y;
    background-size: 2px 4px;
    z-index: 5;
    /* Layer 2: Middle (Above Highlight) */
}

/* Lyric Line (Row) */
.lyric-line {
    display: flex;
    position: relative;
    padding: 1.5rem 0;
    padding-right: 0.5rem;
    border-radius: 8px;
    background-color: transparent;
    z-index: auto;
    /* Allow children to interleave */
    border: none !important;
    box-shadow: none !important;
}

/* Highlight Overlay */
.lyric-line::before {
    content: '';
    position: absolute;
    inset: 0;
    background-color: transparent;
    transition: background-color 0.2s ease;
    z-index: 1;
    /* Layer 1: Bottom (Below Line) */
    pointer-events: none;
    border-radius: 8px;
}

.lyric-line:hover::before {
    background-color: #fafafa;
}

.lyric-line.active::before {
    background-color: #f7f7f7;
    /* Animation removed */
}

/* Timeline Column */
.timeline-col {
    flex: 0 0 24px;
    position: relative;
    display: flex;
    justify-content: center;
    z-index: 10;
    /* Layer 3: Top */
}

/* Mask for Last Block (Hide tail) */
.lyric-line:last-child .timeline-col::after {
    content: '';
    position: absolute;
    top: 0.67rem;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 100%;
    background: #fff;
    z-index: 6;
    /* Just above Line (z=5) */
    transition: background-color 0.2s ease;
}

.lyric-line:hover:last-child .timeline-col::after {
    background-color: #fafafa;
}

.lyric-line.active:last-child .timeline-col::after {
    background-color: #f7f7f7;
}

/* Timeline Dot */
.timeline-dot {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 0.2rem;
    width: 8px;
    height: 8px;
    background-color: #ff5252;
    opacity: 0.3;
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(255, 82, 82, 0.1);
    border: none;
    transition: all 0.3s ease;
    z-index: 11;
    /* Top of top */
}

/* Active State */
.lyric-line.active .timeline-dot {
    opacity: 1;
    width: 8px;
    height: 8px;
    margin-top: 0;
    box-shadow: 0 0 0 4px rgba(255, 82, 82, 0.2);
    animation: pulse-dot 2s infinite;
    top: 0.2rem;
}

@keyframes pulse-dot {
    0% {
        box-shadow: 0 0 0 0px rgba(255, 82, 82, 0.4);
    }

    70% {
        box-shadow: 0 0 0 8px rgba(255, 82, 82, 0);
    }

    100% {
        box-shadow: 0 0 0 0px rgba(255, 82, 82, 0);
    }
}

/* Content Column */
.content-col {
    flex: 1;
    padding-left: 0.5rem;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 10;
    /* Layer 3: Top */
}

/* Timestamp Button */
.timestamp-btn {
    display: inline-block;
    align-self: flex-start;
    border: none;
    background: transparent;
    color: rgba(255, 82, 82, 0.5);
    /* Inactive: Red with opacity */
    font-size: 0.8rem;
    font-family: 'Noto Serif KR', serif;
    font-weight: 600;
    padding: 0;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
    text-decoration: underline;
    /* Always underlined as requested */
}

.timestamp-btn:focus,
.timestamp-btn:active {
    background: transparent !important;
    outline: none;
    box-shadow: none;
}

.timestamp-btn:hover {
    color: #ff5252;
    background: transparent !important;
    /* Hover: Solid Red */
}

.lyric-line.active .timestamp-btn {
    color: #ff5252;
    /* Active Block: Solid Red (Opacity 1) */
}

/* Typography */
.text-wrapper p {
    margin: 0;
    line-height: 1.8;
    color: #333;
    font-size: 1rem;
    word-break: keep-all;
    text-align: left;
}

.text-wrapper .original {
    font-weight: 700;
    font-family: 'Noto Serif KR', serif;
    margin-bottom: 0.5rem;
}

.text-wrapper .translated {
    font-weight: 400;
    font-family: 'Noto Serif KR', serif;
    color: #666;
}

/* View Mode Logic */
[data-view-mode="original"] .translated {
    display: none;
}

[data-view-mode="translated"] .original {
    display: none;
}

/* Footnotes */
.footnote-mark {
    color: #ff5252;
    font-size: 0.7em;
    vertical-align: super;
    margin-left: 2px;
}

.text-wrapper .notes {
    font-size: 0.85rem;
    color: #999;
    margin-top: 0.8rem;
    font-family: 'Noto Serif KR', serif;
    line-height: 1.6;
}