* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  color: #f3f5f7;
  background-image: url('/static/Movie/bg.jpg');
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-position: center;
  background-color: #14161b;
  min-height: 100vh;
}

.page {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 24px 40px;
}

.header {
  text-align: center;
  margin-bottom: 30px;
}

h1 {
  margin: 0 0 8px;
  font-size: 38px;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
}

.subtitle {
  margin: 0 auto;
  max-width: 720px;
  font-size: 15px;
  line-height: 1.55;
  color: rgba(243, 245, 247, 0.85);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.movie-section {
  margin-bottom: 26px;
}

.section-title {
  margin: 0 0 4px;
  font-size: 24px;
  letter-spacing: 0.3px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
}

.section-subtitle {
  margin: 0 0 14px;
  font-size: 14px;
  color: rgba(243, 245, 247, 0.75);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

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

.carousel-viewport {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55);
  background: #14161b;
  touch-action: pan-y;
}

.carousel-track {
  display: flex;
  transition: transform 0.35s ease;
}

.poster-card {
  position: relative;
  flex: 0 0 100%;
  padding: 0;
  border: none;
  overflow: hidden;
  cursor: pointer;
  background: #1a1d24;
  -webkit-tap-highlight-color: transparent;
}

.poster-card.active {
  outline: none;
}

.poster-card img {
  display: block;
  width: 100%;
  height: 430px;
  object-fit: cover;
  cursor: zoom-in;
}

.poster-name {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 14px;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  color: #fff;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0));
}

.carousel-arrow {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background-color: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-arrow:hover {
  background-color: #e50914;
  border-color: #e50914;
}

.carousel-arrow:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  background-color: rgba(0, 0, 0, 0.35);
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: none;
  background-color: rgba(255, 255, 255, 0.25);
  cursor: pointer;
  padding: 0;
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.carousel-dot.active {
  background-color: #e50914;
  transform: scale(1.35);
}

.card {
  background: linear-gradient(180deg, rgba(28, 31, 38, 0.94), rgba(18, 20, 26, 0.94));
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.card-title {
  margin: 0;
  font-size: 22px;
}

.movie-badge {
  font-size: 12.5px;
  color: #ffd7da;
  background-color: rgba(229, 9, 20, 0.16);
  border: 1px solid rgba(229, 9, 20, 0.45);
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(243, 245, 247, 0.7);
  margin-bottom: 10px;
}

.user-input {
  width: 100%;
  min-height: 120px;
  padding: 14px 16px;
  font-size: 15px;
  line-height: 1.55;
  font-family: inherit;
  color: #f3f5f7;
  background-color: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  resize: vertical;
}

.user-input:focus {
  outline: none;
  border-color: #e50914;
  box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.25);
}

.user-input::placeholder {
  color: rgba(243, 245, 247, 0.45);
}

.examples {
  margin-top: 16px;
}

.examples-title {
  display: block;
  font-size: 13px;
  color: rgba(243, 245, 247, 0.6);
  margin-bottom: 8px;
}

.example-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  background-color: rgba(255, 255, 255, 0.08);
  color: #f3f5f7;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.chip:hover {
  background-color: rgba(255, 255, 255, 0.16);
}

#submit-btn {
  display: block;
  width: 100%;
  margin-top: 16px;
  background-color: #e50914;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 13px 20px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

#submit-btn:hover {
  background-color: #f6121d;
}

#submit-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 20px;
  margin-top: 18px;
  font-size: 12.5px;
  color: rgba(243, 245, 247, 0.65);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot-positive {
  background-color: #7bd88f;
}

.dot-neutral {
  background-color: #f0c674;
}

.dot-negative {
  background-color: #ff8080;
}

.result-box {
  display: none;
  margin-top: 20px;
  padding: 16px 20px;
  border-radius: 10px;
  text-align: center;
  background-color: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.result-label {
  display: block;
  font-size: 30px;
  font-weight: 700;
}

.result-box.positive .result-label {
  color: #7bd88f;
}

.result-box.neutral .result-label {
  color: #f0c674;
}

.result-box.negative .result-label {
  color: #ff8080;
}

.result-box.error .result-label {
  color: #ffb3b3;
}

.confidence-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.confidence-text {
  font-size: 12.5px;
  color: rgba(243, 245, 247, 0.65);
  white-space: nowrap;
}

.confidence-bar {
  flex: 1;
  height: 8px;
  background-color: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  overflow: hidden;
}

.confidence-fill {
  height: 100%;
  width: 0%;
  background-color: #e50914;
  border-radius: 999px;
  transition: width 0.4s ease;
}

.confidence-value {
  font-size: 13px;
  font-weight: 600;
  color: #f3f5f7;
  min-width: 42px;
  text-align: right;
}

.result-text {
  margin: 12px 0 0;
  font-size: 14px;
  color: rgba(243, 245, 247, 0.75);
}

.word-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
}

.word-tag {
  background-color: rgba(229, 9, 20, 0.16);
  border: 1px solid rgba(229, 9, 20, 0.45);
  color: #ffd7da;
  border-radius: 6px;
  padding: 3px 9px;
  font-size: 12.5px;
  font-weight: 600;
}

.footer {
  margin-top: 24px;
  text-align: center;
  font-size: 12.5px;
  color: rgba(243, 245, 247, 0.6);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.92);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.lightbox.open {
  opacity: 1;
  visibility: visible;
}

.lightbox-stage {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: grab;
}

.lightbox-stage.panning {
  cursor: grabbing;
}

#lightbox-img {
  max-width: 90vw;
  max-height: 80vh;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
  user-select: none;
  transform-origin: center center;
  transition: transform 0.15s ease;
}

.lightbox-controls {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background-color: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
}

.zoom-btn {
  min-width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.zoom-btn:hover {
  background-color: #e50914;
}

.zoom-level {
  min-width: 52px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: #f3f5f7;
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 20px;
  width: 46px;
  height: 46px;
  font-size: 28px;
  line-height: 1;
  color: #fff;
  background-color: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  cursor: pointer;
}

.lightbox-close:hover {
  background-color: #e50914;
  border-color: #e50914;
}

.lightbox-hint {
  position: absolute;
  bottom: 76px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12.5px;
  color: rgba(243, 245, 247, 0.7);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
  pointer-events: none;
}

@media (max-width: 900px) {
  .carousel-arrow {
    width: 38px;
    height: 38px;
    font-size: 24px;
  }

  .poster-card img {
    height: 360px;
  }
}

@media (max-width: 600px) {
  h1 {
    font-size: 26px;
  }

  .carousel {
    gap: 6px;
  }

  .poster-card img {
    height: 300px;
  }

  .card {
    padding: 20px;
  }

  .card-head {
    flex-direction: column;
    align-items: flex-start;
  }

  #lightbox-img {
    max-width: 94vw;
    max-height: 74vh;
  }

  .lightbox-controls {
    bottom: 16px;
  }

  .lightbox-hint {
    bottom: 68px;
  }
}
