/* Design Tokens & CSS Variables */
:root {
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* HSL Color Palette */
  --bg-main: hsl(220, 25%, 8%);
  --bg-card: hsla(220, 20%, 14%, 0.6);
  --bg-card-hover: hsla(220, 20%, 18%, 0.85);
  --border-glass: hsla(220, 20%, 25%, 0.35);
  --border-focus: hsla(45, 100%, 55%, 0.5);
  
  --color-text: hsl(210, 20%, 90%);
  --color-text-muted: hsl(210, 10%, 65%);
  --color-accent: hsl(45, 100%, 52%); /* Gold/Yellow branding */
  --color-accent-hover: hsl(42, 100%, 46%);
  
  --color-success: hsl(142, 70%, 45%);
  --color-error: hsl(350, 75%, 50%);
  --color-danger: hsl(0, 75%, 55%);
  
  --shadow-premium: 0 12px 40px -12px hsla(0, 0%, 0%, 0.7);
  --shadow-glow: 0 0 20px -3px hsla(45, 100%, 50%, 0.25);
  --transition-smooth: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  background-color: var(--bg-main);
  color: var(--color-text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Glassmorphism Card Template */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  box-shadow: var(--shadow-premium);
  transition: var(--transition-smooth);
  will-change: transform, border-color, box-shadow;
}

/* Navigation Header */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: hsla(220, 25%, 8%, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-glass);
  height: 70px;
}

.navbar-container {
  max-width: 1300px;
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: 1px;
}

.logo-icon {
  color: var(--color-accent);
  filter: drop-shadow(0 0 6px hsla(45, 100%, 50%, 0.6));
}

.accent {
  color: var(--color-accent);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition-smooth);
  border: 1px solid transparent;
}

.btn-primary {
  background-color: var(--color-accent);
  color: hsl(220, 25%, 8%);
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
  background-color: var(--color-accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 0 25px -2px hsla(45, 100%, 50%, 0.4);
}

.btn-secondary {
  background-color: transparent;
  color: var(--color-text);
  border-color: var(--border-glass);
}

.btn-secondary:hover {
  background-color: hsla(210, 100%, 100%, 0.05);
  border-color: var(--color-text-muted);
}

.btn-danger {
  background-color: transparent;
  color: var(--color-danger);
  border-color: hsla(0, 75%, 55%, 0.2);
}

.btn-danger:hover {
  background-color: hsla(0, 75%, 55%, 0.15);
  border-color: var(--color-danger);
}

/* Container */
.main-container {
  max-width: 1300px;
  width: 100%;
  margin: 0 auto;
  padding: 40px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

/* Admin Dashboard Panel */
.admin-panel {
  animation: slideDown 0.4s ease-out;
}

.admin-card {
  padding: 24px;
}

.admin-card h3 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.subtitle {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  margin-bottom: 20px;
}

.import-form {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.input-group {
  flex: 1;
  min-width: 280px;
  position: relative;
}

.input-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
}

.input-group input {
  width: 100%;
  padding: 12px 16px 12px 46px;
  background-color: hsla(220, 20%, 6%, 0.6);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: var(--transition-smooth);
}

.input-group input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--border-focus);
}

/* Hero Section */
.hero-section {
  text-align: center;
  padding: 20px 0;
}

.hero-section h1 {
  font-family: var(--font-heading);
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #fff 30%, var(--color-accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  color: var(--color-text-muted);
  font-size: 1.1rem;
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Section Headings */
.section-title {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Films Grid & Cards */
.films-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 30px;
}

.film-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  content-visibility: auto;
  contain-intrinsic-size: 550px; /* Estimated height to avoid layout shift */
  will-change: transform, border-color, box-shadow;
  transform: translate3d(0, 0, 0); /* Force GPU compositing layer */
}

.film-card:hover {
  transform: translate3d(0, -5px, 0);
  border-color: hsla(45, 100%, 55%, 0.25);
  box-shadow: var(--shadow-premium), var(--shadow-glow);
}

.card-header-img {
  position: relative;
  height: 220px;
  overflow: hidden;
}

.film-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-smooth);
}

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

.image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, transparent 40%, hsla(220, 25%, 8%, 0.95));
}

.trailer-badge-btn {
  position: absolute;
  bottom: 16px;
  right: 16px;
  background: hsla(220, 25%, 8%, 0.7);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-glass);
  color: var(--color-accent);
  padding: 8px 14px;
  border-radius: 30px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition-smooth);
}

.trailer-badge-btn:hover {
  background-color: var(--color-accent);
  color: hsl(220, 25%, 8%);
  transform: scale(1.05);
}

.card-content {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}

.film-meta-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.film-titles {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.film-title-en {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
}

.film-title-he {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  color: var(--color-accent);
  text-align: right;
  direction: rtl;
}

.film-director {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.tag-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  background-color: hsla(210, 100%, 100%, 0.04);
  border: 1px solid var(--border-glass);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

.synopsis-text {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--color-text);
  margin-top: 4px;
  white-space: pre-wrap;
}

.synopsis-text.rtl, .rtl {
  direction: rtl !important;
  text-align: right !important;
}

.read-more-btn {
  background: none;
  border: none;
  color: var(--color-accent);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0 4px;
  text-decoration: underline;
}

/* Screening Selection Checkbox Grid */
.screenings-list-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  margin-top: 10px;
  border-top: 1px solid var(--border-glass);
  padding-top: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.screenings-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 6px;
}

/* Custom Scrollbar for screenings */
.screenings-container::-webkit-scrollbar,
.matrix-wrapper::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.screenings-container::-webkit-scrollbar-thumb,
.matrix-wrapper::-webkit-scrollbar-thumb {
  background-color: var(--border-glass);
  border-radius: 4px;
}

.screening-row {
  background-color: hsla(210, 100%, 100%, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: var(--transition-smooth);
}

.screening-row:hover {
  background-color: hsla(210, 100%, 100%, 0.04);
}

.scr-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.scr-time {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 600;
}

.scr-venue {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.scr-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Standardized Custom RSVP Checkbox */
.rsvp-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.rsvp-checkbox-label span {
  font-size: 0.8rem;
  font-weight: 600;
}

.ticket-link-icon,
.calendar-link-icon {
  color: var(--color-accent);
  font-size: 1.05rem;
  transition: var(--transition-smooth);
  display: inline-flex;
}

.ticket-link-icon:hover,
.calendar-link-icon:hover {
  color: var(--color-accent-hover);
  transform: scale(1.15);
}

.card-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-glass);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Coordination Matrix Table */
.matrix-card {
  padding: 30px;
}

.matrix-wrapper {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid var(--border-glass);
}

.matrix-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
}

.matrix-table th {
  background-color: hsla(220, 20%, 6%, 0.8);
  font-family: var(--font-heading);
  font-weight: 600;
  padding: 14px 20px;
  border-bottom: 2px solid var(--border-glass);
  color: var(--color-text-muted);
}

.matrix-table td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-glass);
  vertical-align: middle;
}

.matrix-table tbody tr:last-child td {
  border-bottom: none;
}

.matrix-table tbody tr:hover {
  background-color: hsla(210, 100%, 100%, 0.015);
}

.matrix-title {
  font-family: var(--font-heading);
  font-weight: 600;
}

.matrix-venue {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.attendees-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.attendee-badge {
  background-color: hsla(45, 100%, 52%, 0.1);
  border: 1px solid hsla(45, 100%, 52%, 0.25);
  color: var(--color-accent);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.attendee-badge .remove-badge-btn {
  background: none;
  border: none;
  color: var(--color-danger);
  cursor: pointer;
  font-size: 0.75rem;
}

.empty-badge-info {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  font-style: italic;
}

.join-matrix-btn {
  padding: 6px 12px;
  font-size: 0.8rem;
}

/* Modals Lightboxes */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: var(--transition-smooth);
}

.modal.hidden {
  opacity: 0;
  pointer-events: none;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(4, 6, 12, 0.85);
  backdrop-filter: blur(8px);
}

.modal-content {
  position: relative;
  z-index: 1010;
  width: 90%;
  max-width: 850px;
  background-color: var(--bg-main);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
  animation: modalFadeIn 0.3s ease-out;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: rgba(0, 0, 0, 0.4);
  border: none;
  color: var(--color-text);
  font-size: 1.4rem;
  cursor: pointer;
  z-index: 10;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.modal-close:hover {
  background-color: var(--color-danger);
  color: white;
}

.video-container {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 ratio */
  height: 0;
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* RSVP Dialog Modal */
.rsvp-content {
  max-width: 420px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.rsvp-info {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
}

/* States & Micro-interactions */
.hidden {
  display: none !important;
}

.message {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.95rem;
  margin-top: 16px;
  font-weight: 500;
  animation: slideDown 0.3s ease-out;
}

.message-success {
  background-color: hsla(142, 70%, 45%, 0.15);
  border: 1px solid hsla(142, 70%, 45%, 0.3);
  color: var(--color-success);
}

.message-error {
  background-color: hsla(350, 75%, 50%, 0.15);
  border: 1px solid hsla(350, 75%, 50%, 0.3);
  color: var(--color-error);
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  background-color: hsla(210, 100%, 100%, 0.015);
  border: 1px dashed var(--border-glass);
  border-radius: 16px;
  color: var(--color-text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.empty-state i {
  font-size: 2.2rem;
  color: hsla(45, 100%, 52%, 0.35);
}

.empty-table {
  text-align: center;
  color: var(--color-text-muted);
  font-style: italic;
  padding: 30px !important;
}

/* Spinner Animation */
.spinner {
  font-size: 1.1rem;
}

/* Animations */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Profile Banner Styling */
.profile-card-banner {
  padding: 20px 24px;
  margin-bottom: 20px;
  animation: slideDown 0.35s ease-out;
}

.profile-prompt-view, .profile-active-view {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.prompt-text-group, .active-profile-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.prompt-icon {
  font-size: 1.8rem;
  color: var(--color-accent);
  filter: drop-shadow(0 0 4px hsla(45, 100%, 50%, 0.4));
}

.profile-card-banner h4 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.profile-card-banner p {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.profile-form {
  display: flex;
  gap: 10px;
}

.profile-form input {
  padding: 8px 12px;
  background-color: hsla(220, 20%, 6%, 0.6);
  border: 1px solid var(--border-glass);
  border-radius: 6px;
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 0.9rem;
}

.profile-form input:focus {
  outline: none;
  border-color: var(--color-accent);
}

.user-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background-color: hsla(45, 100%, 52%, 0.15);
  border: 1px solid var(--color-accent);
  color: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

/* Highlight user's own attendee badge in matrix */
.attendee-badge.badge-self {
  background-color: hsla(45, 100%, 52%, 0.25) !important;
  border-color: var(--color-accent) !important;
  color: #fff !important;
  box-shadow: 0 0 10px -2px hsla(45, 100%, 50%, 0.4);
}

/* Footer */
.footer {
  text-align: center;
  padding: 30px;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border-glass);
  margin-top: 60px;
}

/* Responsive Rules */
@media (max-width: 768px) {
  .hero-section h1 {
    font-size: 2rem;
  }
  
  .films-grid {
    grid-template-columns: 1fr;
  }
  
  .import-form {
    flex-direction: column;
  }
  
  .import-btn {
    width: 100%;
  }
}

.schedules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 15px;
}
