/* ─── Reset & Base (scoped to plugin) ─── */
.yld-wrap *, .yld-wrap *::before, .yld-wrap *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.yld-wrap {
    --bg-primary: #0f0f0f;
    --bg-card: #1a1a1a;
    --bg-card-hover: #252525;
    --bg-modal: #1e1e1e;
    --bg-input: #2a2a2a;
    --red: #57B05E;
    --red-glow: rgba(87, 176, 94, 0.35);
    --text-primary: #ffffff;
    --text-secondary: #aaaaaa;
    --text-muted: #666666;
    --border: #333333;
    --radius: 10px;
    --radius-sm: 6px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    padding-bottom: 20px;
}

/* ─── Error Banner ─── */
.yld-wrap .yld-error-banner {
    background: #489E4F;
    color: #fff;
    text-align: center;
    padding: 10px 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* ─── Dashboard Layout ─── */
.yld-wrap .dashboard {
    display: block;
    padding: 12px 24px 0;
    max-width: 900px;
    margin: 0 auto;
}

.yld-wrap .player-section {
    width: 100%;
}

/* ─── Main Player ─── */
.yld-wrap .mute-btn {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.70);
    border: none;
    border-radius: 6px;
    padding: 7px 11px;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
    opacity: 0.85;
    font-family: inherit;
}
.yld-wrap .mute-btn:hover {
    background: rgba(0, 0, 0, 0.90);
    opacity: 1;
}
.yld-wrap .mute-btn:not(.muted) {
    background: rgba(200, 30, 30, 0.80);
}

.yld-wrap .player-wrap {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    background: #000;
    border-radius: var(--radius) var(--radius) 0 0;
    overflow: hidden;
}

.yld-wrap .player-wrap iframe,
.yld-wrap .player-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.yld-wrap .player-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 16px;
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* ─── Player Meta (below video) ─── */
.yld-wrap .player-meta {
    display: flex;
    align-items: flex-start;
    gap: 0;
    margin-top: 0;
    padding: 16px 18px 0;
    background: #ffffff;
    border: none;
    border-radius: 0;
}

.yld-wrap .player-avatar {
    display: none;
}

.yld-wrap .player-meta-text {
    flex: 1;
    min-width: 0;
}

.yld-wrap .player-channel-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.yld-wrap .player-channel-row h2 {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.3;
    color: #1a1a1a;
}

.yld-wrap .player-video-title {
    display: none;
}

.yld-wrap .live-badge {
    background: var(--red);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 3px;
    letter-spacing: 0.5px;
    white-space: nowrap;
    flex-shrink: 0;
    text-transform: uppercase;
    animation: yld-pulse-live 2s infinite;
}

.yld-wrap .viewers-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    color: #555555;
    white-space: nowrap;
    flex-shrink: 0;
}

.yld-wrap .viewers-badge svg {
    display: none;
}

.yld-wrap .viewers-badge::before {
    content: '\25CF';
    color: var(--red);
    font-size: 0.55rem;
    line-height: 1;
}

@keyframes yld-pulse-live {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.yld-wrap .hidden {
    display: none !important;
}

.yld-wrap .description-box {
    background: #ffffff;
    color: #444444;
    padding: 16px 18px 28px;
    border-radius: 0 0 var(--radius) var(--radius);
    margin-top: 0;
    font-size: 0.85rem;
    line-height: 1.55;
    border: none;
    min-height: 80px;
    white-space: pre-line;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

.yld-wrap .description-box p {
    margin: 0;
    white-space: pre-line;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

.yld-wrap .disclaimer {
    text-align: center;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 10px;
    padding: 0 8px;
    line-height: 1.5;
}

/* ─── Carousels Section ─── */
.yld-wrap .carousels-section {
    max-width: 900px;
    margin: 0 auto;
    padding: 10px 24px 40px;
}

/* ─── Section ─── */
.yld-wrap .section-group {
    margin-bottom: 28px;
}

.yld-wrap .section-title {
    font-size: 1.2rem;
    font-weight: 700;
    text-transform: none;
    letter-spacing: -0.2px;
    color: var(--text-primary);
    padding: 0 0 12px;
    border-bottom: none;
    margin-bottom: 0;
    text-align: center;
}

/* ─── Carousel ─── */
.yld-wrap .carousel {
    position: relative;
}

.yld-wrap .carousel-track {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 4px 0;
}

.yld-wrap .carousel-track::-webkit-scrollbar {
    display: none;
}

.yld-wrap .carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(30, 30, 30, 0.85);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.yld-wrap .carousel-arrow:hover {
    background: rgba(50, 50, 50, 0.95);
    border-color: var(--text-muted);
}

.yld-wrap .carousel-arrow-left {
    left: -4px;
}

.yld-wrap .carousel-arrow-right {
    right: -4px;
}

/* ─── Channel Card (vertical, carousel item) ─── */
.yld-wrap .channel-card {
    flex: 0 0 170px;
    scroll-snap-align: start;
    background: transparent;
    border: 2px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    overflow: hidden;
}

.yld-wrap .channel-card:hover {
    border-color: var(--border);
    background: var(--bg-card);
}

.yld-wrap .channel-card.active {
    border-color: var(--red);
    box-shadow: 0 0 12px var(--red-glow);
    background: var(--bg-card);
}

.yld-wrap .card-thumb {
    width: 100%;
    height: 96px;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    overflow: hidden;
    position: relative;
    background: #000;
}

.yld-wrap .card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.yld-wrap .card-thumb .thumb-live {
    position: absolute;
    bottom: 4px;
    left: 4px;
    background: var(--red);
    color: #fff;
    font-size: 0.55rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.yld-wrap .card-info {
    padding: 8px 8px 10px;
}

.yld-wrap .card-name {
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.yld-wrap .card-title {
    font-size: 0.7rem;
    color: var(--text-secondary);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.yld-wrap .card-viewers {
    font-size: 0.65rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-top: 3px;
}

.yld-wrap .card-viewers::before {
    content: '\25CF ';
    color: var(--red);
    font-size: 0.5rem;
    vertical-align: middle;
}

/* ─── Loading Skeleton ─── */
.yld-wrap .skeleton-card {
    flex: 0 0 170px;
    border-radius: var(--radius);
    overflow: hidden;
}

.yld-wrap .skeleton-thumb {
    width: 100%;
    height: 96px;
    background: linear-gradient(90deg, #222 25%, #2a2a2a 50%, #222 75%);
    background-size: 200% 100%;
    animation: yld-shimmer 1.5s infinite;
}

.yld-wrap .skeleton-lines {
    padding: 8px;
}

.yld-wrap .skeleton-line {
    height: 10px;
    background: linear-gradient(90deg, #222 25%, #2a2a2a 50%, #222 75%);
    background-size: 200% 100%;
    animation: yld-shimmer 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 8px;
}

.yld-wrap .skeleton-line:last-child {
    width: 60%;
    margin-bottom: 0;
}

@keyframes yld-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ─── Responsive ─── */
@media (max-width: 900px) {
    .yld-wrap .dashboard {
        padding: 16px;
    }

    .yld-wrap .description-box {
        padding: 14px 16px 22px;
    }
}

@media (max-width: 640px) {
    .yld-wrap .dashboard {
        padding: 12px 16px 0;
    }

    .yld-wrap .carousels-section {
        padding: 10px 16px 30px;
    }

    .yld-wrap .player-channel-row h2 {
        font-size: 0.95rem;
    }

    .yld-wrap .description-box {
        padding: 12px 14px 20px;
        font-size: 0.8rem;
        min-height: 60px;
    }

    .yld-wrap .channel-card {
        flex: 0 0 150px;
    }

    .yld-wrap .card-thumb {
        height: 84px;
    }

    .yld-wrap .carousel-arrow {
        width: 30px;
        height: 30px;
        font-size: 1.1rem;
    }

    .yld-wrap .modal {
        max-height: 95vh;
    }

    .yld-wrap .section-title {
        font-size: 1.05rem;
    }
}
