/* ===================================================
   BookMyShow Mobile Clone — Global CSS
   Max-width: 480px, mobile-first
=================================================== */

/* ---------- CSS Variables ---------- */
:root {
    --red: #e5474b;
    --red-dark: #c0373b;
    --red-light: #ff6b6e;
    --bg: #f5f5f5;
    --bg-dark: #1a1a2e;
    --white: #ffffff;
    --text-primary: #1a202c;
    --text-secondary: #718096;
    --text-muted: #a0aec0;
    --border: #e2e8f0;
    --border-light: #f0f0f0;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.14);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --mobile-max: 480px;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: #f0f0f0;
    color: var(--text-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    font-family: var(--font);
    border: none;
    background: none;
    cursor: pointer;
    outline: none;
}

/* ---------- Mobile Wrapper ---------- */
.mobile-wrapper {
    max-width: var(--mobile-max);
    margin: 0 auto;
    background: var(--white);
    min-height: 100vh;
    position: relative;
    box-shadow: 0 0 40px rgba(0,0,0,0.15);
    overflow-x: hidden;
}

/* ===================================================
   PICK CITY PAGE
=================================================== */
.pick-city-page body,
body.pick-city-page {
    background: #f0f0f0;
}

/* Top bar */
.pick-city-topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--white);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 50;
}

.back-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--text-primary);
    transition: background 0.2s;
}

.back-btn:active {
    background: var(--bg);
}

.topbar-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.2px;
}

/* Search Box */
.search-box-wrap {
    padding: 14px 16px 10px;
    background: var(--white);
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: 28px;
    padding: 11px 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-box:focus-within {
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(229,71,75,0.1);
    background: white;
}

.search-icon {
    flex-shrink: 0;
}

.search-box input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 15px;
    font-family: var(--font);
    color: var(--text-primary);
    outline: none;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.clear-btn {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.clear-btn:hover {
    background: var(--border);
}

/* Detect Location */
.detect-location {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    color: var(--red);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    background: var(--white);
    border-bottom: 8px solid var(--bg);
    transition: background 0.15s;
    letter-spacing: 0.1px;
}

.detect-location:active {
    background: #fff5f5;
}

.detect-location svg {
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.location-status {
    padding: 8px 20px;
    font-size: 13px;
    color: var(--text-secondary);
    background: var(--white);
}

/* City Sections */
.city-section {
    background: var(--white);
    margin-bottom: 0;
}

.section-label {
    padding: 14px 16px 10px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    background: var(--bg);
    text-transform: uppercase;
}

/* Popular Cities Grid */
.popular-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    padding: 8px 0 4px;
    background: var(--white);
}

.city-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 6px;
    cursor: pointer;
    transition: background 0.15s;
    position: relative;
}

.city-card:active {
    background: #fff5f5;
}

.city-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--red);
    opacity: 0;
    border-radius: var(--radius-sm);
    transition: opacity 0.15s;
}

.city-card:active::after {
    opacity: 0.05;
}

.city-icon {
    width: 58px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.city-icon svg {
    width: 100%;
    height: 100%;
}

.city-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    text-align: center;
    line-height: 1.2;
}

/* Other Cities List */
.other-cities-list {
    display: flex;
    flex-direction: column;
}

.other-city-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    font-size: 15px;
    font-weight: 400;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background 0.15s;
}

.other-city-item:active {
    background: #fff5f5;
}

.other-city-item.hidden {
    display: none;
}

/* No Results */
.no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 12px;
    color: var(--text-muted);
}

.no-results p {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
}

.no-results span {
    font-size: 13px;
    color: var(--text-muted);
}

/* ===================================================
   HOME PAGE
=================================================== */

/* Header */
.home-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: linear-gradient(135deg, #e5474b 0%, #c0373b 100%);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(229,71,75,0.4);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 4px;
}

.icon-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: white;
    transition: background 0.2s;
}

.icon-btn:active {
    background: rgba(255,255,255,0.2);
}

.bms-logo {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.logo-book { color: #fff; }
.logo-my   { color: #ffecec; }
.logo-show { color: #ffe0e0; }

.city-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    background: rgba(255,255,255,0.15);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: white;
    max-width: 100px;
    transition: background 0.2s;
}

.city-chip:active {
    background: rgba(255,255,255,0.25);
}

.city-chip span {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    max-width: 65px;
}

/* Category Nav */
.category-nav {
    display: flex;
    overflow-x: auto;
    gap: 0;
    background: var(--white);
    border-bottom: 1.5px solid var(--border-light);
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.category-nav::-webkit-scrollbar { display: none; }

.cat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 16px 8px;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
    flex-shrink: 0;
}

.cat-item.active,
.cat-item:active {
    color: var(--red);
    border-bottom-color: var(--red);
}

.cat-item svg {
    width: 22px;
    height: 22px;
}

/* Banner Carousel */
.banner-carousel {
    position: relative;
    overflow: hidden;
    background: var(--bg-dark);
}

.banner-track {
    display: flex;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.banner-slide {
    min-width: 100%;
    height: 170px;
    position: relative;
    overflow: hidden;
    padding: 22px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.banner-content {
    z-index: 2;
    position: relative;
}

.banner-tag {
    display: inline-block;
    padding: 3px 10px;
    background: rgba(255,255,255,0.15);
    border-radius: 20px;
    font-size: 10px;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.banner-content h2 {
    font-size: 20px;
    font-weight: 800;
    color: white;
    margin-bottom: 4px;
    letter-spacing: -0.5px;
    max-width: 200px;
}

.banner-content p {
    font-size: 12px;
    color: rgba(255,255,255,0.7);
    margin-bottom: 14px;
    max-width: 180px;
}

.btn-book-now {
    padding: 8px 18px;
    background: var(--red);
    color: white;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 4px 12px rgba(229,71,75,0.4);
}

.btn-book-now:active {
    transform: scale(0.96);
}

.banner-art {
    position: absolute;
    right: -10px;
    bottom: -20px;
    opacity: 0.3;
}

.banner-circle {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    position: absolute;
    right: 0;
    bottom: 0;
}

.banner-circle-sm {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    position: absolute;
    right: 60px;
    bottom: 50px;
}

.banner-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 8px 0;
    background: var(--bg-dark);
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    transition: all 0.3s;
}

.dot.active {
    background: var(--red);
    width: 18px;
    border-radius: 4px;
}

/* Sections */
.home-section {
    padding: 18px 0 0;
    background: var(--white);
    margin-bottom: 8px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px 12px;
}

.section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.see-all {
    font-size: 13px;
    font-weight: 600;
    color: var(--red);
}

/* Movies Scroll */
.movies-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 0 16px 16px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.movies-scroll::-webkit-scrollbar { display: none; }

.movie-card {
    flex-shrink: 0;
    width: 120px;
    cursor: pointer;
    transition: transform 0.2s;
}

.movie-card:active {
    transform: scale(0.96);
}

.movie-poster {
    position: relative;
    width: 120px;
    height: 170px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 8px;
    box-shadow: var(--shadow);
}

.poster-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.poster-title-text {
    font-size: 48px;
    font-weight: 800;
    color: rgba(255,255,255,0.5);
}

.rating-badge {
    position: absolute;
    bottom: 6px;
    left: 6px;
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 3px 7px;
    background: rgba(0,0,0,0.7);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    color: white;
    backdrop-filter: blur(4px);
}

.movie-info {
    padding: 0 2px;
}

.movie-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.movie-genre {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.movie-votes {
    font-size: 11px;
    color: var(--text-muted);
}

/* Events List */
.events-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding-bottom: 8px;
}

.event-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background 0.15s;
}

.event-card:active {
    background: #fafafa;
}

.event-img-wrap {
    position: relative;
    flex-shrink: 0;
}

.event-placeholder {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, #1a1a2e, #e5474b66);
    display: flex;
    align-items: center;
    justify-content: center;
}

.event-placeholder span {
    font-size: 28px;
    font-weight: 800;
    color: rgba(255,255,255,0.4);
}

.event-tag {
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    padding: 2px 8px;
    background: var(--red);
    color: white;
    font-size: 9px;
    font-weight: 700;
    border-radius: 10px;
    white-space: nowrap;
    letter-spacing: 0.3px;
}

.event-info {
    flex: 1;
    min-width: 0;
}

.event-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.event-venue {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.event-date {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.event-price {
    font-size: 12px;
    font-weight: 600;
    color: var(--red);
}

.btn-interested {
    padding: 7px 14px;
    border: 1.5px solid var(--red);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--red);
    flex-shrink: 0;
    transition: all 0.2s;
}

.btn-interested:active {
    background: var(--red);
    color: white;
    transform: scale(0.96);
}

/* Bottom Nav */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: var(--mobile-max);
    display: flex;
    background: white;
    border-top: 1px solid var(--border-light);
    padding: 6px 0 calc(6px + var(--safe-bottom));
    z-index: 200;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.08);
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 4px 0;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 500;
    transition: color 0.2s;
}

.bottom-nav-item.active {
    color: var(--red);
}

.bottom-nav-item:active {
    color: var(--red);
    transform: scale(0.9);
}

/* ===================================================
   UTILITIES
=================================================== */
.hidden {
    display: none !important;
}

/* Ripple effect on tap */
@keyframes ripple {
    to { transform: scale(2.5); opacity: 0; }
}

/* Slide up animation */
@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

.city-card, .other-city-item {
    animation: slideUp 0.3s ease both;
}

/* Category nav active tab transition */
.cat-item {
    position: relative;
}

.cat-item.active span {
    color: var(--red);
}

/* Smooth scrolling snap for movie cards */
.movies-scroll {
    scroll-snap-type: x mandatory;
}

.movie-card {
    scroll-snap-align: start;
}
