/* Danofilm "What should I watch?" widget — DigiMedia theme-aligned styles. */
.dfww-root,
.dfww-root * { box-sizing: border-box; }
.dfww-root {
  --dfww-accent: #ff9800;
  --dfww-accent-bright: #ffad49;
  --dfww-accent-deep: #b85b00;
  --dfww-accent-ink: #241605;
  --dfww-accent-soft: #fff2df;
  --dfww-text: #202633;
  --dfww-muted: #687181;
  --dfww-border: #e2e5eb;
  --dfww-surface: #ffffff;
  --dfww-surface-alt: #f7f8fa;
  --dfww-shadow: 0 22px 70px rgba(10, 16, 28, .25);
  color: var(--dfww-text);
  font-family: inherit;
  direction: rtl;
  color-scheme: light;
}

/* DigiMedia dark mode is toggled by the existing body.dark class. */
body.dark .dfww-root {
  --dfww-accent: #ff9800;
  --dfww-accent-bright: #ffb44f;
  --dfww-accent-deep: #ffad49;
  --dfww-accent-ink: #201303;
  --dfww-accent-soft: rgba(255, 152, 0, .13);
  --dfww-text: #f2f4f8;
  --dfww-muted: #aab2c0;
  --dfww-border: #303644;
  --dfww-surface: #131722;
  --dfww-surface-alt: #1a1f2a;
  --dfww-shadow: 0 24px 78px rgba(0, 0, 0, .54);
  color-scheme: dark;
}

.dfww-root [hidden] { display: none !important; }
.dfww-root button,
.dfww-root select,
.dfww-root input { font: inherit; }
.dfww-root button { cursor: pointer; }
.dfww-root button:focus-visible,
.dfww-root select:focus-visible,
.dfww-root input:focus-visible,
.dfww-root a:focus-visible {
  outline: 3px solid rgba(255, 152, 0, .72);
  outline-offset: 3px;
}

/* Floating launcher: uses DigiMedia's signature orange, with dark text for contrast. */
.dfww-launcher {
  position: fixed;
  z-index: 99990;
  bottom: max(22px, env(safe-area-inset-bottom));
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  max-width: calc(100vw - 32px);
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 28px;
  padding: 8px 18px 8px 19px;
  color: var(--dfww-accent-ink) !important;
  background: linear-gradient(135deg, #ffb84f 0%, #ff9800 72%, #f28a00 100%);
  box-shadow: 0 8px 23px rgba(183, 92, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .34);
  font-size: 14px;
  line-height: 1.4;
  font-weight: 800;
  letter-spacing: 0;
  text-decoration: none;
  white-space: nowrap;
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
  -webkit-tap-highlight-color: transparent;
}
.dfww-position-left .dfww-launcher { left: max(20px, env(safe-area-inset-left)); }
.dfww-position-right .dfww-launcher { right: max(20px, env(safe-area-inset-right)); }
.dfww-launcher:hover {
  color: var(--dfww-accent-ink) !important;
  filter: saturate(1.06) brightness(1.025);
  transform: translateY(-2px);
  box-shadow: 0 12px 29px rgba(183, 92, 0, .34), inset 0 1px 0 rgba(255, 255, 255, .4);
}
.dfww-launcher:active { transform: translateY(0); }
.dfww-launcher-icon {
  display: inline-flex;
  flex: 0 0 29px;
  align-items: center;
  justify-content: center;
  width: 29px;
  height: 29px;
  background: rgba(48, 29, 4, .10);
  border: 1px solid rgba(48, 29, 4, .08);
  border-radius: 50%;
}
.dfww-launcher svg,
.dfww-brand-mark svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dfww-backdrop {
  position: fixed;
  z-index: 99998;
  inset: 0;
  background: rgba(9, 13, 22, .62);
  opacity: 0;
  transition: opacity .18s ease;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.dfww-backdrop.is-open { opacity: 1; }
body.dark .dfww-backdrop { background: rgba(0, 0, 0, .76); }

.dfww-dialog {
  position: fixed;
  z-index: 99999;
  left: 50%;
  top: 50%;
  width: min(660px, calc(100vw - 28px));
  max-height: min(88vh, 850px);
  max-height: min(88dvh, 850px);
  overflow: auto;
  transform: translate(-50%, -48%) scale(.985);
  opacity: 0;
  border: 1px solid var(--dfww-border);
  border-radius: 20px;
  background: var(--dfww-surface);
  color: var(--dfww-text);
  box-shadow: var(--dfww-shadow);
  transition: opacity .18s ease, transform .18s ease;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-color: var(--dfww-border) transparent;
}
.dfww-dialog.is-open { transform: translate(-50%, -50%) scale(1); opacity: 1; }
.dfww-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 22px;
  background: var(--dfww-surface);
  border-bottom: 1px solid var(--dfww-border);
}
.dfww-brand-mark {
  flex: 0 0 44px;
  display: flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: var(--dfww-accent-soft);
  color: var(--dfww-accent-deep);
  border: 1px solid rgba(255, 152, 0, .2);
}
.dfww-brand-mark svg { width: 23px; height: 23px; }
.dfww-heading { flex: 1; min-width: 0; }
.dfww-heading h2 {
  margin: 0 0 4px;
  padding: 0;
  color: var(--dfww-text);
  font-size: 19px;
  line-height: 1.5;
  font-weight: 800;
}
.dfww-heading p { margin: 0; color: var(--dfww-muted); font-size: 12px; line-height: 1.8; }
.dfww-close {
  display: inline-flex;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--dfww-border);
  border-radius: 50%;
  background: var(--dfww-surface-alt);
  color: var(--dfww-muted);
  font-size: 24px;
  line-height: 1;
  transition: color .15s ease, background .15s ease, border-color .15s ease;
}
.dfww-close:hover { color: var(--dfww-text); background: var(--dfww-accent-soft); border-color: rgba(255, 152, 0, .45); }
.dfww-content { padding: 21px 22px 24px; }
.dfww-fieldset { min-width: 0; border: 0; padding: 0; margin: 0 0 20px; }
.dfww-fieldset legend,
.dfww-field label {
  display: block;
  width: 100%;
  margin-bottom: 9px;
  font-size: 13px;
  line-height: 1.8;
  font-weight: 800;
  color: var(--dfww-text);
}
.dfww-segmented { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.dfww-segment {
  min-width: 0;
  min-height: 43px;
  border: 1px solid var(--dfww-border);
  border-radius: 10px;
  padding: 9px 8px;
  background: var(--dfww-surface);
  color: var(--dfww-text);
  font-size: 13px;
  line-height: 1.5;
  font-weight: 650;
  transition: border-color .15s ease, background .15s ease, color .15s ease, box-shadow .15s ease;
}
.dfww-segment:hover { border-color: rgba(255, 152, 0, .68); background: var(--dfww-accent-soft); }
.dfww-segment.is-active {
  border-color: var(--dfww-accent);
  color: var(--dfww-accent-deep);
  background: var(--dfww-accent-soft);
  box-shadow: inset 0 0 0 1px rgba(255, 152, 0, .22);
}
body.dark .dfww-segment.is-active { color: #ffc36b; }
.dfww-field { margin-bottom: 17px; }
.dfww-field select {
  display: block;
  width: 100%;
  min-height: 46px;
  padding: 9px 12px;
  border: 1px solid var(--dfww-border);
  border-radius: 10px;
  background: var(--dfww-surface-alt);
  color: var(--dfww-text);
  font-size: 13px;
  line-height: 1.6;
  box-shadow: none;
}
.dfww-field select:hover { border-color: rgba(255, 152, 0, .55); }
.dfww-field select:disabled { opacity: .7; cursor: not-allowed; }
.dfww-field-note { margin: 6px 0 0; color: var(--dfww-muted); font-size: 11px; line-height: 1.8; }
.dfww-preferences { margin-top: 3px; margin-bottom: 18px; }
.dfww-check {
  display: flex !important;
  align-items: center;
  gap: 10px;
  margin: 11px 0 !important;
  font-weight: 500 !important;
  cursor: pointer;
  color: var(--dfww-text) !important;
  font-size: 13px !important;
  line-height: 1.8;
}
.dfww-check input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.dfww-checkmark {
  position: relative;
  flex: 0 0 19px;
  width: 19px;
  height: 19px;
  border: 1px solid #bdc4ce;
  border-radius: 5px;
  background: var(--dfww-surface);
}
body.dark .dfww-checkmark { border-color: #697182; }
.dfww-check input:checked + .dfww-checkmark { background: var(--dfww-accent); border-color: var(--dfww-accent); }
.dfww-check input:checked + .dfww-checkmark:after {
  content: '';
  position: absolute;
  right: 5px;
  top: 2px;
  width: 5px;
  height: 9px;
  border: solid #241605;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.dfww-check input:focus-visible + .dfww-checkmark { outline: 3px solid rgba(255, 152, 0, .68); outline-offset: 3px; }

/* Primary actions reuse the same signature orange as DigiMedia, with readable contrast. */
.dfww-primary {
  display: inline-flex;
  width: 100%;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid rgba(156, 78, 0, .12);
  border-radius: 11px;
  padding: 11px 16px;
  background: linear-gradient(135deg, #ffb84f 0%, #ff9800 76%);
  color: #241605 !important;
  font-size: 14px;
  line-height: 1.5;
  font-weight: 800;
  box-shadow: 0 5px 14px rgba(183, 92, 0, .16), inset 0 1px 0 rgba(255, 255, 255, .3);
  transition: background .15s ease, transform .15s ease, box-shadow .15s ease;
}
.dfww-primary:hover {
  background: linear-gradient(135deg, #ffc56f 0%, #ffad2f 76%);
  color: #241605 !important;
  box-shadow: 0 7px 18px rgba(183, 92, 0, .22), inset 0 1px 0 rgba(255, 255, 255, .36);
}
.dfww-primary:active { transform: translateY(1px); }
.dfww-primary:disabled { opacity: .68; cursor: wait; box-shadow: none; }
.dfww-privacy-note { text-align: center; margin: 12px 0 0; color: var(--dfww-muted); font-size: 11px; line-height: 1.9; }
.dfww-status {
  padding: 13px 15px;
  margin: 0 0 15px;
  border: 1px solid rgba(255, 152, 0, .28);
  border-radius: 10px;
  background: var(--dfww-accent-soft);
  color: var(--dfww-text);
  font-size: 13px;
  line-height: 1.9;
}
.dfww-status.is-loading { display: flex; align-items: center; gap: 10px; }
.dfww-status.is-loading:before {
  content: '';
  flex: 0 0 17px;
  width: 17px;
  height: 17px;
  border: 2px solid rgba(255, 152, 0, .25);
  border-top-color: var(--dfww-accent-deep);
  border-radius: 50%;
  animation: dfww-spin .7s linear infinite;
}
@keyframes dfww-spin { to { transform: rotate(360deg); } }

.dfww-results { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.dfww-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--dfww-border);
  border-radius: 12px;
  background: var(--dfww-surface);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.dfww-card:hover { transform: translateY(-2px); border-color: rgba(255, 152, 0, .52); box-shadow: 0 8px 22px rgba(22, 30, 44, .11); }
body.dark .dfww-card:hover { box-shadow: 0 8px 22px rgba(0, 0, 0, .26); }
.dfww-card-link {
  display: grid;
  grid-template-columns: 94px minmax(0, 1fr);
  min-height: 136px;
  height: 100%;
  color: inherit;
  text-decoration: none !important;
}
.dfww-card-link:hover { color: inherit; }
.dfww-poster {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 136px;
  overflow: hidden;
  background: linear-gradient(145deg, #f2e9dc, #e5d5bf);
}
body.dark .dfww-poster { background: linear-gradient(145deg, #242a37, #191e28); }
.dfww-poster img { display: block; width: 100%; height: 100%; min-height: 136px; object-fit: cover; }
.dfww-no-poster { color: #9b8060; font-size: 28px; }
body.dark .dfww-no-poster { color: #a5adba; }
.dfww-card-info { display: flex; min-width: 0; flex-direction: column; align-items: flex-start; padding: 10px 10px 9px; }
.dfww-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 7px; }
.dfww-badge { display: inline-block; border-radius: 5px; padding: 3px 6px; background: var(--dfww-surface-alt); color: var(--dfww-muted); font-size: 9px; line-height: 1.5; white-space: nowrap; border: 1px solid var(--dfww-border); }
.dfww-badge.dfww-rating { background: #fff2d7; border-color: #f5d89f; color: #784700; }
.dfww-badge.dfww-metacritic { background: #e8f7ee; border-color: #b9e5c8; color: #16633b; }
.dfww-card-info h3 { width: 100%; margin: 0 0 10px; color: var(--dfww-text); font-size: 13px; line-height: 1.8; font-weight: 800; overflow-wrap: anywhere; }
.dfww-view-link { display: inline-flex; align-items: center; gap: 5px; margin-top: auto; color: var(--dfww-accent-deep); font-size: 11px; line-height: 1.7; font-weight: 800; }
body.dark .dfww-view-link { color: #ffb44f; }
.dfww-result-actions { padding-top: 17px; }
.dfww-feedback-label { margin-bottom: 9px; color: var(--dfww-muted); font-size: 12px; line-height: 1.8; text-align: center; }
.dfww-feedback-buttons { display: flex; gap: 8px; margin-bottom: 12px; }
.dfww-secondary {
  flex: 1;
  min-width: 0;
  min-height: 40px;
  border: 1px solid var(--dfww-border);
  border-radius: 9px;
  background: var(--dfww-surface-alt);
  color: var(--dfww-text);
  font-size: 12px;
  line-height: 1.6;
  padding: 7px 10px;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.dfww-secondary:hover,
.dfww-secondary.is-selected { border-color: rgba(255, 152, 0, .62); background: var(--dfww-accent-soft); color: var(--dfww-accent-deep); }
body.dark .dfww-secondary:hover,
body.dark .dfww-secondary.is-selected { color: #ffc36b; }
.dfww-again { min-height: 44px; }
.dfww-text-button { display: block; margin: 10px auto 0; padding: 7px 12px; border: 0; background: transparent; color: var(--dfww-muted); font-size: 12px; line-height: 1.7; }
.dfww-text-button:hover { color: var(--dfww-accent-deep); }
body.dark .dfww-text-button:hover { color: #ffb44f; }
.dfww-form-collapsed { display: none; }
body.dfww-modal-open { overflow: hidden; }

@media (max-width: 560px) {
  .dfww-launcher { min-height: 48px; padding: 7px 14px; font-size: 13px; gap: 8px; }
  .dfww-launcher-icon { width: 27px; height: 27px; flex-basis: 27px; }
  .dfww-dialog { width: calc(100vw - 16px); max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); border-radius: 16px; }
  .dfww-header { padding: 14px 15px; gap: 10px; }
  .dfww-brand-mark { width: 38px; height: 38px; flex-basis: 38px; border-radius: 12px; }
  .dfww-heading h2 { font-size: 17px; }
  .dfww-heading p { font-size: 11px; }
  .dfww-close { width: 35px; height: 35px; flex-basis: 35px; }
  .dfww-content { padding: 16px 14px 18px; }
  .dfww-segment { padding: 9px 5px; font-size: 12px; }
  .dfww-results { grid-template-columns: 1fr; gap: 9px; }
  .dfww-card-link { grid-template-columns: 86px minmax(0, 1fr); min-height: 121px; }
  .dfww-poster, .dfww-poster img { min-height: 121px; }
  .dfww-card-info { padding: 9px; }
  .dfww-card-info h3 { font-size: 13px; }
}
@media (max-width: 360px) {
  .dfww-launcher { left: 12px !important; right: auto !important; bottom: max(14px, env(safe-area-inset-bottom)); }
  .dfww-segmented { gap: 5px; }
  .dfww-segment { font-size: 11px; }
  .dfww-feedback-buttons { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  .dfww-root *, .dfww-root *:before, .dfww-root *:after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
