/* =========================================================================
   XMLTV Guide — Front-end stylesheet
   Struttura del file:
     1. Variabili globali e font
     2. Wrapper + tab sorgente (Free/Pay)
     3. Ricerca canale
     4. Pillole canali (elenco in alto)
     5. Badge/logo canale (cerchio con iniziali o immagine)
     6. Pulsante "Mostra tutti i canali"
     7. Sezioni canale (ORA IN ONDA / A SEGUIRE)
     8. Pagina standalone del canale (palinsesto completo)
     9. Pulsante "Guarda live"
    10. Palinsesto multi-giorno (tab giorni + elenco programmi)
    11. Stati vuoti
    12. Preferiti (stella + filtro "Solo preferiti")
    13. Responsive (mobile)
   ========================================================================= */

/* -------------------------------------------------------------------------
   1. Variabili globali e font
   ------------------------------------------------------------------------- */
.xmltv-guide-wrapper,
.xmltv-channel-page {
	--xmltv-blue: #1565c0;
	--xmltv-blue-dark: #0d47a1;
	--xmltv-red: #d32f2f;
	--xmltv-red-dark: #b71c1c;
	--xmltv-bg: #f4f7fb;
	--xmltv-border: #e2e8f0;
	--xmltv-text: #1a2233;
	--xmltv-muted: #6b7684;
	--xmltv-radius-pill: 999px;
	--xmltv-radius-card: 14px;
	--xmltv-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	max-width: 1200px;
	margin: 0 auto;
	font-family: var(--xmltv-font);
	color: var(--xmltv-text);
}

.xmltv-guide {
	--xmltv-blue: #1565c0;
	--xmltv-bg: #f4f7fb;
	--xmltv-border: #e2e8f0;
	--xmltv-text: #1a2233;
	--xmltv-muted: #6b7684;
	font-family: var(--xmltv-font, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif);
	color: var(--xmltv-text);
}

.xmltv-guide *,
.xmltv-channel-page * {
	box-sizing: border-box;
}

/* -------------------------------------------------------------------------
   2. Wrapper + tab sorgente (Free/Pay)
   ------------------------------------------------------------------------- */
.xmltv-source-tabs {
	display: flex;
	gap: 8px;
	margin-bottom: 22px;
	border-bottom: 2px solid var(--xmltv-border);
}
.xmltv-source-tab {
	background: transparent;
	border: none;
	border-bottom: 3px solid transparent;
	margin-bottom: -2px;
	padding: 10px 22px;
	font-family: var(--xmltv-font);
	font-size: 18px;
	font-weight: 700;
	color: var(--xmltv-muted);
	cursor: pointer;
	transition: color .15s ease, border-color .15s ease;
}
.xmltv-source-tab:hover {
	color: var(--xmltv-blue);
}
.xmltv-source-tab.is-active {
	color: var(--xmltv-blue);
	border-bottom-color: var(--xmltv-blue);
}
.xmltv-source-tab:focus-visible {
	outline: 2px solid var(--xmltv-blue);
	outline-offset: 2px;
}

/* -------------------------------------------------------------------------
   3. Ricerca canale
   ------------------------------------------------------------------------- */
.xmltv-search-row {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 12px;
	margin-bottom: 16px;
	padding: 14px 16px;
	background: var(--xmltv-red);
	border-radius: var(--xmltv-radius-card);
	color: #fff;
}
.xmltv-search-input {
	flex: 1 1 220px;
	width: 100%;
	max-width: 360px;
	padding: 10px 16px;
	border: 1px solid rgba(255, 255, 255, .6);
	border-radius: var(--xmltv-radius-pill);
	background: rgba(255, 255, 255, .15);
	color: #fff;
	font-family: var(--xmltv-font);
	font-size: 17px;
	outline: none;
	transition: background .15s ease, border-color .15s ease;
}
.xmltv-search-input::placeholder {
	color: rgba(255, 255, 255, .85);
}
.xmltv-search-input:focus {
	background: rgba(255, 255, 255, .25);
	border-color: #fff;
}

/* -------------------------------------------------------------------------
   4. Pillole canali (elenco in alto)
   ------------------------------------------------------------------------- */
.xmltv-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	padding: 16px;
	background: var(--xmltv-bg);
	border-radius: 16px;
}
.xmltv-pill {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 6px 10px 6px 6px;
	background: #fff;
	border: 1px solid var(--xmltv-border);
	border-radius: var(--xmltv-radius-pill);
	color: var(--xmltv-text);
	font-family: var(--xmltv-font);
	font-size: 17px;
	font-weight: 600;
	cursor: pointer;
	transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.xmltv-pill:hover {
	border-color: var(--xmltv-blue);
	box-shadow: 0 2px 8px rgba(21, 101, 192, .12);
}
.xmltv-pill:focus-visible {
	outline: 2px solid var(--xmltv-blue);
	outline-offset: 2px;
}
.xmltv-pill.xmltv-pill-active {
	background: #eaf2fd;
	border-color: var(--xmltv-blue);
}
.xmltv-pill-hidden {
	display: none;
}
.xmltv-pill-search-hidden {
	display: none !important;
}

/* -------------------------------------------------------------------------
   5. Badge/logo canale (cerchio con iniziali o immagine)
   ------------------------------------------------------------------------- */
.xmltv-badge-logo {
	display: inline-flex;
	flex: none;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	border-radius: 50%;
	color: #fff;
	font-weight: 700;
	letter-spacing: .3px;
}
.xmltv-badge-logo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 50%;
}

/* -------------------------------------------------------------------------
   6. Pulsante "Mostra tutti i canali"
   ------------------------------------------------------------------------- */
.xmltv-showall-row {
	display: flex;
	justify-content: center;
	margin: 18px 0 8px;
}
.xmltv-showall-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 20px;
	background: #fff;
	border: 1px solid var(--xmltv-border);
	border-radius: var(--xmltv-radius-pill);
	color: var(--xmltv-blue);
	font-family: var(--xmltv-font);
	font-size: 16px;
	font-weight: 700;
	letter-spacing: .3px;
	cursor: pointer;
	transition: background .15s ease;
}
.xmltv-showall-btn:hover {
	background: #eaf2fd;
}
.xmltv-showall-chevron {
	transition: transform .15s ease;
}
.xmltv-showall-btn.is-open .xmltv-showall-chevron {
	transform: rotate(180deg);
}

/* -------------------------------------------------------------------------
   7. Sezioni canale (ORA IN ONDA / A SEGUIRE)
   ------------------------------------------------------------------------- */
.xmltv-sections {
	margin-top: 32px;
}
.xmltv-section {
	padding: 28px 0;
	border-bottom: 1px solid var(--xmltv-border);
	scroll-margin-top: 90px;
}
.xmltv-section.xmltv-highlight {
	animation: xmltv-flash 1.1s ease;
}
@keyframes xmltv-flash {
	0%   { background: #eaf2fd; }
	100% { background: transparent; }
}

.xmltv-section-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px;
	margin-bottom: 18px;
}
.xmltv-section-title {
	display: flex;
	align-items: center;
	gap: 14px;
}
.xmltv-section-title h3 {
	margin: 0;
	font-size: 24px;
	font-weight: 800;
}
.xmltv-fullguide-btn {
	background: transparent;
	border: none;
	color: var(--xmltv-blue);
	font-family: var(--xmltv-font);
	font-size: 17px;
	font-weight: 700;
	white-space: nowrap;
	text-decoration: none;
	cursor: pointer;
}
.xmltv-fullguide-btn:hover {
	text-decoration: underline;
}

.xmltv-programme-list {
	display: flex;
	flex-direction: column;
	gap: 18px;
}
.xmltv-programme {
	display: flex;
	align-items: center;
	gap: 20px;
	font-size: 19px;
}
.xmltv-p-time {
	flex: none;
	width: 52px;
	font-weight: 800;
}
.xmltv-p-title {
	flex: 1 1 auto;
	color: var(--xmltv-blue);
	font-weight: 500;
}
.xmltv-programme-empty {
	color: var(--xmltv-muted);
	font-style: italic;
}
.xmltv-badge {
	flex: none;
	padding: 5px 10px;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 800;
	letter-spacing: .4px;
}
.xmltv-badge-onair {
	background: #fdecea;
	color: var(--xmltv-red);
}
.xmltv-badge-next {
	background: #eef1f5;
	color: var(--xmltv-muted);
}

/* -------------------------------------------------------------------------
   8. Pagina standalone del canale (palinsesto completo)
   ------------------------------------------------------------------------- */
.xmltv-back-link {
	margin: 0 0 18px;
}
.xmltv-back-link a {
	color: var(--xmltv-blue);
	font-weight: 600;
	font-size: 17px;
	text-decoration: none;
}
.xmltv-back-link a:hover {
	text-decoration: underline;
}

.xmltv-channel-page-title {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-bottom: 22px;
}
.xmltv-channel-page-title h1 {
	margin: 0;
	font-size: 31px;
	font-weight: 800;
}
.xmltv-channel-page .xmltv-fg-days {
	margin-bottom: 20px;
}

/* -------------------------------------------------------------------------
   9. Pulsante "Guarda live"
   ------------------------------------------------------------------------- */
.xmltv-live-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-left: auto;
	padding: 10px 20px;
	background: var(--xmltv-red);
	border-radius: var(--xmltv-radius-pill);
	color: #fff;
	font-weight: 700;
	font-size: 15px;
	white-space: nowrap;
	text-decoration: none;
	transition: background .15s ease;
}
.xmltv-live-btn:hover {
	background: var(--xmltv-red-dark);
	color: #fff;
}
.xmltv-live-btn::before {
	content: "";
	display: inline-block;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #fff;
	animation: xmltv-live-pulse 1.4s ease-in-out infinite;
}
@keyframes xmltv-live-pulse {
	0%, 100% { opacity: 1; }
	50%      { opacity: .35; }
}

/* -------------------------------------------------------------------------
   10. Palinsesto multi-giorno (tab giorni + elenco programmi)
   ------------------------------------------------------------------------- */
.xmltv-fullguide-panel {
	margin-top: 22px;
	padding: 18px;
	background: var(--xmltv-bg);
	border-radius: var(--xmltv-radius-card);
}
.xmltv-fg-days {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 14px;
}
.xmltv-fg-day-btn {
	padding: 6px 16px;
	background: #fff;
	border: 1px solid var(--xmltv-border);
	border-radius: var(--xmltv-radius-pill);
	color: var(--xmltv-text);
	font-size: 16px;
	font-weight: 700;
	cursor: pointer;
	transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.xmltv-fg-day-btn:hover {
	border-color: var(--xmltv-blue);
}
.xmltv-fg-day-btn.is-active {
	background: var(--xmltv-blue);
	border-color: var(--xmltv-blue);
	color: #fff;
}
.xmltv-fg-list {
	display: flex;
	flex-direction: column;
}
.xmltv-fg-item {
	display: flex;
	gap: 16px;
	padding: 12px 6px;
	border-bottom: 1px solid var(--xmltv-border);
}
.xmltv-fg-item:last-child {
	border-bottom: none;
}
.xmltv-fg-time {
	flex: none;
	width: 50px;
	font-weight: 800;
}
.xmltv-fg-body {
	flex: 1 1 auto;
}
.xmltv-fg-title {
	color: var(--xmltv-text);
	font-weight: 700;
}
.xmltv-fg-sub {
	margin-top: 2px;
	color: var(--xmltv-muted);
	font-size: 14px;
}
.xmltv-fg-desc {
	margin-top: 4px;
	color: var(--xmltv-muted);
	font-size: 16px;
	line-height: 1.4;
}

/* -------------------------------------------------------------------------
   11. Stati vuoti
   ------------------------------------------------------------------------- */
.xmltv-fg-loading,
.xmltv-fg-empty,
.xmltv-guide-empty {
	color: var(--xmltv-muted);
}
.xmltv-fg-loading,
.xmltv-fg-empty {
	padding: 10px 4px;
}
.xmltv-guide-empty {
	font-style: italic;
}

/* -------------------------------------------------------------------------
   12. Preferiti (stella + filtro "Solo preferiti")
   ------------------------------------------------------------------------- */
.xmltv-fav-star {
	display: inline-flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	padding: 0;
	background: transparent;
	border: none;
	border-radius: 50%;
	color: #c7cdd6;
	font-size: 19px;
	line-height: 1;
	cursor: pointer;
	transition: color .15s ease, transform .1s ease;
}
.xmltv-fav-star:hover {
	color: #f2b400;
	transform: scale(1.12);
}
.xmltv-fav-star:focus-visible {
	outline: 2px solid var(--xmltv-blue);
	outline-offset: 2px;
}
.xmltv-fav-star.is-fav {
	color: #f2b400;
}
.xmltv-fav-star-pill {
	width: 22px;
	height: 22px;
	margin-left: auto;
	font-size: 16px;
}
.xmltv-fav-star-section {
	font-size: 22px;
}

.xmltv-fav-filter-btn {
	display: inline-flex;
	flex: none;
	align-items: center;
	gap: 6px;
	padding: 9px 16px;
	background: rgba(255, 255, 255, .15);
	border: 1px solid rgba(255, 255, 255, .6);
	border-radius: var(--xmltv-radius-pill);
	color: #fff;
	font-family: var(--xmltv-font);
	font-size: 15px;
	font-weight: 700;
	white-space: nowrap;
	cursor: pointer;
	transition: background .15s ease, color .15s ease;
}
.xmltv-fav-filter-star {
	font-size: 15px;
}
.xmltv-fav-filter-btn:hover {
	background: rgba(255, 255, 255, .25);
}
.xmltv-fav-filter-btn.is-active {
	background: #fff;
	color: var(--xmltv-red);
}
.xmltv-fav-filter-btn:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.xmltv-fav-empty {
	width: 100%;
	margin: 10px 0 0;
	color: var(--xmltv-muted);
	font-style: italic;
}

/* -------------------------------------------------------------------------
   13. Responsive (mobile)
   ------------------------------------------------------------------------- */
@media (max-width: 640px) {
	.xmltv-section-head {
		flex-direction: column;
		align-items: flex-start;
	}
	.xmltv-p-title {
		font-size: 17px;
	}
	.xmltv-channel-page-title {
		flex-wrap: wrap;
	}
	.xmltv-live-btn {
		margin-left: 0;
	}
	.xmltv-search-input {
		max-width: none;
	}
	.xmltv-fav-filter-btn {
		flex: 1 1 auto;
		justify-content: center;
	}
}
