/* ==========================================================================
   EVD YouTube Channels - Estilos de frontend
   ========================================================================== */

:root {
    --evd-red: #e2231a;
    --evd-dark: #2b2b2b;
    --evd-gray: #6b6b6b;
    --evd-light-bg: #f7f7f8;
    --evd-border: #e6e6e6;
}

.evd-yt-wrapper * {
    box-sizing: border-box;
}

.evd-yt-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
}

/* ---------------------------------- Pestañas ---------------------------------- */

.evd-yt-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    border-bottom: 1px solid var(--evd-border);
    margin-bottom: 24px;
}

.evd-yt-tab-btn {
    position: relative;
    background: none;
    border: none;
    padding: 14px 22px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    border-radius: 8px 8px 0 0;
    opacity: 0.55;
    transition: opacity 0.25s ease, color 0.25s ease, border-color 0.25s ease,
        background-color 0.25s ease, text-shadow 0.25s ease;
}

/* Pestañas impares (1ra, 3ra...): tono oscuro de la marca */
.evd-yt-tab-btn:nth-child(odd) {
    color: var(--evd-dark);
}

.evd-yt-tab-btn:nth-child(odd):not(.is-active) {
    text-shadow: 0 0 12px rgba(43, 43, 43, 0.35);
}

.evd-yt-tab-btn:nth-child(odd):hover,
.evd-yt-tab-btn:nth-child(odd).is-active {
    background-color: rgba(43, 43, 43, 0.06);
    border-bottom-color: var(--evd-dark);
}

/* Pestañas pares (2da, 4ta...): rojo de la marca */
.evd-yt-tab-btn:nth-child(even) {
    color: var(--evd-red);
}

.evd-yt-tab-btn:nth-child(even):not(.is-active) {
    text-shadow: 0 0 12px rgba(226, 35, 26, 0.35);
}

.evd-yt-tab-btn:nth-child(even):hover,
.evd-yt-tab-btn:nth-child(even).is-active {
    background-color: rgba(226, 35, 26, 0.06);
    border-bottom-color: var(--evd-red);
}

.evd-yt-tab-btn.is-active,
.evd-yt-tab-btn:hover {
    opacity: 1;
}

/* ---------------------------------- Paneles ---------------------------------- */

.evd-yt-panel {
    display: none;
}

.evd-yt-panel.is-active {
    display: block;
    animation: evd-yt-fade-in 0.25s ease;
}

@keyframes evd-yt-fade-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.evd-yt-panel-title {
    font-size: 26px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--evd-dark);
    margin: 0 0 20px;
    letter-spacing: 0.02em;
}

/* ---------------------------------- Cuadrícula ---------------------------------- */

.evd-yt-grid {
    display: grid;
    grid-template-columns: repeat(var(--evd-columns, 3), 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

@media (max-width: 900px) {
    .evd-yt-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .evd-yt-grid {
        grid-template-columns: 1fr;
    }
}

/* ---------------------------------- Tarjeta de video ---------------------------------- */

.evd-yt-card {
    background: #fff;
    border: 1px solid var(--evd-border);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.evd-yt-card:hover {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.evd-yt-thumb {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    margin: 0;
    border: none;
    background: #000;
    cursor: pointer;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.evd-yt-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.evd-yt-thumb:hover img {
    transform: scale(1.04);
}

.evd-yt-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.evd-yt-thumb:hover .evd-yt-play-icon {
    background: var(--evd-red);
}

.evd-yt-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    line-height: 1.4;
}

.evd-yt-card-body {
    padding: 14px 16px;
}

.evd-yt-card-title {
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 700;
    color: var(--evd-dark);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.evd-yt-card-meta {
    margin: 0;
    font-size: 13px;
    color: var(--evd-gray);
}

.evd-yt-dot {
    margin: 0 6px;
}

/* ---------------------------------- Botones de acción ---------------------------------- */

.evd-yt-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: center;
    margin-bottom: 24px;
}

.evd-yt-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.evd-yt-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.evd-yt-btn-primary {
    background: var(--evd-red);
    color: #fff;
}

.evd-yt-btn-secondary {
    background: var(--evd-dark);
    color: #fff;
}

/* ---------------------------------- Pie de sección ---------------------------------- */

.evd-yt-footer-strip {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--evd-border);
    color: var(--evd-gray);
    font-size: 13px;
    font-weight: 600;
}

.evd-yt-footer-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.evd-yt-footer-item svg {
    fill: var(--evd-red);
}

/* ---------------------------------- Mensajes de error ---------------------------------- */

.evd-yt-error {
    color: #b00020;
    background: #fdecea;
    padding: 12px 16px;
    border-radius: 6px;
}

/* ---------------------------------- Modal de video ---------------------------------- */

.evd-yt-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: none;
}

.evd-yt-modal.is-open {
    display: block;
}

.evd-yt-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
}

.evd-yt-modal-content {
    position: relative;
    max-width: 960px;
    width: 92%;
    margin: 4vh auto;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
}

.evd-yt-modal-iframe-wrap {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
}

.evd-yt-modal-iframe-wrap iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.evd-yt-modal-close {
    position: absolute;
    top: -42px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
}

@media (max-width: 600px) {
    .evd-yt-modal-content {
        margin: 10vh auto;
    }

    .evd-yt-modal-close {
        top: -38px;
    }
}
