/* ═══════════════════════════════════════════════════════
   CineReview — Premium Dark Theme CSS
   ═══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Playfair+Display:wght@700;900&display=swap');

/* ── CSS Variables ───────────────────────────────────── */
:root {
  --bg-darkest: #0a0a0f;
  --bg-dark: #0f0f1a;
  --bg-card: #13131f;
  --bg-card-hover: #1a1a2e;
  --accent: #e94560;
  --accent-glow: rgba(233, 69, 96, 0.35);
  --accent2: #f5a623;
  --purple: #7c3aed;
  --text-light: #f0f0f5;
  --text-muted: #d1d1d9;
  --border: rgba(255, 255, 255, 0.07);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.5);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Base ────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-darkest);
  color: var(--text-light);
  overflow-x: hidden;
  line-height: 1.6;
}

/* ── Scrollbar ───────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 3px;
}

/* ── Utility ─────────────────────────────────────────── */
.text-accent {
  color: var(--accent) !important;
}

.text-gradient {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.fw-black {
  font-weight: 900;
}

.z-1 {
  z-index: 1;
}

.min-vh-50 {
  min-height: 50vh;
}

.text-muted {
  color: var(--text-muted) !important;
}

/* ═══════════════════════ NAVBAR ══════════════════════ */
#mainNav {
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
  transition: var(--transition);
}

.brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: #fff;
}

.brand-text {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-light);
  letter-spacing: -0.5px;
}

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

.nav-link {
  color: var(--text-muted) !important;
  font-weight: 500;
  font-size: 0.9rem;
  transition: var(--transition);
  padding: 6px 12px !important;
  border-radius: var(--radius-sm);
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-light) !important;
  background: var(--border);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent), #c73652);
  color: #fff !important;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
  transition: var(--transition);
}

.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--accent-glow);
}

/* ═══════════════════════ HERO ════════════════════════ */
.hero-section {
  position: relative;
  background: var(--bg-darkest);
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 10% 40%, rgba(233, 69, 96, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 90% 20%, rgba(124, 58, 237, 0.10) 0%, transparent 60%);
  pointer-events: none;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.015'%3E%3Ccircle cx='30' cy='30' r='1'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  background: rgba(233, 69, 96, 0.15);
  border: 1px solid rgba(233, 69, 96, 0.3);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 30px;
  letter-spacing: 0.5px;
}

.hero-title {
  font-family: 'Playfair Display', serif;
  line-height: 1.1;
  color: var(--text-light);
}

.hero-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 520px;
  line-height: 1.7;
}

.btn-primary-custom {
  background: linear-gradient(135deg, var(--accent), #c73652);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  transition: var(--transition);
}

.btn-primary-custom:hover {
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 10px 30px var(--accent-glow);
}

.btn-outline-custom {
  background: transparent;
  color: var(--text-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-weight: 600;
  transition: var(--transition);
}

.btn-outline-custom:hover {
  background: var(--bg-card);
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-3px);
}

/* Hero Stats */
.hero-stats {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
  max-width: 200px;
}

.stat-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  backdrop-filter: blur(10px);
  transition: var(--transition);
}

.stat-card:hover {
  border-color: var(--accent);
  transform: translateX(-6px);
}

.stat-icon {
  font-size: 1.5rem;
  color: var(--accent);
  margin-bottom: 8px;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--text-light);
  line-height: 1;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ═══════════════════════ SECTIONS ════════════════════ */
.section-dark {
  background: var(--bg-dark);
}

.section-darker {
  background: var(--bg-darkest);
}

.section-header {
  text-align: center;
}

.section-badge {
  display: inline-flex;
  align-items: center;
  background: rgba(233, 69, 96, 0.12);
  border: 1px solid rgba(233, 69, 96, 0.25);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 30px;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.section-title {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-light);
  margin-bottom: 10px;
}

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

.btn-refresh {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: 8px 20px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: var(--transition);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.btn-refresh:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ═══════════════════════ MOVIE CARD ══════════════════ */
.movie-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  height: 100%;
  transition: var(--transition);
  box-shadow: var(--shadow-card);
}

.movie-card:hover {
  transform: translateY(-8px);
  border-color: rgba(233, 69, 96, 0.4);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(233, 69, 96, 0.15);
}

.movie-poster-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 2/3;
}

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

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

.movie-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10, 10, 15, 0.9) 0%, transparent 50%);
  opacity: 0;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px;
}

.movie-card:hover .movie-overlay {
  opacity: 1;
}

.movie-genre-badge {
  align-self: flex-start;
  background: rgba(233, 69, 96, 0.85);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  backdrop-filter: blur(6px);
}

.btn-use-review {
  align-self: flex-end;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
  backdrop-filter: blur(6px);
}

.btn-use-review:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.rating-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(10, 10, 15, 0.8);
  color: var(--accent2);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  gap: 5px;
}

.movie-body {
  padding: 18px;
}

.movie-year {
  font-size: 0.72rem;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.movie-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 10px;
  line-height: 1.3;
}

.movie-synopsis {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 12px;
}

/* Staggered fade-in driven by JS data-delay attribute */
.movie-fadein {
  opacity: 0;
  animation: fadeInUp 0.5s ease forwards;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.movie-cast {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: flex;
  align-items: flex-start;
}

.movie-rating-bar {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.rating-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 2px;
}

/* Refresh Card */
.refresh-card {
  border: 2px dashed var(--border);
  background: transparent;
  min-height: 300px;
}

.refresh-icon {
  font-size: 3rem;
  color: var(--text-muted);
  animation: spin-slow 4s linear infinite;
}

@keyframes spin-slow {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* ═══════════════════════ SEARCH ══════════════════════ */
.search-wrapper {
  position: relative;
}

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

.search-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-light);
  border-radius: 50px;
  padding: 12px 20px 12px 44px;
  font-size: 0.9rem;
  font-family: 'Inter', sans-serif;
  transition: var(--transition);
  outline: none;
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

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

/* ═══════════════════════ MINI CARDS ══════════════════ */
.movie-card-mini {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
}

.movie-card-mini:hover {
  border-color: rgba(233, 69, 96, 0.4);
  transform: translateY(-4px);
}

.mini-poster-wrap {
  position: relative;
  aspect-ratio: 2/3;
  overflow: hidden;
}

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

.movie-card-mini:hover .mini-poster {
  transform: scale(1.08);
}

.mini-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 15, 0.8);
  opacity: 0;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.movie-card-mini:hover .mini-overlay {
  opacity: 1;
}

.mini-rating {
  color: var(--accent2);
  font-size: 0.9rem;
  font-weight: 700;
}

.mini-review-btn {
  background: var(--accent);
  border: none;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 20px;
  cursor: pointer;
  transition: var(--transition);
}

.mini-review-btn:hover {
  background: #c73652;
  transform: scale(1.05);
}

.mini-info {
  padding: 10px 12px;
}

.mini-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-light);
  line-height: 1.3;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ═══════════════════════ NLP CARD ════════════════════ */
.nlp-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow-card);
}

.form-label-custom {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.form-select-custom {
  width: 100%;
  background: var(--bg-darkest);
  border: 1px solid var(--border);
  color: var(--text-light);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.9rem;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: var(--transition);
  cursor: pointer;
}

.form-select-custom:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-select-custom option {
  background: var(--bg-card);
}

.selected-movie-banner {
  background: rgba(233, 69, 96, 0.1);
  border: 1px solid rgba(233, 69, 96, 0.25);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-light);
  display: flex;
  align-items: center;
}

.review-textarea {
  width: 100%;
  background: var(--bg-darkest);
  border: 1px solid var(--border);
  color: var(--text-light);
  border-radius: var(--radius-md);
  padding: 16px;
  font-size: 0.9rem;
  font-family: 'Inter', sans-serif;
  line-height: 1.65;
  resize: vertical;
  outline: none;
  transition: var(--transition);
}

.review-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.review-textarea::placeholder {
  color: var(--text-muted);
}

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

/* Example Pills */
.example-pill {
  background: var(--bg-darkest);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 5px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: var(--transition);
}

.positive-pill:hover {
  border-color: #22c55e;
  color: #22c55e;
  background: rgba(34, 197, 94, 0.08);
}

.negative-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(233, 69, 96, 0.08);
}

.neutral-pill:hover {
  border-color: var(--text-muted);
  color: var(--text-light);
}

/* Analyze Button */
.btn-analyze {
  background: linear-gradient(135deg, var(--accent) 0%, #c73652 50%, var(--purple) 100%);
  background-size: 200% 200%;
  border: none;
  border-radius: var(--radius-md);
  padding: 15px;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  transition: all 0.4s ease;
  position: relative;
  overflow: hidden;
}

.btn-analyze::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent);
  opacity: 0;
  transition: var(--transition);
}

.btn-analyze:hover {
  background-position: right center;
  transform: translateY(-2px);
  box-shadow: 0 10px 30px var(--accent-glow);
}

.btn-analyze:hover::before {
  opacity: 1;
}

.btn-analyze:active {
  transform: scale(0.98);
}

.btn-analyze:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-analyze-inner {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Result Panel */
.result-panel {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  animation: slideUp 0.4s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.result-inner {
  padding: 24px;
}

.result-panel.positive {
  border-color: rgba(34, 197, 94, 0.4);
  background: rgba(34, 197, 94, 0.06);
}

.result-panel.negative {
  border-color: rgba(233, 69, 96, 0.4);
  background: rgba(233, 69, 96, 0.06);
}

.result-header {
  display: flex;
  align-items: center;
  gap: 16px;
}

.result-icon {
  font-size: 2.5rem;
}

.result-label {
  font-size: 1.4rem;
  font-weight: 800;
}

.result-panel.positive .result-label {
  color: #22c55e;
}

.result-panel.negative .result-label {
  color: var(--accent);
}

.result-movie {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.confidence-bar {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.confidence-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.8s ease;
}

.result-panel.positive .confidence-fill {
  background: linear-gradient(90deg, #16a34a, #22c55e);
}

.result-panel.negative .confidence-fill {
  background: linear-gradient(90deg, #c73652, var(--accent));
}

.confidence-value {
  font-weight: 700;
  font-size: 0.85rem;
}

.result-panel.positive .confidence-value {
  color: #22c55e;
}

.result-panel.negative .confidence-value {
  color: var(--accent);
}

.result-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.meta-chip {
  background: var(--border);
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 4px 12px;
  border-radius: 20px;
}

/* Error Alert */
.error-alert {
  background: rgba(233, 69, 96, 0.08);
  border: 1px solid rgba(233, 69, 96, 0.3);
  color: var(--accent);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
}

/* ═══════════════════════ HOW IT WORKS ════════════════ */
.how-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px 20px;
  transition: var(--transition);
}

.how-card:hover {
  border-color: var(--accent);
  transform: translateY(-6px);
}

.how-number {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 2px;
  margin-bottom: 12px;
}

.how-icon {
  font-size: 2rem;
  color: var(--text-muted);
}

.how-card:hover .how-icon {
  color: var(--accent);
}

/* ═══════════════════════ FOOTER ══════════════════════ */
.footer {
  background: var(--bg-darkest);
  border-top: 1px solid var(--border);
}

/* ═══════════════════════ LOADING ══════════════════════ */
.spinner-ring {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ═══════════════════════ RESPONSIVE ══════════════════ */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2rem;
  }

  .section-title {
    font-size: 1.7rem;
  }

  .nlp-card {
    padding: 20px;
  }

  .how-card {
    margin-bottom: 16px;
  }
}