:root {
    --theme-bg: #F5E0C1;
    --theme-contrast: #2A2A20;
    --theme-primary: #e50914;
    /* Netflix Red accent */
    /* Netflix Red accent */
    box-sizing: border-box;
}

*,
::before,
::after {
    box-sizing: inherit;
    box-sizing: inherit;
}

/* Missing Bootstrap Utilities */
.badge {
    display: inline-block;
    padding: 0.35em 0.65em;
    font-size: 0.75em;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
}

.bg-success {
    background-color: #198754 !important;
}

.bg-secondary {
    background-color: #6c757d !important;
}

.d-flex {
    display: flex !important;
}

.justify-content-center {
    justify-content: center !important;
}

.align-items-center {
    align-items: center !important;
}

.gap-2 {
    gap: 0.5rem !important;
}

.mt-3 {
    margin-top: 1rem !important;
}

.mb-5 {
    margin-bottom: 3rem !important;
}

.w-auto {
    width: auto !important;
}

.text-dark {
    color: #212529 !important;
}

.fw-bold {
    font-weight: 700 !important;
}

body {
    background-color: var(--theme-bg);
    color: var(--theme-contrast);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
}

a {
    color: #b81d24;
}

.btn-primary {
    background-color: var(--theme-primary);
    border-color: var(--theme-primary);
}

.btn-primary:hover {
    background-color: #b20710;
    border-color: #b20710;
}

.btn-availability-info {
    background-color: #333 !important;
    border: 1px solid #555 !important;
    color: #ffd700 !important;
    /* Gold text for visibility */
    opacity: 1 !important;
    font-weight: bold;
    cursor: not-allowed;
}

/* Admin Table Overrides */
.admin-table {
    border-collapse: collapse !important;
    width: 100%;
}

.admin-table th,
.admin-table td {
    border: 2px solid #ffffff !important;
    /* Thick solid white border */
    text-align: center !important;
    vertical-align: middle !important;
    padding: 10px !important;
}

.admin-table thead th {
    background-color: #e50914 !important;
    color: white !important;
    font-weight: bold;
}

/* Card overrides for theme */
.card {
    background-color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: var(--theme-contrast);
}

.card-header {
    background-color: rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    font-weight: bold;
}

/* Table overrides */
.table {
    color: var(--theme-contrast);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--theme-contrast);
}

/* Validation & Errors */
h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zMTMgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljjg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTA2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

/* Navbar Styles */
.navbar-custom {
    background-color: #141414;
    /* Netflix Dark */
    padding: 0.5rem 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    border-bottom: 2px solid #e50914;
    /* Joyceflix Red */
}

.navbar-custom .navbar-brand {
    font-weight: 900;
    color: #e50914 !important;
    font-size: 1.5rem;
    letter-spacing: 1px;
}

.navbar-custom .brand-subtitle {
    color: #F5E0C1;
    font-weight: 400;
    font-size: 0.8em;
}

/* Aggressive Reset for all lists in navbar */
.navbar-custom ul {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.navbar-custom .main-nav {
    display: flex;
    flex-direction: row !important;
    /* Force horizontal */
    align-items: center;
    gap: 1.5rem;
}

.navbar-custom .nav-link {
    color: #e5e5e5 !important;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.5rem 0;
    transition: color 0.3s ease;
}

.navbar-custom .nav-link:hover,
.navbar-custom .nav-link.active {
    color: #ffffff !important;
    font-weight: 700;
}

.navbar-custom .nav-link.active {
    border-bottom: 2px solid #e50914;
    /* Underline active link */
}

/* Ensure dropdown works with hover or click */
.navbar-custom .dropdown-menu {
    background-color: rgba(0, 0, 0, 0.9);
    border: 1px solid #333;
}

.navbar-custom .dropdown-item {
    color: #e5e5e5;
}

.navbar-custom .dropdown-item:hover {
    background-color: #333;
    color: white;
}

/* Movies Container Layout */
.movies-container {
    /* Removed width: 100% to prevent padding overflow */
    box-sizing: border-box;
    margin: 0;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.movies-container h1,
.movies-container p {
    text-align: center;
    width: 100%;
}

.search-section {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

/* Movies Grid Layout */
.movies-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    width: 100%;
}

.movie-card {
    background: #181818;
    /* Darker, more opaque background */
    border: 1px solid #333;
    border-radius: 8px;
    /* overflow: hidden; Removed to allow tooltip to display */
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, border-color 0.2s;
    /* Flex sizing */
    flex: 1 1 300px;
    max-width: 400px;
    min-width: 250px;
}

.movie-card:hover {
    transform: translateY(-5px);
    border-color: #e50914;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.7);
}

.movie-card img {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.movie-card .info {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    color: #fff;
}

.movie-card h4 {
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 1);
    /* Stronger shadow */
}

.movie-card .overview {
    font-size: 0.9rem;
    color: #e0e0e0;
    /* Much brighter text */
    margin-bottom: 1rem;
    flex-grow: 1;
    overflow: hidden;
    position: relative;
    max-height: 4.8em;

    /* Fade effect - Adjusted for darker background */
    mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
}

/* Calendar Layout */
.calendar-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.calendar-container h1,
.calendar-container p {
    text-align: center;
    width: 100%;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #222;
    border: 1px solid #444;
    border-radius: 8px;
    overflow: hidden;
}

.weekday-header {
    background: #e50914;
    color: white;
    font-weight: bold;
    text-align: center;
    padding: 0.5rem;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.calendar-day {
    background: #181818;
    border: 1px solid #333;
    min-height: 150px;
    /* Force poster height */
    position: relative;
    display: flex;
    flex-direction: column;
}

.calendar-day.other-month {
    background: #111;
    opacity: 0.6;
}

.calendar-day.today {
    background: #252525;
    border: 2px solid #e50914;
}

.day-number {
    position: absolute;
    top: 5px;
    left: 8px;
    font-size: 0.9rem;
    font-weight: bold;
    color: #888;
    z-index: 10;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.calendar-event {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    overflow: hidden;
    position: relative;
}

.calendar-event img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.calendar-event:hover img {
    transform: scale(1.05);
}

.no-poster {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1rem;
    color: white;
    font-size: 0.9rem;
}

.seated-badge {
    position: absolute;
    bottom: 5px;
    right: 5px;
    color: #46d369;
    /* Green check */
    font-size: 1.2rem;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-event-list {
    padding: 28px 8px 8px 8px;
    /* Top padding clears the day number */
    overflow-y: auto;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
}

.event-link {
    color: #e0e0e0;
    text-decoration: none;
    font-size: 0.85rem;
    line-height: 1.2;
    display: block;
    transition: color 0.2s;
}

.event-link:hover {
    color: #fff;
    text-decoration: underline;
}

.event-link strong {
    font-weight: 600;
    color: #fff;
}

/* Floating Action Button */
.fab-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 64px;
    height: 64px;
    border-radius: 50% !important;
    /* Force circle */
    background-color: #e50914;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s, background-color 0.2s;
    z-index: 1000;
    text-decoration: none;
}

.fab-btn:hover {
    transform: scale(1.1);
    background-color: #ff1f2a;
    color: white;
}

/* Context Menu */
.context-menu {
    position: fixed;
    z-index: 10000;
    background: #222;
    border: 1px solid #444;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    padding: 0.5rem 0;
    min-width: 150px;
}

.context-menu-item {
    display: block;
    width: 100%;
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    color: #e0e0e0;
    text-align: left;
    cursor: pointer;
    font-size: 0.9rem;
}

.context-menu-item:hover {
    background: #333;
    color: white;
}

.context-menu-item.disabled {
    color: #666;
    cursor: default;
}

.context-menu-item.disabled:hover {
    background: transparent;
}

/* Seat States */
.seat.no-show {
    border: 2px solid #ff0000 !important;
    opacity: 0.7;
    position: relative;
}

.seat.no-show::after {
    content: "NO SHOW";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.2rem;
    color: #ff0000;
    font-weight: bold;
    display: none;
    /* Too small to show text usually, relies on border/tooltip */
}