:root {
    --primary: #f5b50a; /* Vàng rạp phim */
    --primary-hover: #d49a00;
    --bg: #0f172a; /* Nền tối */
    --card: #1e293b;
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --red: #ef4444;
    --nav-height: 70px;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Be Vietnam Pro', sans-serif; }
body { background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; padding-top: var(--nav-height); }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* UTILS */
.w-100 { width: 100%; }
.hero-actions { display: flex; gap: 15px; margin-top: 20px; }

/* BUTTONS */
.btn-primary { background: var(--primary); color: #000; border: none; padding: 12px 25px; border-radius: 6px; font-weight: 800; cursor: pointer; transition: 0.3s; }
.btn-primary:hover { background: var(--primary-hover); box-shadow: 0 0 15px rgba(245, 181, 10, 0.4); }

.btn-secondary { background: #334155; color: #fff; border: none; padding: 12px 20px; border-radius: 6px; cursor: pointer; font-weight: 600; }
.btn-danger-sm { background: var(--red); color: #fff; border: none; padding: 5px 10px; border-radius: 4px; cursor: pointer; font-size: 0.8rem; }

.btn-outline {
    background: transparent; color: #fff; border: 2px solid #fff;
    padding: 12px 25px; border-radius: 6px; font-weight: 700; cursor: pointer; transition: 0.3s;
    display: flex; align-items: center; gap: 8px;
}
.btn-outline:hover { background: #fff; color: #000; }

input { width: 100%; padding: 12px; margin-bottom: 15px; background: #0f172a; border: 1px solid #334155; color: #fff; border-radius: 6px; outline: none; transition: 0.3s; }
input:focus { border-color: var(--primary); }

/* HEADER */
header { position: fixed; top: 0; width: 100%; background: rgba(15, 23, 42, 0.95); backdrop-filter: blur(10px); z-index: 1000; border-bottom: 1px solid rgba(255,255,255,0.1); height: var(--nav-height); }
.nav-wrapper { display: flex; justify-content: space-between; align-items: center; height: 100%; }
.logo { font-size: 1.5rem; font-weight: 900; color: #fff; letter-spacing: 1px; cursor: pointer; }
.logo span { color: var(--primary); }
.nav-links { display: flex; gap: 30px; }
.nav-links a { font-weight: 600; color: var(--text-muted); transition: 0.3s; position: relative; }
.nav-links a:hover, .nav-links a.active { color: #fff; }
.nav-links a.active::after { content: ''; position: absolute; bottom: -24px; left: 0; width: 100%; height: 3px; background: var(--primary); }
.nav-actions { display: flex; align-items: center; gap: 15px; }
.user-menu { cursor: pointer; font-weight: 600; display: flex; gap: 8px; align-items: center; }

/* HERO & HOME */
.hero-slider { height: 60vh; position: relative; overflow: hidden; }
.slide-item { width: 100%; height: 100%; background-size: cover; background-position: center; position: relative; }
.slide-item::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, var(--bg), transparent 90%); }
.slide-content { position: relative; z-index: 2; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; padding-bottom: 60px; }
.tag { padding: 4px 12px; border-radius: 4px; font-weight: bold; font-size: 0.8rem; display: inline-block; width: fit-content; margin-bottom: 10px; }
.tag.c13 { background: #eab308; color: #000; }
.tag.c16 { background: #f97316; }
.tag.c18 { background: var(--red); }
.slide-content h1 { font-size: 3.5rem; text-shadow: 2px 2px 10px rgba(0,0,0,0.8); line-height: 1.1; margin-bottom: 15px; }

/* SEARCH & GRID */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.section-padding { padding: 40px 0; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.search-box { position: relative; width: 300px; }
.search-box input { margin-bottom: 0; padding-right: 40px; border-radius: 20px; background: var(--card); }
.search-box i { position: absolute; right: 15px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }

.movies-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 25px; }
.movie-card { background: var(--card); border-radius: 8px; overflow: hidden; transition: 0.3s; cursor: pointer; }
.movie-card:hover { transform: translateY(-10px); box-shadow: 0 10px 20px rgba(0,0,0,0.3); }
.poster-container { position: relative; aspect-ratio: 2/3; overflow: hidden; }
.poster-container img { width: 100%; height: 100%; object-fit: cover; transition: 0.5s; }
.movie-card:hover img { transform: scale(1.1); }
.card-content { padding: 15px; }
.card-content h3 { font-size: 1rem; margin-bottom: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* BOOKING SYSTEM */
.booking-container { display: flex; height: calc(100vh - var(--nav-height)); }
.booking-left { flex: 1; overflow-y: auto; padding: 20px; background: #131c2e; position: relative; }
.booking-right { width: 350px; background: var(--card); padding: 20px; display: flex; flex-direction: column; border-left: 1px solid rgba(255,255,255,0.05); }

.booking-timer { background: rgba(239, 68, 68, 0.1); color: var(--red); padding: 10px; border-radius: 6px; text-align: center; margin-bottom: 20px; border: 1px solid var(--red); font-weight: bold; }

.screen-wrapper { perspective: 600px; margin: 20px auto 40px; text-align: center; width: 80%; }
.screen { height: 40px; background: #fff; box-shadow: 0 20px 60px rgba(255,255,255,0.2); transform: rotateX(-30deg) scale(0.9); border-radius: 50% 50% 0 0; opacity: 0.7; color: #000; line-height: 40px; font-weight: bold; letter-spacing: 5px; }

#seatsGrid { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.row { display: flex; gap: 8px; }
.seat { width: 28px; height: 28px; background: #475569; border-radius: 4px 4px 0 0; cursor: pointer; transition: 0.2s; font-size: 0; }
.seat:hover:not(.occupied) { transform: scale(1.2); background: #fff; }
.seat.selected { background: var(--primary); box-shadow: 0 0 10px var(--primary); }
.seat.occupied { background: #334155; opacity: 0.3; cursor: not-allowed; }
.seat.vip { border-top: 3px solid var(--red); }
.seat-types { display: flex; justify-content: center; gap: 15px; margin-top: 30px; font-size: 0.9rem; color: var(--text-muted); }
.seat-types .seat { display: inline-block; width: 20px; height: 20px; vertical-align: middle; margin-right: 5px; transform: none; }

.pay-item { background: var(--card); padding: 15px; border-radius: 8px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; cursor: pointer; border: 1px solid transparent; }
.pay-item.active { border-color: var(--primary); background: rgba(245, 181, 10, 0.1); }
.movie-summary { display: flex; gap: 15px; margin-bottom: 20px; border-bottom: 1px dashed #334155; padding-bottom: 20px; }
.movie-summary img { width: 70px; border-radius: 4px; }
.cart-items .row { display: flex; justify-content: space-between; margin-bottom: 10px; }
.total-section { margin-top: auto; border-top: 2px solid #334155; padding-top: 20px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.total-section strong { font-size: 1.5rem; color: var(--primary); }

/* ADMIN */
.admin-dashboard { display: flex; gap: 20px; min-height: 500px; }
.sidebar { width: 250px; background: var(--card); padding: 20px; border-radius: 8px; }
.sidebar button { display: block; width: 100%; padding: 12px; text-align: left; background: none; border: none; color: var(--text-muted); cursor: pointer; border-radius: 6px; margin-bottom: 5px; font-weight: 600; }
.sidebar button.active { background: var(--primary); color: #000; }
.sidebar button:hover:not(.active) { background: #334155; }
.sidebar button.danger { color: var(--red); margin-top: 20px; border: 1px solid var(--red); }
.sidebar button.warning { color: #f97316; border: 1px solid #f97316; }
.content { flex: 1; background: var(--card); padding: 20px; border-radius: 8px; }
.admin-table { width: 100%; border-collapse: collapse; margin-top: 15px; }
.admin-table th, .admin-table td { padding: 15px; text-align: left; border-bottom: 1px solid #334155; }

/* HISTORY TICKETS */
.ticket-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.history-card { background: var(--card); border-radius: 8px; padding: 20px; border-left: 5px solid var(--primary); position: relative; }
.history-card .status { position: absolute; top: 15px; right: 15px; font-size: 0.8rem; background: rgba(34, 197, 94, 0.2); color: #22c55e; padding: 2px 8px; border-radius: 4px; }

/* MODALS */
.modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.8); backdrop-filter: blur(5px); z-index: 2000; justify-content: center; align-items: center; }
.modal-dialog { background: var(--card); padding: 30px; border-radius: 12px; width: 90%; max-width: 400px; position: relative; border: 1px solid #334155; }
.close { position: absolute; top: 15px; right: 20px; font-size: 1.5rem; cursor: pointer; color: var(--text-muted); }

/* VIDEO MODAL (S3 Cloudfly) */
.video-dialog { background: transparent !important; box-shadow: none; max-width: 900px !important; width: 95% !important; padding: 0; border: none; }
.video-dialog .close { top: -40px; right: 0; color: #fff; font-size: 2rem; opacity: 0.8; }
#videoPlayer { border-radius: 12px; box-shadow: 0 0 50px rgba(0,0,0,0.8); background: #000; outline: none; }

/* TICKET PRINT STYLES */
.ticket-receipt { background: #fff; color: #000; padding: 30px; border-radius: 10px; position: relative; margin-bottom: 20px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.ticket-receipt::after { content: ''; position: absolute; bottom: -10px; left: 0; width: 100%; height: 20px; background: radial-gradient(circle, transparent 10px, #fff 11px); background-size: 30px 20px; transform: rotate(180deg); }
.ticket-header { text-align: center; border-bottom: 2px dashed #000; padding-bottom: 15px; margin-bottom: 15px; }
.ticket-body h1 { font-size: 1.5rem; margin-bottom: 20px; text-transform: uppercase; line-height: 1.2; }
.ticket-info-row { display: flex; justify-content: space-between; margin-bottom: 15px; }
.ticket-info-row .label { font-size: 0.8rem; color: #666; display: block; text-transform: uppercase; }
.ticket-info-row strong { font-size: 1.1rem; display: block; }
.ticket-info-row strong.highlight { color: #d00000; font-size: 1.3rem; }
.dashed-line { border-bottom: 2px dashed #ccc; margin: 20px 0; }
.ticket-qr-area { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.ticket-total { display: flex; justify-content: space-between; font-weight: bold; font-size: 1.2rem; }
.ticket-actions { display: flex; gap: 10px; justify-content: center; }

/* RESPONSIVE & ANIMATION */
.mobile-toggle { display: none; font-size: 1.5rem; cursor: pointer; }
.mobile-menu { position: fixed; top: 0; right: -280px; width: 280px; height: 100vh; background: var(--card); z-index: 1001; padding: 20px; transition: 0.3s; box-shadow: -5px 0 20px rgba(0,0,0,0.5); }
.mobile-menu.active { right: 0; }
.mobile-menu-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 1000; }
.mobile-menu-overlay.active { display: block; }
.mobile-header { display: flex; justify-content: space-between; margin-bottom: 30px; }
.mobile-menu a { display: block; padding: 15px 0; border-bottom: 1px solid rgba(255,255,255,0.05); }

.page { display: none; animation: fadeIn 0.4s; }
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 768px) {
    .nav-links, .user-menu span { display: none; }
    .mobile-toggle { display: block; }
    .booking-container { flex-direction: column; height: auto; }
    .booking-right { width: 100%; position: fixed; bottom: 0; left: 0; z-index: 100; border-top: 1px solid #334155; padding: 15px; }
    .booking-left { padding-bottom: 160px; }
    .search-box { width: 100%; margin-top: 10px; }
    .admin-dashboard { flex-direction: column; }
    .sidebar { width: 100%; }
}

/* --- PRINT MODE: CHỈ IN VÉ --- */
@media print {
    body * { visibility: hidden; }
    .modal { display: block !important; position: absolute; left: 0; top: 0; width: 100%; height: 100%; background: #fff; z-index: 9999; }
    .modal-dialog { border: none; box-shadow: none; width: 100%; max-width: 100%; left: 0; top: 0; }
    #printableTicket, #printableTicket * { visibility: visible; }
    #printableTicket { position: absolute; left: 50%; top: 50px; transform: translateX(-50%); width: 350px; border: 1px solid #ccc; box-shadow: none; }
    .ticket-actions, .close { display: none !important; }
}