/* TV & Movie Watch Tracker Scoped Styles */

:root {
  --tmwt-primary: #7c3aed;
  --tmwt-primary-hover: #6d28d9;
  --tmwt-bg: #f8fafc;
  --tmwt-card-bg: #ffffff;
  --tmwt-border: #e2e8f0;
  --tmwt-text: #0f172a;
  --tmwt-muted: #64748b;
  --tmwt-watching-bg: #ede9fe;
  --tmwt-watching-text: #6d28d9;
  --tmwt-completed-bg: #dcfce7;
  --tmwt-completed-text: #15803d;
  --tmwt-plan-bg: #e0f2fe;
  --tmwt-plan-text: #0369a1;
  --tmwt-dropped-bg: #fee2e2;
  --tmwt-dropped-text: #b91c1c;
}

body {
  margin: 0;
  line-height: 1.5;
}

.tmwt-main {
  max-width: 1040px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

/* Hero */
.tmwt-hero-section {
  text-align: center;
  margin-bottom: 2rem;
}

.tmwt-title {
  font-size: 2.15rem;
  font-weight: 800;
  color: var(--tmwt-text);
  margin: 0 0 0.5rem;
  letter-spacing: -0.025em;
}

.tmwt-subtitle {
  font-size: 1.05rem;
  color: var(--tmwt-muted);
  max-width: 720px;
  margin: 0 auto;
}

/* Container */
.tmwt-container {
  background: var(--tmwt-card-bg);
  border: 1px solid var(--tmwt-border);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

/* Quick Add Form */
.tmwt-add-card {
  background: var(--tmwt-bg);
  border: 1px solid var(--tmwt-border);
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.tmwt-add-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--tmwt-text);
  margin: 0 0 1rem;
}

.tmwt-add-grid {
  display: grid;
  grid-template-columns: 2.2fr 1fr 1fr 1fr auto;
  gap: 0.75rem;
  align-items: end;
  margin-bottom: 1rem;
}

@media (max-width: 840px) {
  .tmwt-add-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 540px) {
  .tmwt-add-grid {
    grid-template-columns: 1fr;
  }
}

.tmwt-add-col-title, .tmwt-add-col-type, .tmwt-add-col-genre, .tmwt-add-col-status, .tmwt-add-col-btn {
  display: flex;
  flex-direction: column;
}

.tmwt-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--tmwt-text);
  margin-bottom: 0.35rem;
}

.tmwt-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.tmwt-text-input, .tmwt-select {
  width: 100%;
  padding: 0.75rem 0.85rem;
  font-size: 0.95rem;
  background: var(--tmwt-card-bg);
  border: 1px solid var(--tmwt-border);
  border-radius: 8px;
  color: var(--tmwt-text);
  min-height: 44px;
  box-sizing: border-box;
}

.tmwt-text-input:focus, .tmwt-select:focus {
  outline: none;
  border-color: var(--tmwt-primary);
}

.tmwt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  min-height: 44px;
  transition: all 0.2s;
  box-sizing: border-box;
  white-space: nowrap;
}

.tmwt-btn-primary {
  background-color: var(--tmwt-primary);
  color: #ffffff;
}

.tmwt-btn-primary:hover {
  background-color: var(--tmwt-primary-hover);
}

.tmwt-btn-secondary {
  background-color: var(--tmwt-card-bg);
  border-color: var(--tmwt-border);
  color: var(--tmwt-text);
}

.tmwt-btn-secondary:hover {
  border-color: var(--tmwt-primary);
  color: var(--tmwt-primary);
}

.tmwt-suggestions-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
}

.tmwt-sugg-lbl {
  color: var(--tmwt-muted);
  font-weight: 600;
}

.tmwt-sugg-btn {
  background: var(--tmwt-card-bg);
  border: 1px solid var(--tmwt-border);
  border-radius: 6px;
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
  color: var(--tmwt-primary);
  cursor: pointer;
  min-height: 36px;
  transition: border-color 0.2s;
}

.tmwt-sugg-btn:hover {
  border-color: var(--tmwt-primary);
}

/* Stats Strip */
.tmwt-stats-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  background: var(--tmwt-bg);
  border: 1px solid var(--tmwt-border);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.tmwt-stat-item {
  display: flex;
  flex-direction: column;
}

.tmwt-stat-val {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--tmwt-primary);
}

.tmwt-stat-lbl {
  font-size: 0.75rem;
  color: var(--tmwt-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 0.2rem;
}

/* Filter Bar */
.tmwt-filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.tmwt-filter-search {
  flex: 1;
  min-width: 240px;
}

.tmwt-filter-pills {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.tmwt-pill-btn {
  background: var(--tmwt-bg);
  border: 1px solid var(--tmwt-border);
  border-radius: 6px;
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--tmwt-muted);
  cursor: pointer;
  min-height: 40px;
  transition: all 0.2s;
}

.tmwt-pill-btn:hover {
  color: var(--tmwt-text);
  border-color: var(--tmwt-primary);
}

.tmwt-pill-btn.tmwt-pill-active {
  background: var(--tmwt-primary);
  border-color: var(--tmwt-primary);
  color: #ffffff;
}

/* Items Grid */
.tmwt-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.tmwt-card {
  background: var(--tmwt-bg);
  border: 1px solid var(--tmwt-border);
  border-radius: 10px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.75rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.tmwt-card:hover {
  border-color: var(--tmwt-primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.tmwt-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.tmwt-card-tags {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}

.tmwt-tag-type, .tmwt-tag-genre {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: var(--tmwt-card-bg);
  color: var(--tmwt-muted);
  border: 1px solid var(--tmwt-border);
}

.tmwt-status-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
}

.tmwt-status-watching {
  background: var(--tmwt-watching-bg);
  color: var(--tmwt-watching-text);
}

.tmwt-status-completed {
  background: var(--tmwt-completed-bg);
  color: var(--tmwt-completed-text);
}

.tmwt-status-plan {
  background: var(--tmwt-plan-bg);
  color: var(--tmwt-plan-text);
}

.tmwt-status-dropped {
  background: var(--tmwt-dropped-bg);
  color: var(--tmwt-dropped-text);
}

.tmwt-card-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--tmwt-text);
  margin: 0;
  line-height: 1.25;
}

.tmwt-rating-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.tmwt-stars {
  color: #f59e0b;
  font-size: 0.95rem;
}

.tmwt-rating-num {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--tmwt-muted);
}

/* Progress Row */
.tmwt-progress-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  background: var(--tmwt-card-bg);
  border: 1px solid var(--tmwt-border);
  border-radius: 8px;
  padding: 0.75rem;
}

.tmwt-progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--tmwt-muted);
}

.tmwt-progress-track {
  width: 100%;
  height: 6px;
  background: var(--tmwt-border);
  border-radius: 3px;
  overflow: hidden;
}

.tmwt-progress-fill {
  height: 100%;
  background: var(--tmwt-primary);
  border-radius: 3px;
  transition: width 0.3s;
}

.tmwt-episode-controls {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.tmwt-ep-btn {
  background: var(--tmwt-bg);
  border: 1px solid var(--tmwt-border);
  border-radius: 4px;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--tmwt-text);
  cursor: pointer;
  min-height: 32px;
}

.tmwt-ep-btn:hover {
  border-color: var(--tmwt-primary);
  color: var(--tmwt-primary);
}

/* Footer */
.tmwt-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--tmwt-muted);
  border-top: 1px solid var(--tmwt-border);
  padding-top: 0.5rem;
}

.tmwt-time-lbl {
  font-size: 0.75rem;
}

.tmwt-card-actions {
  display: flex;
  align-items: center;
}

.tmwt-action-btn {
  background: none;
  border: none;
  font-size: 0.8rem;
  color: #b91c1c;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.tmwt-action-btn:hover {
  background: var(--tmwt-dropped-bg);
}

.tmwt-btn-delete {
  color: #b91c1c;
}

.tmwt-ep-dec, .tmwt-ep-inc {
  cursor: pointer;
}

.tmwt-toolbar-right {
  display: flex;
  align-items: center;
}

.tmwt-empty-hint {
  color: var(--tmwt-muted);
  font-size: 0.9rem;
  text-align: center;
  padding: 2.5rem 1rem;
  grid-column: 1 / -1;
}

/* Toolbar */
.tmwt-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--tmwt-border);
  padding-top: 1.25rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.tmwt-toolbar-left {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.tmwt-privacy-note {
  font-size: 0.8rem;
  color: var(--tmwt-muted);
}

/* Toast */
.tmwt-toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: #0f172a;
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
  z-index: 9999;
}

.tmwt-toast-show {
  opacity: 1;
  transform: translateY(0);
}

/* Ad Slot Container (Strict min-height: 280px) */
.tmwt-ad-container {
  min-height: 280px;
  background: var(--tmwt-bg);
  border: 1px dashed var(--tmwt-border);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 2rem 0;
  color: var(--tmwt-muted);
  font-size: 0.85rem;
}

/* Related Tools */
.tmwt-related-section {
  margin: 2.5rem 0;
}

.tmwt-related-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--tmwt-text);
}

.tmwt-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.tmwt-related-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.15rem;
  background: var(--tmwt-card-bg);
  border: 1px solid var(--tmwt-border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--tmwt-text);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.tmwt-related-card:hover {
  border-color: var(--tmwt-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.tmwt-related-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--tmwt-primary);
}

.tmwt-related-desc {
  font-size: 0.825rem;
  line-height: 1.4;
  color: var(--tmwt-muted);
}

/* Guide & FAQ */
.tmwt-guide-section, .tmwt-faq-section, .tmwt-disclaimer {
  margin: 2.5rem 0;
}

.tmwt-guide-section h2, .tmwt-faq-section h2 {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 1rem;
  color: var(--tmwt-text);
}

.tmwt-guide-section h3, .tmwt-faq-section h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 1.25rem 0 0.5rem;
  color: var(--tmwt-text);
}

.tmwt-guide-section p, .tmwt-guide-section ol, .tmwt-faq-section p {
  color: var(--tmwt-muted);
  font-size: 0.925rem;
  line-height: 1.6;
}

.tmwt-guide-section ol {
  padding-left: 1.25rem;
}

.tmwt-guide-section li {
  margin-bottom: 0.5rem;
}

.tmwt-faq-item {
  border-bottom: 1px solid var(--tmwt-border);
  padding: 1rem 0;
}

.tmwt-disclaimer {
  background: var(--tmwt-card-bg);
  border: 1px solid var(--tmwt-border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  font-size: 0.85rem;
  color: var(--tmwt-muted);
}
/* tf:dark-palette — generated by migrate_chrome.py */
/* Neutrals inherit the shared chrome tokens so all tools share one
   ground; brand hues are kept and lightened, never inverted. */
[data-theme="dark"] {
  --tmwt-primary: #a281da;
  --tmwt-primary-hover: #a481da;
  --tmwt-bg: var(--tf-surface);
  --tmwt-card-bg: var(--tf-surface);
  --tmwt-border: var(--tf-surface);
  --tmwt-text: var(--tf-ink);
  --tmwt-muted: var(--tf-ink-faint);
  --tmwt-watching-bg: var(--tf-surface);
  --tmwt-watching-text: #a481da;
  --tmwt-completed-bg: var(--tf-surface);
  --tmwt-completed-text: #5ed089;
  --tmwt-plan-bg: var(--tf-surface);
  --tmwt-plan-text: #69aed4;
  --tmwt-dropped-bg: var(--tf-surface);
  --tmwt-dropped-text: #da8181;
}
