/**
 * BollywoodTime — app homepage & mobile bottom nav
 */

:root {
	--bt-active: #ff184d;
	--bt-app-bg: #f4f5f7;
	--bt-app-surface: #ffffff;
	--bt-app-text: #121212;
	--bt-app-muted: #6b7280;
	--bt-app-radius: 16px;
	--bt-nav-height: 64px;
	--bt-safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* —— App homepage —— */
.bt-app {
	--bt-accent: var(--bt-active);
	max-width: 480px;
	margin: 0 auto;
	padding: 0 0 calc(var(--bt-nav-height) + var(--bt-safe-bottom) + 1rem);
	background: var(--bt-app-bg);
	min-height: 60vh;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
	-webkit-font-smoothing: antialiased;
}

.bt-app__header {
	padding: 1rem 1rem 0.5rem;
	background: linear-gradient(180deg, #fff 0%, var(--bt-app-bg) 100%);
}

.bt-app__brand {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.bt-app__logo {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 12px;
	background: var(--bt-active);
	color: #fff;
	font-weight: 800;
	font-size: 0.85rem;
	letter-spacing: -0.02em;
	box-shadow: 0 4px 14px rgba(255, 24, 77, 0.35);
}

.bt-app__title {
	margin: 0;
	font-size: 1.25rem;
	font-weight: 800;
	color: var(--bt-app-text);
	line-height: 1.2;
}

.bt-app__tagline {
	margin: 0.15rem 0 0;
	font-size: 0.8rem;
	color: var(--bt-app-muted);
}

.bt-app__search-wrap {
	position: sticky;
	top: 0;
	z-index: 20;
	padding: 0.5rem 1rem 0.75rem;
	background: rgba(244, 245, 247, 0.92);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
}

.bt-app__search {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0 1rem;
	height: 48px;
	background: var(--bt-app-surface);
	border-radius: 999px;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
	border: 1px solid rgba(0, 0, 0, 0.04);
}

.bt-app__search-icon {
	display: flex;
	flex-shrink: 0;
	color: var(--bt-app-muted);
}

.bt-app__search-icon svg {
	width: 20px;
	height: 20px;
}

.bt-app__search-input {
	flex: 1;
	border: 0;
	background: transparent;
	font-size: 0.95rem;
	color: var(--bt-app-text);
	outline: none;
	min-width: 0;
}

.bt-app__search-input::placeholder {
	color: #9ca3af;
}

.bt-app__main {
	padding: 0 0 0.5rem;
}

.bt-app__section {
	margin-bottom: 1.25rem;
}

.bt-app__section-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 1rem 0.65rem;
}

.bt-app__section-head h2 {
	margin: 0;
	font-size: 1.05rem;
	font-weight: 700;
	color: var(--bt-app-text);
}

.bt-app__see-all {
	font-size: 0.8rem;
	font-weight: 600;
	color: var(--bt-active);
	text-decoration: none;
}

.bt-app__empty {
	padding: 1rem;
	margin: 0 1rem;
	font-size: 0.85rem;
	color: var(--bt-app-muted);
	background: var(--bt-app-surface);
	border-radius: var(--bt-app-radius);
	text-align: center;
}

/* Horizontal scroll strips */
.bt-app-scroll {
	display: flex;
	gap: 0.75rem;
	overflow-x: auto;
	padding: 0 1rem 0.25rem;
	scroll-snap-type: x mandatory;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}

.bt-app-scroll::-webkit-scrollbar {
	display: none;
}

.bt-app-tile {
	flex: 0 0 108px;
	scroll-snap-align: start;
	text-decoration: none;
	color: inherit;
}

.bt-app-tile--celebrity {
	flex-basis: 88px;
}

.bt-app-tile__media {
	position: relative;
	aspect-ratio: 2 / 3;
	border-radius: 12px;
	overflow: hidden;
	background: #1a1a1a;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.bt-app-tile--celebrity .bt-app-tile__media {
	aspect-ratio: 1 / 1;
}

.bt-app-tile__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.bt-app-tile__placeholder {
	display: block;
	width: 100%;
	height: 100%;
	background: linear-gradient(145deg, #333, #111);
}

.bt-app-tile__badge {
	position: absolute;
	bottom: 4px;
	left: 4px;
	padding: 2px 6px;
	font-size: 0.65rem;
	font-weight: 700;
	color: #fff;
	background: rgba(0, 0, 0, 0.7);
	border-radius: 4px;
}

.bt-app-tile__badge--year {
	background: rgba(0, 0, 0, 0.65);
}

.bt-app-tile__badge--ott,
.bt-app-tile__badge:not(.bt-app-tile__badge--year) {
	background: var(--bt-active);
}

.bt-app-tile__title {
	display: block;
	margin-top: 0.4rem;
	font-size: 0.75rem;
	font-weight: 600;
	line-height: 1.25;
	color: var(--bt-app-text);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.bt-app-tile__sub {
	display: block;
	font-size: 0.65rem;
	color: var(--bt-app-muted);
	line-height: 1.3;
	margin-top: 2px;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* —— Mobile bottom nav (visible < 768px) —— */
.bt-mobile-nav {
	display: none;
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	z-index: 9999;
	height: calc(var(--bt-nav-height) + var(--bt-safe-bottom));
	padding-bottom: var(--bt-safe-bottom);
	background: #ffffff;
	border-radius: 20px 20px 0 0;
	box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.1);
	align-items: stretch;
	justify-content: space-around;
	box-sizing: border-box;
}

.bt-mobile-nav__item {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 2px;
	padding: 8px 4px 6px;
	text-decoration: none;
	color: #9ca3af;
	font-size: 0.65rem;
	font-weight: 600;
	transition: color 0.15s ease;
	-webkit-tap-highlight-color: transparent;
}

.bt-mobile-nav__item.is-active {
	color: var(--bt-active);
}

.bt-mobile-nav__icon {
	display: flex;
	line-height: 0;
}

.bt-mobile-nav__icon svg {
	width: 24px;
	height: 24px;
}

.bt-mobile-nav__item.is-active .bt-mobile-nav__icon svg {
	stroke: var(--bt-active);
}

.bt-mobile-nav__label {
	line-height: 1.1;
}

/* Body padding when nav present */
@media (max-width: 767px) {
	.bt-mobile-nav {
		display: flex;
	}

	body.bt-has-mobile-nav {
		padding-bottom: calc(var(--bt-nav-height) + var(--bt-safe-bottom));
	}

	/* Full-bleed app on mobile */
	.bt-app {
		max-width: none;
		margin-left: -0.5rem;
		margin-right: -0.5rem;
		width: calc(100% + 1rem);
	}
}

@media (min-width: 768px) {
	.bt-app {
		max-width: 720px;
		margin: 0 auto;
		padding-bottom: 2rem;
		border-radius: var(--bt-app-radius);
		box-shadow: 0 8px 40px rgba(0, 0, 0, 0.08);
		overflow: hidden;
	}

	.bt-app-scroll {
		display: grid;
		grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
		overflow: visible;
	}

	.bt-app-tile {
		flex: none;
	}
}
