* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #0f0f0f;
    --surface: #1a1a1a;
    --surface-hover: #252525;
    --text: #e0e0e0;
    --text-muted: #888;
    --accent: #e63946;
    --accent-hover: #ff4d5a;
    --border: #333;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    color: var(--accent-hover);
}

nav {
    background: var(--surface);
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

nav .nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    gap: 2rem;
}

nav .logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text);
}

nav .nav-links {
    display: flex;
    gap: 2rem;
}

nav .nav-links a {
    color: var(--text-muted);
}

nav .nav-links a:hover {
    color: var(--text);
}

/* Search */
.search-container {
    position: relative;
    flex: 1;
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

#search-input {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.5rem 1rem 0.5rem 2.5rem;
    color: var(--text);
    width: 100%;
    font-size: 0.9rem;
}

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

#search-input:focus {
    outline: none;
    border-color: var(--accent);
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    margin-top: 0.5rem;
    display: none;
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
}

.search-results a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text);
    border-bottom: 1px solid var(--border);
}

.search-results a:last-child {
    border-bottom: none;
}

.search-results a:hover {
    background: var(--surface-hover);
}

.search-results .no-results {
    padding: 0.75rem 1rem;
    color: var(--text-muted);
}

main {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
}

h1 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

.theater-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.theater-header h1 {
    margin-bottom: 0;
}

.theater-neighborhood {
    color: var(--text-muted);
    font-weight: normal;
    font-size: 1.5rem;
}

.theater-logo {
    max-height: 60px;
    max-width: 150px;
}

.theater-map {
    max-width: 500px;
    height: 200px;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.theater-info {
    margin-bottom: 1.5rem;
}

h2 {
    font-size: 1.5rem;
    margin: 2rem 0 1rem;
    color: var(--text-muted);
}

h3 {
    font-size: 1.1rem;
    margin: 1rem 0 0.5rem;
}

/* Movie and Theater Lists */
.list {
    display: grid;
    gap: 0.5rem;
}

.list-item {
    background: var(--surface);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.list-item:hover {
    background: var(--surface-hover);
}

.list-item a {
    color: var(--text);
    font-weight: 500;
}

.list-item .count {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Screening Cards */
.screenings {
    display: grid;
    gap: 1rem;
}

.screening-card {
    background: var(--surface);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    border-left: 3px solid var(--accent);
}

.screening-card .movie-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.screening-card .details {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.screening-card-with-poster {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.screening-poster img {
    width: 50px;
    border-radius: 4px;
}

.screening-poster-placeholder {
    width: 50px;
    height: 75px;
    background: var(--surface-hover);
    border-radius: 4px;
}

.screening-content {
    flex: 1;
}

/* Date Groups */
.date-group {
    margin-bottom: 2rem;
}

.date-header {
    font-size: 1.2rem;
    color: var(--accent);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

/* Movie Grid (Theater Page) */
.movie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.movie-tile {
    position: relative;
    aspect-ratio: 16/9;
    background-color: var(--surface);
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    overflow: hidden;
}

.movie-tile-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.4) 50%, rgba(0,0,0,0.2) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1rem;
}

.movie-tile-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.movie-tile-title a {
    color: var(--text);
}

.movie-tile-title a:hover {
    color: var(--accent);
}

.movie-tile-showtimes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.movie-tile-showtimes .showtime {
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(4px);
}

/* Showtime Pills */
.showtimes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.showtime {
    background: var(--surface-hover);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Theater Section on Movie Page */
.theater-section {
    margin-bottom: 2rem;
}

.theater-name {
    font-size: 1.1rem;
    color: var(--text);
    margin-bottom: 0.75rem;
}

/* Calendar Grid */
.calendar {
    display: grid;
    gap: 2rem;
}

.day-column {
    background: var(--surface);
    border-radius: 8px;
    padding: 1.5rem;
}

.day-column h3 {
    color: var(--accent);
    margin-bottom: 1rem;
}

.day-column .screening {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

.day-column .screening:last-child {
    border-bottom: none;
}

.day-column .time {
    font-weight: 500;
    margin-right: 0.5rem;
}

.day-column .theater {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Movie Poster */
.poster {
    max-width: 300px;
    border-radius: 8px;
    margin-bottom: 1rem;
}

/* Movie Metadata */
.year {
    color: var(--text-muted);
    font-weight: normal;
}

.movie-meta {
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    background: var(--surface);
    border-radius: 8px;
}

.movie-meta p {
    margin: 0.5rem 0;
}

.movie-meta .description {
    color: var(--text-muted);
    margin-top: 1rem;
    line-height: 1.7;
}

/* External Links */
.external-links {
    display: flex;
    gap: 0.75rem;
    margin: 1rem 0;
}

.external-link {
    padding: 0.5rem 1rem;
    background: var(--surface);
    border-radius: 4px;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.external-link:hover {
    background: var(--surface-hover);
}

footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-top: 1px solid var(--border);
}

/* MOVIE PAGE - LETTERBOXD STYLE */

.movie-hero {
    position: relative;
    margin: -2rem -2rem 2rem -2rem;
    padding: 2rem;
    min-height: 400px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}

.movie-hero.no-backdrop {
    background: var(--surface);
    min-height: auto;
}

.backdrop {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-size: cover;
    background-position: center top;
    z-index: 0;
}

.backdrop-gradient {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(to bottom, rgba(15,15,15,0.3) 0%, rgba(15,15,15,0.6) 50%, rgba(15,15,15,0.95) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    display: flex;
    gap: 2rem;
    align-items: flex-end;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.movie-hero .poster {
    width: 230px;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    margin-bottom: 0;
}

.poster-placeholder {
    width: 230px;
    height: 345px;
    background: var(--surface-hover);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

/* Popular Movies Grid */
.popular-movies {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
}

.movie-card {
    display: flex;
    flex-direction: column;
    text-align: center;
}

.movie-card img {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.movie-card .poster-placeholder {
    width: 100%;
    height: auto;
    aspect-ratio: 2/3;
}

.movie-card-title {
    font-size: 0.9rem;
    color: var(--text);
}

/* Movies Page Grid */
.movies-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1rem;
}

.movie-poster {
    display: block;
    aspect-ratio: 2/3;
    position: relative;
    overflow: hidden;
    border-radius: 4px;
}

.movie-poster img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s, box-shadow 0.2s;
}

.movie-poster:hover img {
    transform: scale(1.03);
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.movie-poster .poster-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    text-align: center;
    padding: 1rem;
    background: var(--surface-hover);
}

.movie-info { flex: 1; padding-bottom: 0.5rem; }

.movie-hero .movie-title {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.movie-hero .movie-title .year {
    font-weight: 400;
    font-size: 1.8rem;
    color: var(--text-muted);
    margin-left: 0.5rem;
}

.movie-hero .director { font-size: 1.1rem; color: var(--text-muted); margin-bottom: 0.25rem; }
.movie-hero .director-name { color: var(--text); font-weight: 500; }
.movie-hero .runtime { font-size: 0.95rem; color: var(--text-muted); margin-bottom: 1rem; }

.movie-hero .external-links { display: flex; gap: 0.5rem; margin-top: 1rem; }
.movie-hero .external-link {
    padding: 0.4rem 0.8rem;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--text);
}
.movie-hero .external-link:hover { background: rgba(255,255,255,0.2); }

.movie-description {
    max-width: 800px;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--surface);
    border-radius: 8px;
    line-height: 1.8;
    color: var(--text-muted);
}

.showtimes-section h2 {
    font-size: 1.3rem;
    color: var(--text);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.no-showtimes { color: var(--text-muted); padding: 1rem; background: var(--surface); border-radius: 8px; }

/* Theater Tiles Grid (Movie Page) */
.theater-tiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.theater-showtime-tile {
    background: var(--surface);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.theater-tile-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.theater-showtime-tile .theater-tile-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 6px;
    background: var(--surface-hover);
    flex-shrink: 0;
    max-height: none;
    max-width: none;
    margin-bottom: 0;
    padding: 4px;
}

.theater-tile-info {
    min-width: 0;
}

.theater-showtime-tile .theater-tile-name {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.theater-showtime-tile .theater-tile-name a {
    color: var(--text);
}

.theater-showtime-tile .theater-tile-name a:hover {
    color: var(--accent);
}

.theater-tile-neighborhood {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.theater-tile-showtimes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.theater-tile-showtimes .showtime {
    font-size: 0.85rem;
}

.more-showtimes {
    color: var(--accent) !important;
    background: transparent !important;
    border: 1px solid var(--accent);
}

.double-feature-badge {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.df-info-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    transition: color 0.2s;
}

.df-info-btn:hover {
    color: var(--accent);
}

.df-tooltip {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    font-style: normal;
    color: var(--text);
    width: 200px;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.df-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 1rem;
    border: 6px solid transparent;
    border-top-color: var(--border);
}

.double-feature-badge.show-tooltip .df-tooltip {
    display: block;
}

/* Theaters Map */
#theaters-map {
    height: 438px;
    border-radius: 8px;
    margin-bottom: 2rem;
}


.theater-marker {
    background-color: var(--accent);
    width: 24px;
    height: 24px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    border: 2px solid #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.4);
}

.theater-marker::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
}

/* Theater Grid */
.theater-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.theater-tile {
    background: var(--surface);
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: background 0.2s;
}

.theater-tile:hover {
    background: var(--surface-hover);
}

.theater-tile-logo {
    max-height: 60px;
    max-width: 150px;
    margin-bottom: 1rem;
}

.theater-tile-name {
    color: var(--text);
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.theater-tile-address {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    nav .nav-inner {
        flex-direction: column;
        gap: 1rem;
    }

    .search-container {
        width: 100%;
    }

    main {
        padding: 1rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    .popular-movies {
        grid-template-columns: repeat(2, 1fr);
    }

    .movies-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .movie-grid {
        grid-template-columns: 1fr;
    }

    .movie-hero { margin: -1rem; padding: 1.5rem 1rem; min-height: auto; }
    .hero-content { flex-direction: column; align-items: center; text-align: center; }
    .movie-hero .poster { width: 180px; margin-bottom: 1rem; }
    .poster-placeholder { width: 180px; height: 270px; }
    .movie-hero .movie-title { font-size: 1.75rem; }
    .movie-hero .movie-title .year { font-size: 1.3rem; display: block; margin-left: 0; }
    .movie-hero .external-links { justify-content: center; }
    .backdrop-gradient { background: linear-gradient(to bottom, rgba(15,15,15,0.4) 0%, rgba(15,15,15,0.7) 40%, rgba(15,15,15,0.98) 100%); }
}
