/* ============================================================
   mondinionvideos — Design System
   ============================================================ */

:root {
  --bg:           #f8f9fa;
  --bg-card:      #ffffff;
  --bg-hover:     #f1f3f5;
  --border:       #dee2e6;
  --text:         #212529;
  --text-muted:   #6c757d;
  --primary:      #e53e3e;
  --primary-dark: #c53030;
  --primary-bg:   #fff5f5;
  --success:      #16a34a;
  --success-bg:   #f0fdf4;
  --danger:       #dc2626;
  --danger-bg:    #fef2f2;
  --radius:       10px;
  --radius-sm:    6px;
  --shadow:       0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow-lg:    0 10px 25px rgba(0,0,0,.1);
  --font:         system-ui, -apple-system, sans-serif;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 1rem;
}

/* ── Utilities ───────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Toasts ──────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  pointer-events: none;
}
.toast {
  padding: .75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 600;
  color: #fff;
  box-shadow: var(--shadow-lg);
  animation: toastIn .25s ease;
  pointer-events: auto;
  max-width: 320px;
}
.toast--success { background: var(--success); }
.toast--error   { background: var(--danger); }
.toast--info    { background: var(--primary); }

/* ── Animations ──────────────────────────────────────────── */
@keyframes toastIn { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:none; } }

/* ════════════════════════════════════════════════════════════
   Contact Seller Button
   ════════════════════════════════════════════════════════════ */
.btn-contact-seller {
  display: flex; align-items: center; justify-content: center; gap: .45rem;
  width: 100%; margin-top: .65rem;
  padding: .6rem 1rem;
  background: var(--primary, #e53e3e); color: #fff;
  border: none; border-radius: var(--radius-sm, 6px);
  font-size: .88rem; font-weight: 600; cursor: pointer;
  transition: opacity .15s;
  box-shadow: 0 2px 8px rgba(229,62,62,.35);
}
.btn-contact-seller:hover { opacity: .88; }

/* ════════════════════════════════════════════════════════════
   Modal System
   ════════════════════════════════════════════════════════════ */
.modal-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  align-items: center; justify-content: center;
  padding: 1rem;
}
.modal-overlay.open { display: flex; }

.modal-box {
  background: #111; color: #fff;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px; padding: 1.5rem;
  width: 100%; max-width: 420px;
  max-height: 90vh; overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,.7);
}

.modal-close {
  position: absolute; top: 1rem; right: 1rem;
  background: none; border: none; color: rgba(255,255,255,.45);
  font-size: 1rem; cursor: pointer; line-height: 1;
  padding: .25rem; border-radius: 4px;
  transition: color .15s;
}
.modal-close:hover { color: #fff; }

.modal-back {
  background: none; border: none; color: rgba(255,255,255,.5);
  font-size: .82rem; cursor: pointer; padding: 0 0 .75rem;
  display: block; transition: color .15s;
}
.modal-back:hover { color: #fff; }

.modal-title {
  font-size: 1.15rem; font-weight: 700; margin: 0 0 .25rem;
  padding-right: 1.5rem;
}
.modal-sub { font-size: .85rem; color: rgba(255,255,255,.5); margin: 0 0 1.2rem; }

/* ── Auth option buttons ── */
.auth-opt-btn {
  display: flex; flex-direction: column; align-items: flex-start; gap: .15rem;
  width: 100%; padding: .85rem 1rem;
  background: rgba(255,255,255,.07); color: #fff;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 10px; font-size: .9rem; font-weight: 600;
  cursor: pointer; text-align: left; margin-bottom: .7rem;
  transition: background .15s, border-color .15s;
  flex-direction: row; align-items: center; gap: .75rem;
}
.auth-opt-btn:hover { background: rgba(255,255,255,.13); border-color: rgba(255,255,255,.3); }
.auth-opt-btn--primary { background: rgba(229,62,62,.15); border-color: rgba(229,62,62,.4); }
.auth-opt-btn--primary:hover { background: rgba(229,62,62,.25); }
.auth-opt-btn > svg { flex-shrink: 0; }
.auth-opt-sub {
  display: block; font-size: .72rem; font-weight: 400;
  color: rgba(255,255,255,.45); margin-top: .1rem;
  flex-basis: 100%;
}

/* hack: make the sub-text wrap below in its own row */
.auth-opt-btn { flex-wrap: wrap; }
.auth-opt-btn > svg, .auth-opt-btn > span:not(.auth-opt-sub) { flex-shrink: 0; }

.auth-divider {
  text-align: center; color: rgba(255,255,255,.3);
  font-size: .78rem; margin: .25rem 0 .7rem;
  position: relative;
}
.auth-divider::before, .auth-divider::after {
  content: ''; position: absolute; top: 50%; width: 42%;
  border-top: 1px solid rgba(255,255,255,.1);
}
.auth-divider::before { left: 0; }
.auth-divider::after { right: 0; }

/* ── Forms ── */
.form-group { margin-bottom: .85rem; }
.form-label { display: block; font-size: .82rem; color: rgba(255,255,255,.6); margin-bottom: .3rem; }
.form-label .req { color: var(--primary, #e53e3e); }

.form-row { display: flex; gap: .5rem; }

.form-input {
  width: 100%; padding: .6rem .85rem;
  background: rgba(255,255,255,.07); color: #fff;
  border: 1px solid rgba(255,255,255,.15); border-radius: 8px;
  font-size: .9rem; font-family: inherit;
  transition: border-color .15s;
}
.form-input:focus { outline: none; border-color: rgba(255,255,255,.4); background: rgba(255,255,255,.1); }
.form-input::placeholder { color: rgba(255,255,255,.25); }
.form-input[readonly] { opacity: .75; cursor: default; border-color: rgba(72,187,120,.4); }
.form-input[readonly]:focus { border-color: rgba(72,187,120,.5); background: rgba(255,255,255,.07); }

/* Verified badge — reused on contact form label and My Leads */
.badge-verified {
  display: inline-flex; align-items: center; gap: .18rem;
  font-size: .65rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  background: rgba(72,187,120,.15); color: #48bb78;
  padding: .1rem .35rem; border-radius: 3px; vertical-align: middle; margin-left: .3rem;
}

.form-input--otp {
  letter-spacing: .35em; font-size: 1.5rem; font-weight: 700;
  text-align: center; padding: .75rem;
}

.form-select {
  padding: .6rem .75rem;
  background: rgba(255,255,255,.07); color: #fff;
  border: 1px solid rgba(255,255,255,.15); border-radius: 8px;
  font-size: .85rem; font-family: inherit; cursor: pointer;
}
.form-select--dial { flex-shrink: 0; width: 110px; }
.form-select--full { width: 100%; }
.form-select option { background: #222; }

.form-textarea { resize: vertical; min-height: 90px; }

/* ── Caption formatting toolbar ──────────────────────────── */
.caption-toolbar {
  display: flex;
  gap: .3rem;
  margin-bottom: .4rem;
}
.caption-fmt-btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: var(--radius-sm);
  padding: .22rem .55rem;
  font-size: .82rem; line-height: 1.4;
  color: rgba(255,255,255,.75);
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  user-select: none;
}
.caption-fmt-btn:hover  { background: rgba(255,255,255,.15); color: #fff; border-color: rgba(255,255,255,.3); }
.caption-fmt-btn.active { background: rgba(255,255,255,.2);  color: #fff; border-color: rgba(255,255,255,.4); }
.caption-fmt-btn strong { font-weight: 700; }
.caption-fmt-btn em     { font-style: italic; }

/* ── WYSIWYG caption editor (contenteditable) ─────────────── */
.caption-editor {
  min-height: 100px;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-y: auto;
  cursor: text;
  outline: none;
  line-height: 1.6;
}
.caption-editor:empty::before {
  content: attr(data-placeholder);
  color: rgba(255,255,255,.3);
  pointer-events: none;
}
.caption-editor ul  { padding-left: 1.2em; margin: .15rem 0; }
.caption-editor li  { margin-bottom: .1rem; }
.caption-editor b, .caption-editor strong { font-weight: 700; }
.caption-editor i, .caption-editor em     { font-style: italic; }

.form-note { font-size: .75rem; color: rgba(255,255,255,.35); margin: -.3rem 0 .85rem; }

.btn-primary {
  display: flex; align-items: center; justify-content: center;
  padding: .65rem 1.25rem;
  background: var(--primary, #e53e3e); color: #fff;
  border: none; border-radius: 8px;
  font-size: .9rem; font-weight: 600; cursor: pointer;
  transition: opacity .15s;
}
.btn-primary:hover { opacity: .88; }
.btn-primary:disabled { opacity: .5; cursor: default; }
.btn-full { width: 100%; }

.link-btn {
  display: block; width: 100%; text-align: center;
  margin-top: .6rem; padding: .35rem;
  background: none; border: none; color: rgba(255,255,255,.45);
  font-size: .82rem; cursor: pointer; transition: color .15s;
}
.link-btn:hover { color: #fff; }

/* ── Radio group ── */
.radio-group { display: flex; flex-direction: column; gap: .45rem; }
.radio-label {
  display: flex; align-items: center; gap: .5rem;
  font-size: .88rem; color: rgba(255,255,255,.75); cursor: pointer;
}
.radio-label input { accent-color: var(--primary, #e53e3e); }

/* ── Upload zone ── */
.upload-zone {
  border: 2px dashed rgba(255,255,255,.18); border-radius: 10px;
  margin-bottom: .85rem; overflow: hidden; position: relative;
  transition: border-color .15s;
}
.upload-zone.dragover { border-color: var(--primary, #e53e3e); }
.upload-zone__inner {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .4rem; padding: 2rem 1rem; cursor: pointer; min-height: 130px;
  text-align: center;
}
.upload-zone__label { font-size: .88rem; color: rgba(255,255,255,.6); margin: 0; }
.upload-zone__hint  { font-size: .75rem; color: rgba(255,255,255,.3); margin: 0; }
.upload-file-input  { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

#upload-preview {
  width: 100%; max-height: 220px; object-fit: cover; display: block;
  background: #000;
}

/* ── Progress bar ── */
.progress-bar {
  height: 5px; background: rgba(255,255,255,.1); border-radius: 3px;
  overflow: hidden; margin-bottom: .4rem;
}
.progress-bar__fill {
  height: 100%; width: 0%;
  background: var(--primary, #e53e3e);
  transition: width .2s ease;
}
.upload-progress-label { font-size: .78rem; color: rgba(255,255,255,.45); text-align: center; margin: 0 0 .85rem; }

/* ── Upload mode tabs (file vs URL import) ────────────── */
.upload-tabs {
  display: flex;
  border: 1px solid rgba(255,255,255,.15); border-radius: 8px;
  overflow: hidden; margin-bottom: 1rem;
}
.upload-tab {
  flex: 1; padding: .52rem .75rem;
  background: none; color: rgba(255,255,255,.45);
  border: none; border-right: 1px solid rgba(255,255,255,.12);
  font-size: .84rem; font-weight: 500; cursor: pointer;
  transition: background .15s, color .15s;
}
.upload-tab:last-child { border-right: none; }
.upload-tab--active { background: rgba(255,255,255,.1); color: #fff; font-weight: 600; }
.upload-tab:not(.upload-tab--active):hover { background: rgba(255,255,255,.06); color: rgba(255,255,255,.7); }

/* ── URL import section ──────────────────────────────── */
.url-input-row { display: flex; gap: .5rem; margin-bottom: .75rem; }
.url-input-row .form-input { flex: 1; min-width: 0; }
.btn-fetch-url {
  flex-shrink: 0; padding: .6rem 1rem;
  background: rgba(255,255,255,.1); color: #fff;
  border: 1px solid rgba(255,255,255,.2); border-radius: 8px;
  font-size: .85rem; font-weight: 600; cursor: pointer;
  transition: background .15s; white-space: nowrap;
}
.btn-fetch-url:hover:not(:disabled) { background: rgba(255,255,255,.18); }
.btn-fetch-url:disabled { opacity: .45; cursor: default; }

.url-preview-card {
  display: flex; align-items: flex-start; gap: .75rem;
  padding: .7rem .85rem; margin-bottom: .75rem;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px; position: relative;
}
.url-preview-thumb {
  width: 60px; height: 60px; object-fit: cover;
  border-radius: 4px; flex-shrink: 0; background: rgba(255,255,255,.08);
}
.url-preview-meta { flex: 1; min-width: 0; }
.url-preview-title {
  font-size: .84rem; font-weight: 600; color: #fff;
  overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  margin-bottom: .2rem; line-height: 1.35;
}
.url-preview-info { font-size: .74rem; color: rgba(255,255,255,.42); }
.url-clear-btn {
  position: absolute; top: .35rem; right: .4rem;
  background: none; border: none; color: rgba(255,255,255,.35);
  font-size: .9rem; cursor: pointer; padding: .1rem .25rem;
  line-height: 1; transition: color .15s;
}
.url-clear-btn:hover { color: #fff; }

/* ── Push notification / PWA install banners ──────────── */
#push-banner,
#pwa-banner {
  position: fixed;
  top: var(--banner-top, 90px);   /* set by JS to headerHeight + 40px */
  left: 50%; transform: translateX(-50%);
  z-index: 9000;
  display: flex; align-items: center; gap: .6rem;
  padding: .65rem 1rem;
  background: #1e1e1e; border: 1px solid rgba(255,255,255,.15);
  border-radius: 2rem;
  box-shadow: 0 4px 20px rgba(0,0,0,.6);
  font-size: .82rem; color: rgba(255,255,255,.85);
  white-space: nowrap;
  animation: banner-in .25s ease;
}
@keyframes banner-in {
  from { opacity: 0; transform: translateX(-50%) translateY(-8px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
#push-banner button,
#pwa-banner button {
  padding: .28rem .75rem;
  border-radius: 2rem; border: none; cursor: pointer;
  font-size: .78rem; font-weight: 600; white-space: nowrap;
}
#push-banner-enable,
#pwa-banner-install {
  background: var(--primary, #e53e3e); color: #fff;
}
#push-banner-later,
#pwa-banner-dismiss {
  background: rgba(255,255,255,.12); color: rgba(255,255,255,.7);
}
