/* YouTube Chat Card Styles */

.yt-card {
    background: rgba(15, 23, 42, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 10px;
    margin: 6px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    max-width: 100%;
}

.yt-card-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 4px;
}

.yt-card-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #f8fafc;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.yt-card-by {
    font-size: 0.7rem;
    color: rgba(148, 163, 184, 0.7);
    white-space: nowrap;
}

.yt-card-body {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 60px;
}

/* Make iframe visible but small to comply with YouTube TOS */
.yt-player-container {
    width: 96px;
    height: 54px; /* 16:9 ratio */
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #000;
    flex-shrink: 0;
    pointer-events: none; /* Disable clicking/interactions on the YouTube iframe itself */
}

.yt-player-container iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

/* Simulated Audio Waveform */
.yt-waveform-container {
    flex: 1;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    padding: 0 8px;
}

.yt-waveform {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 36px;
    gap: 2px;
}

.yt-waveform-bar {
    width: 3px;
    height: 15px; /* Default/min height */
    background: rgba(148, 163, 184, 0.25);
    border-radius: 1.5px;
    transform-origin: center;
    transition: background-color 0.3s, transform 0.2s;
}

/* Dynamic bouncy waveform animation */
@keyframes yt-bounce {
    0%, 100% {
        transform: scaleY(0.2);
    }
    50% {
        transform: scaleY(1.2);
    }
}

.yt-waveform.playing .yt-waveform-bar {
    animation: yt-bounce 1s ease-in-out infinite;
    background: var(--primary, #6366f1);
}

.yt-card-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: space-between;
    padding-top: 4px;
}

.yt-play-btn {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    flex-shrink: 0;
}

.yt-play-btn:hover {
    background: rgba(99, 102, 241, 0.3);
    border-color: rgba(99, 102, 241, 0.5);
    color: white;
    transform: scale(1.05);
}

.yt-play-btn svg {
    width: 12px;
    height: 12px;
    fill: currentColor;
}

/* Timeline input range slider */
.yt-timeline-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: monospace;
    font-size: 0.7rem;
    color: rgba(148, 163, 184, 0.8);
}

.yt-timeline {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.yt-timeline::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #818cf8;
    cursor: pointer;
    transition: transform 0.1s ease;
}

.yt-timeline:not(:disabled)::-webkit-slider-thumb:hover {
    transform: scale(1.3);
    background: #a5b4fc;
}

.yt-timeline:disabled {
    cursor: default;
    opacity: 0.7;
}

/* Local Volume control */
.yt-volume-control {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 85px;
    flex-shrink: 0;
}

.yt-volume-btn {
    background: transparent;
    border: none;
    color: rgba(148, 163, 184, 0.8);
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.yt-volume-btn:hover {
    color: white;
}

.yt-volume-btn svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.yt-volume-slider {
    width: 60px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.yt-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
}

.yt-volume-slider::-webkit-slider-thumb:hover {
    background: #e2e8f0;
}

.yt-time-display {
    min-width: 32px;
    text-align: center;
}
