@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&display=swap');

:root {
  --bg-gradient: linear-gradient(135deg, #000000, #1a1a1a, #0a0a0a);
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.15);
  --text-main: #ffffff;
  --text-muted: #888888;
  --primary-accent: #ffffff;
  --primary-hover: #cccccc;
  --primary-text: #000000;
  --success: #ffffff;
  --warning: #aaaaaa;
  --danger: #555555;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Outfit', system-ui, sans-serif;
  background: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Animations */

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

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

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }

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

@keyframes popIn {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }

  70% {
    transform: scale(1.05);
    opacity: 1;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.5);
  }

  70% {
    transform: scale(1.02);
    box-shadow: 0 0 0 10px rgba(255, 255, 255, 0);
  }

  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
  }
}

.fade-in-up {
  opacity: 0;
  animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.fade-in {
  opacity: 0;
  animation: fadeIn 0.6s ease forwards;
}

.zoom-in {
  opacity: 0;
  animation: zoomIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.slide-in-right {
  opacity: 0;
  animation: slideInRight 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.2s;
}

.pop-in {
  opacity: 0;
  animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards 0.4s;
}

.pulse-animation {
  animation: pulse 2s infinite;
}

/* Layouts */
.home-container,
.results-container {
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 1;
  padding: 2rem;
  box-sizing: border-box;
}

/* Glassmorphism */
.glass-search-box,
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 3rem;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  width: 100%;
  text-align: center;
  box-sizing: border-box;
}

.glass-search-box {
  max-width: 600px;
}

.glass-card {
  max-width: 800px;
  text-align: left;
}

/* Typography */
.brand-logo {
  max-width: 250px;
  height: auto;
  margin-bottom: 0.5rem;
  display: inline-block;
}

.subtitle {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  font-weight: 300;
  letter-spacing: 1px;
}

/* Forms */
.input-group {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.search-input {
  padding: 1rem 1.5rem;
  border-radius: 50px;
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.2);
  color: var(--text-main);
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.title-input {
  flex: 2;
  min-width: 250px;
}

.year-input {
  flex: 1;
  min-width: 120px;
  max-width: 150px;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-accent);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.4);
}

.search-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.search-btn {
  padding: 1rem 2.5rem;
  border-radius: 50px;
  border: none;
  background: var(--primary-accent);
  color: var(--primary-text);
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

.search-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 255, 255, 0.3);
}

.search-btn:active {
  transform: translateY(1px);
}

.alert {
  margin-top: 1.5rem;
  padding: 1rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: var(--text-main);
}

/* Results Card */
.back-link {
  display: inline-flex;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 2rem;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.back-link.hover-lift:hover {
  color: var(--text-main);
  transform: translateX(-4px);
}

.movie-info-wrap {
  display: flex;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.movie-poster {
  width: 220px;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s ease;
}

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

.movie-poster-placeholder {
  width: 220px;
  height: 330px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.2);
  border: 2px dashed rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  color: var(--text-muted);
  font-weight: 300;
  font-size: 1.1rem;
}

.movie-details {
  flex: 1;
  min-width: 250px;
}

.movie-title {
  font-size: 2.5rem;
  margin: 0 0 0.5rem 0;
  font-weight: 700;
  line-height: 1.1;
}

.movie-year {
  font-size: 1.2rem;
  color: var(--primary-accent);
  margin: 0 0 1.5rem 0;
  font-weight: 600;
}

.movie-plot {
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0;
}

.pd-assessment-box {
  padding: 2rem;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.2);
  border-left: 5px solid var(--text-muted);
  position: relative;
  overflow: hidden;
}

.pd-assessment-box h3 {
  margin: 0 0 1rem 0;
  font-size: 1.2rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.status-badge {
  display: inline-block;
  padding: 0.5rem 1.2rem;
  border-radius: 50px;
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 1rem;
  letter-spacing: 1px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.evidence-section {
  text-align: left;
  margin-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1.5rem;
}

.evidence-list {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}

.evidence-list li {
  margin-bottom: 1rem;
  line-height: 1.5;
  font-size: 1.05rem;
  opacity: 0.9;
}

.evidence-links h4 {
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
  opacity: 0.8;
}

.evidence-links ul {
  list-style: none;
  padding: 0;
}

.evidence-links li {
  margin-bottom: 0.5rem;
}

.evidence-links a {
  color: #cccccc;
  text-decoration: underline;
  word-break: break-all;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.evidence-links a:hover {
  color: #ffffff;
}

.link-spinner {
  color: var(--text-muted);
  font-size: 0.9rem;
  opacity: 0.7;
}

/* Status Colors */
.status-high {
  border-left-color: var(--success);
}

.status-high .status-badge {
  background: var(--success);
  color: var(--primary-text);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

.status-medium {
  border-left-color: var(--warning);
}

.status-medium .status-badge {
  background: var(--warning);
  color: var(--primary-text);
  box-shadow: 0 0 15px rgba(170, 170, 170, 0.3);
}

.status-low {
  border-left-color: var(--danger);
}

.status-low .status-badge {
  background: var(--danger);
  color: var(--text-main);
  box-shadow: 0 0 15px rgba(85, 85, 85, 0.3);
}

@media (max-width: 768px) {
  .movie-info-wrap {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .movie-details {
    text-align: center;
  }

  .glass-card {
    text-align: center;
  }

  .brand-logo {
    max-width: 200px;
  }
}

/* ──────────────────────────────────────
   Auth Nav Bar
────────────────────────────────────── */
.app-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  padding: 0.85rem 1.5rem;
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.nav-user {
  font-size: 0.85rem;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

.logout-btn {
  padding: 0.4rem 1.2rem;
  border-radius: 50px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  color: var(--text-muted);
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.25s ease;
  letter-spacing: 0.03em;
}

.logout-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.4);
  color: var(--text-main);
}

/* push page content below the fixed nav */
body:has(.app-nav) .home-container,
body:has(.app-nav) .results-container {
  padding-top: 5rem;
}

/* ──────────────────────────────────────
   Flash Messages
────────────────────────────────────── */
.flash {
  position: fixed;
  top: 4rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  font-size: 0.95rem;
  font-family: 'Outfit', sans-serif;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: fadeInUp 0.4s ease forwards;
  white-space: nowrap;
}

.flash-notice {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
}

.flash-alert {
  background: rgba(255, 80, 80, 0.15);
  border: 1px solid rgba(255, 80, 80, 0.35);
  color: #ffaaaa;
}

/* ──────────────────────────────────────
   Auth / Login Form
────────────────────────────────────── */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  text-align: left;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.auth-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 600;
}

.auth-input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  border-radius: 12px !important;
}

.auth-remember {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.auth-checkbox {
  width: 1rem;
  height: 1rem;
  accent-color: var(--primary-accent);
  cursor: pointer;
}

.auth-remember-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  cursor: pointer;
}

.auth-actions {
  margin-top: 0.5rem;
}

.auth-submit-btn {
  width: 100%;
  border-radius: 12px !important;
  text-align: center;
}

/* ──────────────────────────────────────
   Disambiguation (multiple results)
────────────────────────────────────── */
.disambig-card {
  max-width: 680px;
}

.disambig-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 1.5rem 0 0.4rem;
}

.disambig-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  margin: 0 0 1.8rem;
  font-weight: 300;
}

.disambig-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.disambig-item {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 1rem 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  text-decoration: none;
  color: var(--text-main);
  transition: background 0.2s ease, padding-left 0.2s ease;
  border-radius: 8px;
  cursor: pointer;
}

.disambig-item:hover {
  background: rgba(255, 255, 255, 0.04);
  padding-left: 1rem;
}

.disambig-poster {
  width: 54px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.05);
}

.disambig-poster-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 1.4rem;
  border: 1px dashed rgba(255, 255, 255, 0.15);
}

.disambig-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  text-align: left;
}

.disambig-movie-title {
  font-size: 1.1rem;
  font-weight: 600;
}

.disambig-year {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.disambig-cast {
  font-size: 0.88rem;
  color: var(--text-muted);
  opacity: 0.75;
}

.disambig-arrow {
  font-size: 1.1rem;
  color: var(--text-muted);
  transition: transform 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
}

.disambig-item:hover .disambig-arrow {
  transform: translateX(4px);
  color: var(--text-main);
}

/* ──────────────────────────────────────
   Home page two-column layout
────────────────────────────────────── */
.batch-home {
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.batch-home .glass-search-box {
  width: 100%;
  max-width: 600px;
}

/* ──────────────────────────────────────
   Batch card details
────────────────────────────────────── */
.batch-box {
  text-align: left !important;
}

.batch-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 0.4rem;
  text-align: left;
}

.batch-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0 0 1.4rem;
  line-height: 1.5;
}

.batch-desc code {
  background: rgba(255, 255, 255, 0.08);
  padding: 0.1em 0.4em;
  border-radius: 4px;
  font-size: 0.88em;
  color: var(--text-main);
}

/* Drop zone */
.batch-drop-zone {
  border: 2px dashed rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  padding: 2rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.25s ease, background 0.25s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.batch-drop-zone:hover,
.batch-drop-active {
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.03);
}

.batch-icon {
  width: 36px;
  height: 36px;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.batch-drop-label {
  margin: 0;
  font-size: 1rem;
  color: var(--text-main);
}

.batch-drop-sub {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.batch-browse-btn {
  margin-top: 0.25rem;
  padding: 0.6rem 1.6rem;
  font-size: 0.95rem;
  cursor: pointer;
}

/* Chosen file row */
.batch-file-chosen {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  margin-top: 0.25rem;
}

.batch-file-name {
  flex: 1;
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-main);
}

.batch-clear-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.1rem 0.3rem;
  transition: color 0.2s;
  flex-shrink: 0;
}

.batch-clear-btn:hover {
  color: var(--text-main);
}

/* Submit button */
.batch-submit-btn {
  width: 100%;
  margin-top: 1rem;
  border-radius: 12px !important;
}

/* Progress bar */
.batch-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

.batch-progress-track {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50px;
  height: 6px;
  overflow: hidden;
}

.batch-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--primary-accent);
  border-radius: 50px;
  transition: width 0.4s ease;
}

.progress-pulsing {
  animation: pulse-bg 1.5s infinite ease-in-out;
}

@keyframes pulse-bg {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.6; }
}

/* Done section */
#batch-done-section {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.batch-download-btn {
  display: inline-block;
  margin-top: 1.2rem;
  border-radius: 12px !important;
  text-decoration: none;
}

.batch-text-btn {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 0.75rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  cursor: pointer;
  transition: color 0.2s;
  padding: 0.3rem;
}

.batch-text-btn:hover {
  color: var(--text-main);
}

/* Responsive: stack to single column on small screens */