/* =====================================================================
   Grande FM 92,1 — Grid de programação moderno (estilo Plex / Pluto TV)
   Arquivo: css/programacao_epg.css
   Uso: incluir DEPOIS de main.css (as variáveis --primaria, --secundaria,
   --tercearia, --fundo e a fonte Montserrat vêm do main.css).
   Classes prefixadas/únicas para não colidir com o Materialize.
   ===================================================================== */

:root {
	--texto: #eeeeee;
	--texto-suave: #a7c3d4;

	/* dims do guia */
	--channel-w: 208px;
	--row-h: 132px;
	--ruler-h: 52px;
}

/* ============ SELETOR DE DIAS ============ */
.epg-page .daybar { position: relative; margin: 6px 0 18px; }
.epg-page .daybar__scroll {
	display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px;
	scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
}
.epg-page .daybar__scroll::-webkit-scrollbar { height: 4px; }

.epg-page .daytab {
	flex: 1 0 auto; min-width: 108px; scroll-snap-align: center;
	display: flex; align-items: center; gap: 10px;
	background: rgba(5, 40, 62, .72); color: var(--texto);
	border: 1px solid rgba(41, 175, 243, .35); border-radius: 10px;
	padding: 10px 16px; cursor: pointer; font-family: inherit;
	transition: transform .2s ease, box-shadow .25s ease, background .25s ease, border-color .25s ease;
}
.epg-page .daytab:hover { transform: translateY(-2px); border-color: var(--secundaria); }
.epg-page .daytab:focus-visible { outline: 2px solid var(--secundaria); outline-offset: 2px; }
.epg-page .daytab__ico { display: flex; color: var(--secundaria); opacity: .85; }
.epg-page .daytab__ico .material-icons-round { font-size: 20px; }
.epg-page .daytab__txt { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.epg-page .daytab__abbr { font-weight: 800; font-size: 13px; letter-spacing: .06em; }
.epg-page .daytab__meta { font-size: 10px; font-weight: 600; color: var(--texto-suave); }

.epg-page .daytab.is-active {
	background: var(--secundaria); border-color: var(--secundaria); color: #fff;
	box-shadow: 0 6px 18px rgba(41, 175, 243, .35);
}
.epg-page .daytab.is-active .daytab__ico { color: #fff; opacity: 1; }
.epg-page .daytab.is-active .daytab__meta { color: rgba(255, 255, 255, .85); }

.epg-page .daytab.is-today .daytab__meta {
	background: var(--primaria); color: #fff; border-radius: 20px; padding: 1px 8px; font-size: 9px; letter-spacing: .06em;
}
.epg-page .daytab.is-today.is-active .daytab__meta { background: rgba(0, 0, 0, .28); }

/* ============ CABEÇALHO DO GUIA ============ */
.epg-page .guide__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.epg-page .guide__daytitle { margin: 0; font-size: clamp(20px, 3.2vh, 30px); font-weight: 900; text-transform: uppercase; letter-spacing: .02em; }
.epg-page .guide__daysub { margin: 2px 0 0; font-size: 12px; font-weight: 600; color: var(--texto-suave); }
.epg-page .guide__tools { display: flex; align-items: center; gap: 12px; }
.epg-page .guide__clock {
	display: flex; align-items: baseline; gap: 8px;
	background: rgba(0, 0, 0, .28); border: 1px solid rgba(41, 175, 243, .3); border-radius: 10px; padding: 8px 14px;
}
.epg-page .guide__clock b { font-size: 18px; font-weight: 800; color: var(--secundaria); font-variant-numeric: tabular-nums; }
.epg-page .guide__clock span { font-size: 9px; font-weight: 600; color: var(--texto-suave); letter-spacing: .05em; text-transform: uppercase; }
.epg-page .btn-now {
	display: inline-flex; align-items: center; gap: 8px;
	background: var(--primaria); color: #fff; border: 0; border-radius: 10px;
	font-family: inherit; font-size: 12px; font-weight: 700; letter-spacing: .03em;
	padding: 11px 16px; cursor: pointer; transition: filter .2s, transform .2s;
}
.epg-page .btn-now:hover { filter: brightness(1.1); transform: translateY(-1px); }
.epg-page .btn-now .material-icons-round { font-size: 18px; }

/* ============ CARD SPOTLIGHT (no ar / resumo do dia) ============ */
.epg-page .nowcard {
	display: grid; grid-template-columns: 104px 1fr auto; gap: 18px; align-items: center;
	background: linear-gradient(120deg, rgba(11, 93, 118, .55), rgba(5, 40, 62, .85) 55%, rgba(217, 42, 42, .18));
	border: 1px solid rgba(41, 175, 243, .35); border-left: 5px solid var(--primaria);
	border-radius: 14px; padding: 16px 20px; margin-bottom: 18px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}
.epg-page .nowcard__art {
	width: 104px; height: 104px; border-radius: 12px; object-fit: cover; background: #04304a;
	box-shadow: 0 6px 18px rgba(0, 0, 0, .5);
}
.epg-page .nowcard__body { min-width: 0; }
.epg-page .nowcard__tag {
	display: inline-flex; align-items: center; gap: 6px;
	background: var(--primaria); color: #fff; font-size: 10px; font-weight: 800; letter-spacing: .1em;
	border-radius: 20px; padding: 3px 10px; margin-bottom: 6px;
}
.epg-page .nowcard__tag .dot { width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: gfmPulse 1.6s infinite; }
.epg-page .nowcard__tag.is-soft { background: var(--tercearia); }
.epg-page .nowcard__tag.is-soft .dot { animation: none; }
.epg-page .nowcard__name { margin: 0; font-size: clamp(18px, 2.6vh, 24px); font-weight: 800; line-height: 1.15; }
.epg-page .nowcard__host { margin: 3px 0 0; font-size: 13px; font-weight: 600; color: var(--texto-suave); }
.epg-page .nowcard__time { margin: 8px 0 0; font-size: 12px; font-weight: 700; color: var(--secundaria); font-variant-numeric: tabular-nums; }
.epg-page .nowcard__next { margin: 6px 0 0; font-size: 12px; font-weight: 600; color: #9fb8c6; }
.epg-page .nowcard__next b { color: var(--texto); }
.epg-page .nowcard__meter { width: 210px; justify-self: end; text-align: right; }
.epg-page .nowcard__pct { font-size: 30px; font-weight: 900; font-style: italic; color: var(--secundaria); line-height: 1; }
.epg-page .nowcard__remain { display: block; margin-top: 4px; font-size: 11px; font-weight: 700; color: var(--texto-suave); }
.epg-page .nowcard__bar { width: 100%; height: 6px; margin-top: 10px; border-radius: 6px; background: rgba(255, 255, 255, .14); overflow: hidden; }
.epg-page .nowcard__bar i {
	display: block; height: 100%; border-radius: 6px;
	background: linear-gradient(90deg, var(--secundaria), var(--primaria));
	transition: width .6s ease;
}

/* ============ GUIA HORIZONTAL (EPG) ============ */
.epg-page .epg {
	position: relative; border: 1px solid rgba(41, 175, 243, .3); border-radius: 14px;
	background: rgba(3, 27, 43, .55); overflow: hidden; box-shadow: 0 12px 34px rgba(0, 0, 0, .4);
}
.epg-page .epg__scroll { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }
.epg-page .epg__inner { position: relative; }

/* régua de horas */
.epg-page .epg__ruler {
	position: relative; height: var(--ruler-h); margin-left: var(--channel-w);
	border-bottom: 1px solid rgba(41, 175, 243, .25);
	background: linear-gradient(180deg, rgba(2, 20, 32, .9), rgba(2, 20, 32, .45));
}
.epg-page .epg__era {
	position: absolute; top: 6px; font-size: 9px; font-weight: 800; letter-spacing: .18em;
	color: rgba(41, 175, 243, .75); text-transform: uppercase; white-space: nowrap; transform: translateX(8px);
}
.epg-page .epg__hour {
	position: absolute; bottom: 6px; font-size: 10px; font-weight: 700; color: #9fc4d8;
	font-variant-numeric: tabular-nums; transform: translateX(7px); white-space: nowrap;
}
.epg-page .epg__tick { position: absolute; top: 26px; bottom: 0; width: 1px; background: rgba(255, 255, 255, .10); }
.epg-page .epg__tick.is-major { background: rgba(41, 175, 243, .35); }

/* linha do dia */
.epg-page .epg__row { position: relative; height: var(--row-h); }

.epg-page .epg__channel {
	position: sticky; left: 0; z-index: 6; width: var(--channel-w); height: 100%;
	display: flex; align-items: center; gap: 12px; padding: 0 14px;
	background: linear-gradient(90deg, #06304a 82%, rgba(6, 48, 74, .92));
	border-right: 1px solid rgba(41, 175, 243, .3);
}
.epg-page .epg__channel img { width: 52px; height: 52px; border-radius: 12px; box-shadow: 0 4px 14px rgba(0, 0, 0, .5); }
.epg-page .epg__channel .ch-name { font-size: 14px; font-weight: 900; font-style: italic; line-height: 1.1; }
.epg-page .epg__channel .ch-freq { font-size: 11px; font-weight: 800; color: var(--secundaria); }
.epg-page .epg__channel .ch-loc { font-size: 9px; font-weight: 600; color: var(--texto-suave); margin-top: 3px; }

.epg-page .epg__track {
	position: absolute; top: 0; bottom: 0; left: var(--channel-w);
	background-image: repeating-linear-gradient(90deg, rgba(255, 255, 255, .07) 0 1px, transparent 1px, transparent calc(100% / 24));
}
.epg-page .epg__band { position: absolute; top: 0; bottom: 0; }
.epg-page .epg__band--madrugada { background: rgba(0, 0, 0, .26); }
.epg-page .epg__band--manha { background: rgba(255, 255, 255, .025); }
.epg-page .epg__band--tarde { background: rgba(255, 255, 255, .055); }
.epg-page .epg__band--noite { background: rgba(0, 0, 0, .16); }
.epg-page .epg__era-sep { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(41, 175, 243, .28); }

/* blocos de programa */
.epg-page .blk {
	position: absolute; top: 12px; bottom: 12px; z-index: 2;
	display: flex; align-items: center; gap: 10px; text-align: left;
	background: linear-gradient(160deg, rgba(9, 58, 86, .9), rgba(5, 36, 56, .9));
	border: 1px solid rgba(41, 175, 243, .30); border-radius: 0px;
	padding: 10px 12px; color: var(--texto); font-family: inherit; cursor: pointer; overflow: hidden;
	transition: transform .18s ease, border-color .2s ease, box-shadow .25s ease, background .25s ease;
	animation: gfmBlkIn .4s ease both;
}
.epg-page .blk:hover, .epg-page .blk:focus-visible {
	transform: translateY(-3px); border-color: var(--secundaria);
	box-shadow: 0 10px 22px rgba(0, 0, 0, .45); z-index: 4; outline: none;
}
.epg-page .blk__thumb { flex: 0 0 auto; }
.epg-page .blk__thumb img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: #04304a; display: block; }
.epg-page .blk__body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.epg-page .blk__time { font-size: 10px; font-weight: 800; color: var(--secundaria); font-variant-numeric: tabular-nums; white-space: nowrap; }
.epg-page .blk__name { font-size: 13px; font-weight: 800; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.epg-page .blk__host { font-size: 10.5px; font-weight: 600; color: var(--texto-suave); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.epg-page .blk.is-compact { padding: 8px 9px; gap: 7px; }
.epg-page .blk.is-compact .blk__thumb img { width: 30px; height: 30px; border-radius: 6px; }
.epg-page .blk.is-compact .blk__host { display: none; }
.epg-page .blk.is-mini { padding: 8px 6px; justify-content: center; }
.epg-page .blk.is-mini .blk__thumb, .epg-page .blk.is-mini .blk__host { display: none; }
.epg-page .blk.is-mini .blk__name { font-size: 10.5px; }
.epg-page .blk.is-mini .blk__time { font-size: 9px; }

/* programa no ar */
.epg-page .blk.is-live {
	z-index: 5; border-color: var(--primaria);
	background: linear-gradient(150deg, rgba(217, 42, 42, .30), rgba(11, 93, 118, .55));
	box-shadow: 0 0 0 1px rgba(217, 42, 42, .55), 0 0 22px rgba(217, 42, 42, .45);
}
.epg-page .blk.is-live .blk__time { color: #ffd9d9; }
.epg-page .blk__live {
	position: absolute; top: 7px; right: 8px;
	background: var(--primaria); color: #fff; font-size: 8.5px; font-weight: 900; letter-spacing: .1em;
	border-radius: 20px; padding: 2px 8px; display: none; align-items: center; gap: 5px;
}
.epg-page .blk.is-live .blk__live { display: inline-flex; }
.epg-page .blk__live .dot { width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: gfmPulse 1.6s infinite; }
.epg-page .blk__prog {
	position: absolute; left: 0; bottom: 0; height: 4px; width: 0; display: none;
	background: linear-gradient(90deg, var(--secundaria), var(--primaria));
}
.epg-page .blk.is-live .blk__prog { display: block; }

/* linha do agora */
.epg-page .nowline { position: absolute; top: 0; bottom: 0; width: 2px; z-index: 7; background: var(--primaria); box-shadow: 0 0 14px rgba(217, 42, 42, .95); pointer-events: none; }
.epg-page .nowmark {
	position: absolute; bottom: 4px; z-index: 8; transform: translateX(-50%);
	background: var(--primaria); color: #fff; font-size: 9px; font-weight: 900; letter-spacing: .06em;
	border-radius: 20px; padding: 2px 9px; white-space: nowrap; pointer-events: none;
	font-variant-numeric: tabular-nums; box-shadow: 0 0 14px rgba(217, 42, 42, .7);
}

/* dia sem programas (defensivo) */
.epg-page .epg__empty {
	position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
	font-size: 13px; font-weight: 700; color: var(--texto-suave);
}

.epg-page .guide__foot {
	display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap;
	margin-top: 10px; font-size: 10.5px; font-weight: 600; color: #8fb0c2;
}
.epg-page .guide__foot .legend { display: flex; gap: 14px; flex-wrap: wrap; }
.epg-page .guide__foot .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.epg-page .legend .l-live { background: var(--primaria); }
.epg-page .legend .l-next { background: var(--secundaria); }

/* ============ MODAL DE DETALHE (prefixado p/ não colidir com .modal do Materialize) ============ */
.gmodal {
	position: fixed; inset: 0; z-index: 2000; display: none;
	align-items: center; justify-content: center; padding: 18px;
	background: rgba(2, 14, 22, .78); backdrop-filter: blur(6px);
}
.gmodal.open { display: flex; animation: gfmFadeIn .2s ease; }
.gmodal__card {
	position: relative;
	width: 100%; max-width: 560px; border-radius: 16px; overflow: hidden;
	background: linear-gradient(150deg, #0a4b6e, #052c45 60%);
	border: 1px solid rgba(41, 175, 243, .4); box-shadow: 0 24px 70px rgba(0, 0, 0, .6);
	animation: gfmPopIn .28s cubic-bezier(.175, .885, .32, 1.275);
}
.gmodal__top { display: flex; gap: 16px; padding: 20px 20px 12px; align-items: center; }
.gmodal__top img { width: 92px; height: 92px; border-radius: 12px; object-fit: cover; background: #04304a; box-shadow: 0 8px 20px rgba(0, 0, 0, .5); }
.gmodal__tag {
	display: inline-flex; align-items: center; gap: 6px; background: var(--tercearia); color: #fff;
	font-size: 9.5px; font-weight: 900; letter-spacing: .1em; border-radius: 20px; padding: 3px 10px; margin-bottom: 6px;
}
.gmodal__tag.is-live { background: var(--primaria); }
.gmodal__tag .dot { width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: gfmPulse 1.6s infinite; }
.gmodal__tag:not(.is-live) .dot { animation: none; }
.gmodal__title { margin: 0; font-size: 22px; font-weight: 900; line-height: 1.1; }
.gmodal__host { margin: 4px 0 0; font-size: 13px; font-weight: 600; color: var(--texto-suave); }
.gmodal__time { margin: 8px 0 0; font-size: 12px; font-weight: 800; color: var(--secundaria); }
.gmodal__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 4px 20px 16px; }
.gmodal__cell { background: rgba(0, 0, 0, .25); border: 1px solid rgba(255, 255, 255, .07); border-radius: 10px; padding: 10px 12px; }
.gmodal__cell span { display: block; font-size: 9px; font-weight: 800; letter-spacing: .12em; color: var(--secundaria); text-transform: uppercase; }
.gmodal__cell b { display: block; margin-top: 3px; font-size: 13px; font-weight: 700; }
.gmodal__cell small { display: block; margin-top: 2px; font-size: 11px; color: var(--texto-suave); font-weight: 600; }
.gmodal__actions { display: flex; gap: 10px; padding: 0 20px 20px; }
.gmodal__actions a, .gmodal__actions button {
	flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	border-radius: 10px; padding: 11px 14px; font-family: inherit; font-size: 12px; font-weight: 800;
	cursor: pointer; text-decoration: none; border: 0;
}
.gmodal__close {
	position: absolute; top: 14px; right: 14px; width: 38px; height: 38px; border-radius: 50%;
	background: rgba(0, 0, 0, .45); border: 1px solid rgba(255, 255, 255, .18); color: #fff; cursor: pointer;
	display: flex; align-items: center; justify-content: center; z-index: 2;
}
.gmodal__close:hover { background: var(--primaria); border-color: var(--primaria); }

/* ============ ANIMAÇÕES ============ */
@keyframes gfmPulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.75); } }
@keyframes gfmFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes gfmPopIn { from { opacity: 0; transform: scale(.92) translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes gfmBlkIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
	.epg-page *, .epg-page *::before, .epg-page *::after { animation: none !important; transition: none !important; }
}

/* ============ RESPONSIVO ============ */
@media only screen and (max-width: 700px) {
	.epg-page { --channel-w: 138px; --row-h: 118px; }
	.epg-page .nowcard { grid-template-columns: 76px 1fr; }
	.epg-page .nowcard__art { width: 76px; height: 76px; }
	.epg-page .nowcard__meter { grid-column: 1 / -1; width: 100%; justify-self: stretch; display: flex; align-items: center; gap: 12px; text-align: left; }
	.epg-page .nowcard__pct { font-size: 22px; }
	.epg-page .nowcard__bar { flex: 1; margin-top: 0; }
	.epg-page .guide__head { align-items: stretch; }
	.epg-page .guide__tools { justify-content: space-between; width: 100%; }
	.gmodal__grid { grid-template-columns: 1fr; }
	.epg-page .daytab { min-width: 96px; padding: 9px 12px; }
}
