/* ============================================================
   Movietronic - moderni mobile-first stylesheet
   ============================================================ */

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
img, svg { display: block; max-width: 100%; height: auto; }
button { font: inherit; cursor: pointer; }

:root {
	--bg: #0f0f1a;
	--bg-elev: #16162a;
	--bg-elev2: #1e1e35;
	--text: #f5f5fa;
	--text-muted: #9090a8;
	--accent: #e94560;
	--accent-hover: #ff5d77;
	--border: #2a2a45;
	--shadow: 0 4px 20px rgba(0,0,0,0.4);
	--radius: 12px;
	--max-width: 1280px;
}

@media (prefers-color-scheme: light) {
	:root {
		--bg: #fafafa;
		--bg-elev: #ffffff;
		--bg-elev2: #f0f0f5;
		--text: #1a1a2e;
		--text-muted: #5a5a70;
		--border: #e0e0ea;
		--shadow: 0 4px 20px rgba(0,0,0,0.08);
	}
}

body {
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
	background: var(--bg);
	color: var(--text);
	line-height: 1.5;
	min-height: 100vh;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

a {
	color: var(--accent);
	text-decoration: none;
	transition: color 0.15s ease;
}
a:hover { color: var(--accent-hover); }

.container {
	max-width: var(--max-width);
	margin: 0 auto;
	padding: 0 16px;
}

@media (min-width: 768px) {
	.container { padding: 0 24px; }
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
	background: var(--bg-elev);
	border-bottom: 1px solid var(--border);
	position: sticky;
	top: 0;
	z-index: 100;
	backdrop-filter: blur(8px);
}
.site-header .container {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 60px;
	gap: 16px;
}
.logo {
	display: flex;
	align-items: center;
	gap: 10px;
	font-weight: 700;
	font-size: 18px;
	color: var(--text);
}
.logo:hover { color: var(--text); }
.logo svg { flex-shrink: 0; }

/* Mobile nav toggle */
.nav-toggle {
	display: flex;
	flex-direction: column;
	gap: 4px;
	background: none;
	border: none;
	padding: 8px;
}
.nav-toggle span {
	width: 22px;
	height: 2px;
	background: var(--text);
	border-radius: 1px;
	transition: transform 0.2s ease;
}
.main-nav > ul {
	list-style: none;
	display: none;
	position: absolute;
	top: 60px;
	left: 0;
	right: 0;
	background: var(--bg-elev);
	border-bottom: 1px solid var(--border);
	flex-direction: column;
	padding: 8px 0;
}
.main-nav.open > ul { display: flex; }
.main-nav a {
	display: block;
	padding: 12px 24px;
	color: var(--text);
	font-weight: 500;
}
.main-nav a:hover { background: var(--bg-elev2); }
.lang-menu { list-style: none; }
.country-badge {
	padding: 12px 24px;
	color: var(--text-muted);
	font-size: 13px;
}

/* Language / country switcher */
.lang-switcher, .country-switcher { position: relative; }
.country-switcher .country-toggle,
.lang-toggle {
	background: var(--bg-elev2);
	color: var(--text);
	border: 1px solid var(--border);
	padding: 8px 14px;
	border-radius: 8px;
	font-weight: 600;
	font-size: 13px;
}
.lang-toggle:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.lang-menu, .country-menu {
	display: none;
	position: absolute;
	right: 0;
	top: 100%;
	background: var(--bg-elev);
	border: 1px solid var(--border);
	border-radius: 8px;
	min-width: 200px;
	max-height: 70vh;
	overflow-y: auto;
	box-shadow: var(--shadow);
	list-style: none;
	z-index: 200;
	padding: 4px 0;
	flex-direction: column !important;
	gap: 0 !important;
}
/* Bridge - sprijeci da se dropdown zatvori dok mis prelazi gap */
.lang-switcher::after, .country-switcher::after {
	content: "";
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	height: 8px;
}
.lang-switcher:hover .lang-menu,
.lang-switcher:focus-within .lang-menu,
.lang-switcher.open .lang-menu,
.country-switcher:hover .country-menu,
.country-switcher:focus-within .country-menu,
.country-switcher.open .country-menu { display: flex; }
.lang-menu li { width: 100%; display: block; }
.lang-menu li a {
	display: block;
	padding: 10px 16px !important;
	font-size: 14px;
	color: var(--text);
	border-radius: 0 !important;
	white-space: nowrap;
}
.lang-menu li a:hover { background: var(--bg-elev2); }

/* Mobile lang switcher - inline u burger meniju */
@media (max-width: 767px) {
	.lang-switcher { width: 100%; }
	.lang-toggle { display: none; }
	.lang-menu {
		display: flex !important;
		position: static;
		box-shadow: none;
		border: none;
		margin: 0;
		padding: 0;
		background: transparent;
		min-width: 0;
	}
}

@media (min-width: 768px) {
	.nav-toggle { display: none; }
	.main-nav > ul {
		display: flex;
		position: static;
		flex-direction: row;
		background: none;
		border: none;
		padding: 0;
		gap: 4px;
		align-items: center;
	}
	.main-nav > ul > li > a {
		padding: 8px 14px;
		border-radius: 8px;
	}
	.country-badge {
		padding: 6px 12px;
		background: var(--bg-elev2);
		border-radius: 999px;
		font-size: 12px;
	}
}

/* ============================================================
   MAIN
   ============================================================ */
.site-main {
	padding: 24px 0 48px;
	min-height: calc(100vh - 60px - 200px);
}

h1, h2, h3, h4 {
	color: var(--text);
	font-weight: 700;
	line-height: 1.2;
	margin-bottom: 12px;
}
h1 { font-size: clamp(24px, 4vw, 36px); }
h2 { font-size: clamp(20px, 3vw, 28px); margin-top: 24px; }
h3 { font-size: 18px; }
h4 { font-size: 16px; }

p { margin-bottom: 12px; color: var(--text-muted); }

/* ============================================================
   MOVIE GRID
   ============================================================ */
.movie-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 16px;
	margin-top: 16px;
}
@media (min-width: 480px) {
	.movie-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 768px) {
	.movie-grid { grid-template-columns: repeat(4, 1fr); gap: 24px; }
}
@media (min-width: 1100px) {
	.movie-grid { grid-template-columns: repeat(5, 1fr); }
}
@media (min-width: 1400px) {
	.movie-grid { grid-template-columns: repeat(6, 1fr); }
}

.movie-card {
	background: var(--bg-elev);
	border-radius: var(--radius);
	overflow: hidden;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.movie-card:hover {
	transform: translateY(-4px);
	box-shadow: var(--shadow);
}
.movie-card a { color: var(--text); display: block; }
.movie-card .poster {
	aspect-ratio: 2 / 3;
	background: var(--bg-elev2);
	overflow: hidden;
}
.movie-card .poster img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}
.movie-card:hover .poster img { transform: scale(1.05); }
.movie-card h3 {
	padding: 12px;
	font-size: 15px;
	margin: 0;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* ============================================================
   MOVIE DETAIL
   ============================================================ */
.movie-detail {
	display: grid;
	grid-template-columns: 1fr;
	gap: 24px;
	margin-top: 16px;
}
@media (min-width: 768px) {
	.movie-detail { grid-template-columns: 280px 1fr; gap: 32px; }
}
@media (min-width: 1024px) {
	.movie-detail { grid-template-columns: 360px 1fr; }
}
.movie-detail .poster {
	aspect-ratio: 2 / 3;
	background: var(--bg-elev);
	border-radius: var(--radius);
	overflow: hidden;
	box-shadow: var(--shadow);
	max-width: 360px;
	margin: 0 auto;
}
.movie-detail .poster img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.movie-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin: 12px 0 16px;
	font-size: 14px;
	color: var(--text-muted);
}
.movie-meta .pill {
	background: var(--bg-elev);
	padding: 4px 12px;
	border-radius: 999px;
}

/* ============================================================
   CINEMA / SHOWTIMES
   ============================================================ */
.cinema-header {
	background: var(--bg-elev);
	border-radius: var(--radius);
	padding: 20px;
	margin-bottom: 24px;
}
.cinema-header h1 { margin-bottom: 4px; }
.cinema-header .subtitle {
	color: var(--text-muted);
	font-size: 14px;
}

.showtimes-list {
	display: flex;
	flex-direction: column;
	gap: 16px;
}
.showtimes-movie {
	background: var(--bg-elev);
	border-radius: var(--radius);
	padding: 16px;
}
.showtimes-movie h3 { margin-bottom: 12px; }
.showtime-day {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-bottom: 12px;
	padding-bottom: 12px;
	border-bottom: 1px solid var(--border);
}
.showtime-day:last-child { border-bottom: none; padding-bottom: 0; margin-bottom: 0; }
.showtime-day .date {
	font-weight: 600;
	font-size: 13px;
	color: var(--text-muted);
	text-transform: uppercase;
	letter-spacing: 0.5px;
}
.showtime-times {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}
.showtime-times .time {
	background: var(--bg-elev2);
	padding: 6px 14px;
	border-radius: 6px;
	font-size: 14px;
	font-variant-numeric: tabular-nums;
	color: var(--text);
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
	background: var(--bg-elev);
	border-top: 1px solid var(--border);
	padding: 40px 0 20px;
	margin-top: 60px;
}
.footer-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 24px;
}
@media (min-width: 600px) {
	.footer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
	.footer-grid { grid-template-columns: repeat(4, 1fr); }
}
.footer-grid h4 { margin-bottom: 8px; font-size: 14px; text-transform: uppercase; letter-spacing: 0.5px; }
.footer-grid p { font-size: 14px; }
.footer-bottom {
	margin-top: 32px;
	padding-top: 20px;
	border-top: 1px solid var(--border);
	text-align: center;
	color: var(--text-muted);
	font-size: 13px;
}
.footer-bottom p { color: var(--text-muted); margin: 0; }

/* ============================================================
   UTILITIES
   ============================================================ */
.empty-state {
	text-align: center;
	padding: 60px 20px;
	color: var(--text-muted);
}
.no-poster {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--text-muted);
	font-size: 12px;
}

/* RTL support for Arabic, Hebrew, etc. */
html[dir="rtl"] .movie-card h3 { text-align: right; }
html[lang="ar"], html[lang="he"], html[lang="fa"] { direction: rtl; }
