/* MDB Cinema Modern Dark Theme */
:root {
  --bg-main: #0c1017;
  --bg-card: #151b23;
  --bg-card-hover: #1c2430;
  --bg-navbar: rgba(12, 16, 23, 0.95);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.22);
  --text-main: #f0f6fc;
  --text-muted: #8b949e;
  --text-dim: #6e7681;
  --accent-red: #e50914;
  --accent-gold: #ffb703;
  --bluray-blue: #0070d2;
  --dvd-gray: #6c757d;
  --steelbook-copper: #d97706;
  --series-teal: #06b6d4;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow-card: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-hover: 0 16px 36px rgba(0, 0, 0, 0.7);
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  padding-top: 76px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Navbar */
.navbar-cinema {
  background-color: var(--bg-navbar);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 1.5rem;
  z-index: 1030;
}

.brand-logo {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: #fff;
}

.brand-logo .brand-text {
  background: linear-gradient(135deg, #ffffff 30%, #ff5252 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-badge {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1.2;
  text-transform: uppercase;
  -webkit-text-fill-color: currentColor !important;
}

.brand-badge-admin {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #34d399 !important;
  border: 1px solid rgba(16, 185, 129, 0.4) !important;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.2);
}

.brand-badge-admin i {
  color: #34d399;
  font-size: 0.75rem;
}

.nav-link-cinema {
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
}

.nav-link-cinema:hover, .nav-link-cinema.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

/* Stats Ribbon */
.stats-ribbon {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  justify-content: space-around;
  align-items: center;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.stat-icon.total { background: rgba(255, 255, 255, 0.08); color: #fff; }
.stat-icon.bluray { background: rgba(0, 112, 210, 0.15); color: #38bdf8; }
.stat-icon.dvd { background: rgba(108, 117, 125, 0.2); color: #cbd5e1; }
.stat-icon.steelbook { background: rgba(217, 119, 6, 0.18); color: #fbbf24; }
.stat-icon.series { background: rgba(6, 182, 212, 0.15); color: #22d3ee; }
.stat-icon.value { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.stat-icon.lent { background: rgba(239, 68, 68, 0.15); color: #f87171; }

.stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.stat-val {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}

/* Control Panel (Search & Filters) */
.control-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.75rem;
}

.search-input-group {
  position: relative;
}

.search-input-group i.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.1rem;
  pointer-events: none;
}

.search-cinema {
  background: #0d1117;
  border: 1px solid var(--border-color);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 0.75rem 2.5rem 0.75rem 2.8rem;
  font-size: 1rem;
  transition: all 0.2s ease;
  width: 100%;
}

.search-cinema:focus {
  background: #090d13;
  border-color: #38bdf8;
  color: #fff;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
  outline: none;
}

.search-clear-btn {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: none;
  font-size: 1.1rem;
}

/* Filter Pills */
.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 1rem;
  align-items: center;
}

.filter-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.82rem;
  padding: 0.35rem 0.8rem;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.filter-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.filter-btn.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
  font-weight: 600;
}

.filter-btn.steelbook-active {
  background: #d97706 !important;
  border-color: #d97706 !important;
  color: #fff !important;
}

.filter-btn.lent-active {
  background: #dc2626 !important;
  border-color: #dc2626 !important;
  color: #fff !important;
}

/* View Switcher */
.view-switch-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s;
}

.view-switch-btn.active, .view-switch-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* Movie Poster Grid */
.movie-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

@media (max-width: 576px) {
  .movie-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.85rem;
  }
}

/* Movie Card */
.movie-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.25s ease, border-color 0.25s ease;
  position: relative;
  cursor: pointer;
}

.movie-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
  border-color: var(--border-hover);
}

.poster-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  background: #11161d;
  overflow: hidden;
}

.poster-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.movie-card:hover .poster-img {
  transform: scale(1.04);
}

/* Fallback Poster */
.poster-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  text-align: center;
  background: linear-gradient(135deg, #18222e 0%, #0d1219 100%);
  color: var(--text-muted);
}

.poster-fallback i {
  font-size: 2.5rem;
  opacity: 0.35;
  margin-bottom: 0.75rem;
}

.poster-fallback-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.3;
}

/* Badges on Poster */
.card-badges {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
  z-index: 2;
}

.badge-format {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.badge-format.bluray {
  background: rgba(0, 112, 210, 0.85);
  color: #fff;
  box-shadow: 0 0 10px rgba(0, 112, 210, 0.6);
}

.badge-format.dvd {
  background: rgba(80, 90, 100, 0.85);
  color: #e2e8f0;
}

.badge-format.uhd {
  background: rgba(245, 158, 11, 0.9);
  color: #000;
  font-weight: 900;
}

/* Steelbook Highlight on Card */
.movie-card.is-steelbook {
  border-color: rgba(217, 119, 6, 0.45);
  box-shadow: 0 4px 18px rgba(217, 119, 6, 0.15);
}

.movie-card.is-steelbook:hover {
  border-color: rgba(251, 191, 36, 0.7);
  box-shadow: 0 12px 28px rgba(217, 119, 6, 0.35);
}

.badge-steelbook {
  background: linear-gradient(135deg, #b45309 0%, #78350f 100%);
  color: #fef3c7;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid rgba(251, 191, 36, 0.5);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  line-height: 1.2;
}

.badge-season {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(6, 182, 212, 0.85);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  backdrop-filter: blur(6px);
  z-index: 2;
}

.badge-season.boxset {
  background: rgba(147, 51, 234, 0.88);
  border: 1px solid rgba(192, 132, 252, 0.4);
  box-shadow: 0 0 10px rgba(147, 51, 234, 0.3);
}

.bg-purple {
  background-color: #9333ea !important;
  color: #fff !important;
}

.badge-lent-corner {
  position: absolute;
  top: 0;
  right: 0;
  background: #ef4444;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 3px 8px;
  border-bottom-left-radius: 8px;
  z-index: 3;
}

.badge-rating {
  background: rgba(0, 0, 0, 0.75);
  color: #fbbf24;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(251, 191, 36, 0.3);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  gap: 3px;
}

/* Card Body */
.card-content {
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.movie-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  margin: 0 0 0.3rem 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
}

.movie-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: auto;
}

/* Card Actions Hover Bar */
.card-actions-overlay {
  position: absolute;
  inset: 0;
  background: rgba(12, 16, 23, 0.92);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  gap: 0.6rem;
  z-index: 5;
}

.movie-card:hover .card-actions-overlay {
  opacity: 1;
  pointer-events: auto;
}

.card-actions-overlay .btn {
  width: 100%;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

/* Table View */
.table-cinema {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  color: var(--text-main);
  margin-bottom: 2rem;
}

.table-cinema thead {
  background: #11161d;
  border-bottom: 2px solid var(--border-color);
}

.table-cinema th {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.85rem 1rem;
  vertical-align: middle;
}

.table-cinema td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
  font-size: 0.9rem;
}

.table-cinema tbody tr:hover {
  background: rgba(255, 255, 255, 0.04);
}

.table-thumb {
  width: 44px;
  height: 64px;
  object-fit: cover;
  border-radius: 4px;
  background: #0d1117;
}

/* Modal Styling */
.modal-cinema .modal-content {
  background: #151b23;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  color: var(--text-main);
  box-shadow: 0 20px 50px rgba(0,0,0,0.8);
}

.modal-cinema .modal-header {
  border-bottom: 1px solid var(--border-color);
  padding: 1.25rem 1.5rem;
}

.modal-cinema .modal-footer {
  border-top: 1px solid var(--border-color);
  padding: 1rem 1.5rem;
}

.detail-info-chip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
}

.toast-cinema {
  background: #1f2937;
  color: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
}

/* Footer */
footer.cinema-footer {
  margin-top: auto;
  padding: 2rem 0;
  border-top: 1px solid var(--border-color);
  background: var(--bg-main);
  color: var(--text-dim);
  font-size: 0.85rem;
}
