/* ==========================================================================
   OMDb & TMDb Fetcher — Dedicated Stylesheet
   skullnbones.org | tools/fetcher/fetcher.css
   ========================================================================== */

/* Control Panels & Containers */
.fetcher-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
  position: relative;
}

.panel-step-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--cyan-primary);
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.instructions-card {
  background: rgba(10, 6, 18, 0.75);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--cyan-primary);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
}

.instructions-card h2 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--cyan-primary);
  margin-bottom: 0.5rem;
}

.instructions-card ul {
  list-style: none;
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.instructions-card code {
  background: rgba(0, 242, 254, 0.1);
  color: var(--cyan-primary);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.8rem;
}

/* Form Controls & API Grid */
.api-key-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.input-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.4rem;
}

.fetcher-input-text {
  width: 100%;
  background: rgba(10, 6, 18, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: #fff;
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.fetcher-input-text:focus,
.fetcher-textarea:focus {
  outline: none;
  border-color: var(--cyan-primary);
  box-shadow: 0 0 12px var(--cyan-glow);
}

.fetcher-textarea {
  width: 100%;
  min-height: 110px;
  background: rgba(10, 6, 18, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 1rem;
  color: #fff;
  font-family: inherit;
  font-size: 0.9rem;
  resize: vertical;
  margin-bottom: 1.25rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.btn-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-cyan {
  background: linear-gradient(135deg, var(--cyan-primary), #00a8cc);
  color: #000;
  border: none;
  padding: 0.75rem 1.75rem;
  border-radius: 8px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 0 15px var(--cyan-glow);
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-cyan:hover:not(:disabled) {
  background: linear-gradient(135deg, #38f9d7, var(--cyan-primary));
  box-shadow: 0 0 25px var(--cyan-primary);
  transform: translateY(-2px);
}

.btn-cyan:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Step 1 Title Match Result Tree */
.title-results-box {
  background: rgba(10, 6, 18, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 1rem;
  max-height: 380px;
  overflow-y: auto;
}

.title-match-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid rgba(155, 77, 255, 0.1);
  transition: background 0.2s;
}

.title-match-row:hover {
  background: rgba(155, 77, 255, 0.1);
}

.title-match-info {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.title-match-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
}

.title-match-year {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.title-match-id {
  font-size: 0.75rem;
  color: var(--cyan-primary);
  background: rgba(0, 242, 254, 0.1);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}

.btn-add-id {
  background: rgba(0, 242, 254, 0.15);
  border: 1px solid var(--cyan-primary);
  color: var(--cyan-primary);
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-add-id:hover {
  background: var(--cyan-primary);
  color: #000;
  box-shadow: 0 0 10px var(--cyan-glow);
}

/* Status Alert */
.status-alert {
  display: none;
  padding: 1rem 1.25rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.status-alert.loading {
  background: rgba(0, 242, 254, 0.15);
  border: 1px solid var(--cyan-primary);
  color: var(--cyan-primary);
}

.status-alert.error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid #ef4444;
  color: #fca5a5;
}

/* Step 2 Result Cards Grid */
.fetcher-movie-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.fetcher-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  gap: 1.25rem;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  transition: all 0.25s ease;
}

.fetcher-card:hover {
  border-color: var(--cyan-primary);
  box-shadow: 0 10px 25px var(--cyan-glow);
}

.poster-column {
  width: 120px;
  min-width: 120px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.movie-poster-frame {
  width: 100%;
  aspect-ratio: 2 / 3;
  background: #08040f;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  background-size: cover;
  background-position: center;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
}

.poster-source-tag {
  position: absolute;
  bottom: 4px;
  left: 4px;
  right: 4px;
  background: rgba(10, 6, 18, 0.85);
  font-size: 0.6rem;
  font-weight: 800;
  color: #fff;
  padding: 0.15rem 0.25rem;
  border-radius: 3px;
  text-align: center;
  backdrop-filter: blur(4px);
}

.btn-switch-poster {
  width: 100%;
  background: rgba(155, 77, 255, 0.15);
  border: 1px solid var(--purple-primary);
  color: #fff;
  padding: 0.35rem 0.4rem;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-switch-poster:hover {
  background: var(--purple-primary);
  color: #000;
}

.poster-direct-links {
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
}

.poster-direct-links a {
  color: var(--cyan-primary);
  text-decoration: none;
  font-weight: 700;
}

.poster-direct-links a:hover {
  text-decoration: underline;
}

.movie-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.movie-title-bar {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.4rem;
}

.movie-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
}

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

.movie-id-badge {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  background: rgba(155, 77, 255, 0.15);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.movie-meta-details {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.rt-badge {
  color: #fa320a;
  font-weight: 700;
}

.movie-overview {
  font-size: 0.8rem;
  color: #d1d5db;
  line-height: 1.5;
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-grow: 1;
}

.metadata-pills {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  border-top: 1px solid rgba(155, 77, 255, 0.1);
  padding-top: 0.5rem;
}

.meta-pill strong {
  color: #fff;
}

@media (max-width: 650px) {
  .fetcher-card {
    flex-direction: column;
  }
  .poster-column {
    width: 100%;
    align-items: center;
  }
  .movie-poster-frame {
    width: 140px;
  }
}