/* Tabernáculo Gracia - Reproductor Universal */

.tgr {
    --tgr-primary: #7a6020;
    --tgr-primary-dark: #4a3a14;
    --tgr-accent: #d97a30;
    --tgr-text: #1f2937;
    --tgr-muted: #6b7280;
    --tgr-border: #e5e7eb;
    max-width: 1280px; margin: 1.5rem auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--tgr-text); box-sizing: border-box;
}
.tgr *, .tgr *::before, .tgr *::after { box-sizing: border-box; }

.tgr__head {
    padding: 22px 26px; background: #fff;
    border-bottom: 1px solid var(--tgr-border);
    border-radius: 16px 16px 0 0;
    display: flex; align-items: center; gap: 14px;
}
.tgr__head::before {
    content: ''; width: 3px; height: 32px;
    background: var(--tgr-primary); border-radius: 2px; flex-shrink: 0;
}
.tgr__title { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.tgr__subtitle { margin: 0 0 0 auto; font-size: 12px; color: var(--tgr-muted); }

.tgr__main {
    display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 0;
    background: #fff; border-radius: 0 0 16px 16px;
    overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.12);
}

.tgr__stage { position: relative; }
.tgr__stage.is-video { background: #000; aspect-ratio: 16 / 9; }
.tgr__stage.is-video video { width: 100%; height: 100%; display: block; background: #000; }

.tgr__stage.is-audio {
    background:
        radial-gradient(circle at 30% 20%, rgba(255,255,255,0.10), transparent 60%),
        linear-gradient(135deg, var(--tgr-primary) 0%, var(--tgr-primary-dark) 100%);
    padding: 36px 32px 24px; color: #fff; min-height: 340px;
    display: flex; flex-direction: column; justify-content: center; gap: 18px;
}
.tgr__stage-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: rgba(255,255,255,0.15);
    padding: 4px 12px; border-radius: 999px;
    font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
    align-self: flex-start;
}
.tgr__stage-icon {
    width: 96px; height: 96px; border-radius: 50%;
    background: rgba(255,255,255,0.15);
    display: inline-flex; align-items: center; justify-content: center;
    align-self: flex-start; box-shadow: 0 8px 30px rgba(0,0,0,0.25);
}
.tgr__stage-icon svg { width: 48px; height: 48px; fill: #fff; opacity: 0.95; }
.tgr__stage-title { margin: 0; font-size: 22px; font-weight: 700; line-height: 1.25; color: #fff; }
.tgr__stage-meta {
    display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
    font-size: 13px; opacity: 0.9;
}
.tgr__stage-audio { width: 100%; height: 44px; margin-top: 6px; border-radius: 8px; outline: none; }
.tgr__stage-placeholder {
    color: rgba(255,255,255,0.85); font-size: 15px; text-align: center;
    padding: 40px 20px; margin: auto;
}
.tgr__stage:not(.is-audio):not(.is-video) {
    background: linear-gradient(135deg, var(--tgr-primary) 0%, var(--tgr-primary-dark) 100%);
    aspect-ratio: 16 / 9; display: flex; align-items: center; justify-content: center;
    color: #fff;
}

.tgr__current {
    padding: 18px 22px; background: #fafafa;
    border-top: 1px solid var(--tgr-border);
}
.tgr__cur-title { margin: 0 0 6px; font-size: 18px; font-weight: 700; line-height: 1.3; }
.tgr__cur-meta {
    display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
    font-size: 13px; color: var(--tgr-muted); margin-bottom: 14px;
}

.tgr__btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 18px; border: 0; border-radius: 8px;
    background: var(--tgr-primary); color: #fff;
    font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer;
    transition: background .15s, transform .15s;
}
.tgr__btn:hover { background: var(--tgr-primary-dark); transform: translateY(-1px); color: #fff; }
.tgr__btn svg { width: 18px; height: 18px; fill: currentColor; }
.tgr__btn.is-disabled { opacity: 0.5; pointer-events: none; }

.tgr__playlist {
    background: #fafafa; border-left: 1px solid var(--tgr-border);
    display: flex; flex-direction: column; max-height: 720px;
}
.tgr__pl-head {
    padding: 14px 16px; border-bottom: 1px solid var(--tgr-border);
    background: #fff; position: sticky; top: 0; z-index: 1;
}
.tgr__pl-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.tgr__pl-title b { color: var(--tgr-primary); font-size: 13px; letter-spacing: 0.8px; text-transform: uppercase; }
.tgr__pl-title span { color: var(--tgr-muted); font-size: 12px; }
.tgr__search {
    width: 100%; padding: 8px 12px; border: 1px solid var(--tgr-border);
    border-radius: 8px; font-size: 13px; outline: none;
}
.tgr__search:focus { border-color: var(--tgr-primary); }

.tgr__items { flex: 1; overflow-y: auto; padding: 4px; }
.tgr__item {
    display: grid; grid-template-columns: 28px 1fr auto;
    gap: 8px; align-items: center; padding: 10px 12px;
    border-radius: 8px; cursor: pointer;
    transition: background .12s;
    border: 1px solid transparent;
}
.tgr__item:hover { background: #fff; }
.tgr__item.is-active { background: #fff; border-color: var(--tgr-primary); box-shadow: 0 2px 6px rgba(122,96,32,0.15); }
.tgr__item[hidden] { display: none !important; }

.tgr__item-play {
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--tgr-primary); color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.tgr__item-play svg { width: 14px; height: 14px; fill: currentColor; }
.tgr__item.is-active .tgr__item-play { background: var(--tgr-accent); }

.tgr__item-body { min-width: 0; }
.tgr__item-title {
    font-size: 13px; font-weight: 600; overflow: hidden;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    line-height: 1.35;
}
.tgr__item-sub {
    font-size: 11px; color: var(--tgr-muted); margin-top: 2px;
    display: flex; gap: 6px; flex-wrap: wrap;
}
.tgr__item-sub .dur { font-variant-numeric: tabular-nums; }

.tgr__item-dl {
    color: var(--tgr-muted); text-decoration: none; padding: 6px;
    border-radius: 6px; transition: background .12s, color .12s;
}
.tgr__item-dl:hover { background: #f3f4f6; color: var(--tgr-primary); }
.tgr__item-dl svg { width: 16px; height: 16px; fill: currentColor; display: block; }

.tgr__loading, .tgr__empty, .tgr__error {
    padding: 30px 16px; text-align: center; color: var(--tgr-muted); font-size: 13px;
}
.tgr__error { color: #b91c1c; }

@media (max-width: 900px) {
    .tgr__main { grid-template-columns: 1fr; }
    .tgr__playlist { border-left: none; border-top: 1px solid var(--tgr-border); max-height: 500px; }
    .tgr__stage.is-audio { min-height: 300px; padding: 28px 22px; }
    .tgr__stage-title { font-size: 18px; }
    .tgr__stage-icon { width: 72px; height: 72px; }
    .tgr__stage-icon svg { width: 36px; height: 36px; }
}
