/* =========================================================
   THUMBNAILER — Thumbnail Preview tool
   Controls (branded) + realistic YouTube mockups (dark theme).
   ========================================================= */

.tool { padding-top: clamp(140px, 16vw, 190px); }

/* ---------- Controls panel ---------- */
.tool__panel {
  position: relative; z-index: 2; display: grid; grid-template-columns: 300px 1fr; gap: 22px;
  background: var(--card-bg); border: 1px solid var(--border-2); border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow); padding: 22px; max-width: 820px; margin: 0 auto;
}
.tool__upload {
  position: relative; aspect-ratio: 16 / 9; border-radius: 14px; cursor: pointer; overflow: hidden;
  border: 1.5px dashed var(--border-2); background: rgba(255,255,255,0.025);
  display: flex; align-items: center; justify-content: center; text-align: center;
  transition: border-color .2s ease, background .2s ease;
}
.tool__upload:hover, .tool__upload.is-drag { border-color: rgba(var(--accent-rgb),0.6); background: rgba(var(--accent-rgb),0.06); }
.tool__upload-inner { display: flex; flex-direction: column; align-items: center; gap: 7px; color: var(--muted); padding: 14px; }
.tool__upload-inner svg { color: var(--accent); }
.tool__upload-title { font-weight: 500; color: var(--text); font-size: 0.95rem; }
.tool__upload-sub { font-size: 0.74rem; }
.tool__upload.has-img { border-style: solid; border-color: var(--border); }
.tool__upload.has-img .tool__upload-inner { display: none; }
.tool__upload img { width: 100%; height: 100%; object-fit: cover; }
.tool__upload-change {
  position: absolute; inset: auto 0 0 0; padding: 7px; font-size: 0.76rem; font-weight: 500; color: #fff;
  background: linear-gradient(transparent, rgba(0,0,0,0.7)); text-align: center; display: none;
}
.tool__upload.has-img .tool__upload-change { display: block; }

.tool__fields { display: flex; flex-direction: column; gap: 14px; justify-content: center; }
.tool__field { display: flex; flex-direction: column; gap: 6px; }
.tool__field span { font-size: 0.78rem; font-weight: 500; color: var(--muted); }
.tool__field input {
  font-family: inherit; font-size: 0.95rem; color: var(--text);
  padding: 11px 14px; border-radius: 11px; border: 1px solid var(--border-2);
  background: rgba(255,255,255,0.03); transition: border-color .18s ease;
}
.tool__field input::placeholder { color: var(--muted-2); }
.tool__field input:focus { outline: none; border-color: rgba(var(--accent-rgb),0.55); background: rgba(255,255,255,0.05); }
.tool__hint { font-size: 0.74rem; color: var(--muted-2); margin-top: 2px; }

/* ---------- Download action ---------- */
.tool__actions { position: relative; z-index: 2; display: flex; justify-content: center; margin-top: 18px; }
.tool__download {
  display: inline-flex; align-items: center; gap: 9px; cursor: pointer;
  font-family: inherit; font-size: 0.9rem; font-weight: 600; color: var(--accent);
  padding: 11px 22px; border-radius: 999px;
  border: 1px solid rgba(var(--accent-rgb), 0.45); background: rgba(var(--accent-rgb), 0.08);
  transition: background .18s ease, border-color .18s ease, transform .15s ease;
}
.tool__download:hover { background: rgba(var(--accent-rgb), 0.16); border-color: rgba(var(--accent-rgb), 0.7); }
.tool__download:active { transform: scale(.97); }
.tool__download:disabled { opacity: .6; cursor: default; transform: none; }
.tool__download svg { display: block; flex: 0 0 auto; }

/* ---------- View tabs ---------- */
.tool__views {
  position: relative; z-index: 2; display: inline-flex; gap: 4px; margin: 30px auto 0; padding: 5px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--border-2); border-radius: 999px;
  width: max-content; max-width: 100%;
}
.tool__views { left: 50%; transform: translateX(-50%); }
.tool__views button {
  font-family: inherit; font-size: 0.88rem; font-weight: 500; color: var(--muted);
  padding: 9px 20px; border-radius: 999px; border: none; background: none; cursor: pointer; transition: .18s ease; white-space: nowrap;
}
.tool__views button:hover { color: var(--text); }
.tool__views button.is-active { color: #04282b; font-weight: 600; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }

/* ---------- Stage ---------- */
.tool__stage { position: relative; z-index: 2; margin-top: 26px; }

/* =========================================================
   YOUTUBE MOCKUP (dark theme, Roboto)
   ========================================================= */
.yt {
  font-family: 'Roboto', system-ui, sans-serif; color: #f1f1f1;
  background: #0f0f0f; border: 1px solid #272727; border-radius: 14px; overflow: hidden;
}
.yt * { box-sizing: border-box; }
.yt a { color: inherit; }

/* shared header (home + watch) */
.yt-header { display: flex; align-items: center; gap: 18px; padding: 8px 18px; height: 56px; }
.yt-header__left, .yt-header__right { display: flex; align-items: center; gap: 18px; flex: 0 0 auto; }
.yt-burger { display: flex; flex-direction: column; gap: 4px; }
.yt-burger span { width: 18px; height: 2px; background: #f1f1f1; border-radius: 2px; }
.yt-logo { display: inline-flex; align-items: center; line-height: 0; }
.yt-logo svg { display: block; }
.yt-logo__img { height: 20px; width: auto; display: block; }
.yt-search-wrap { flex: 1; display: flex; justify-content: center; }
.yt-search { display: flex; align-items: center; width: 100%; max-width: 500px; }
.yt-search input {
  flex: 1; height: 38px; background: #121212; border: 1px solid #303030; border-right: none;
  border-radius: 40px 0 0 40px; padding: 0 16px; color: #f1f1f1; font-family: inherit; font-size: 0.9rem;
}
.yt-search input::placeholder { color: #888; }
.yt-search__btn { height: 38px; width: 60px; background: #222; border: 1px solid #303030; border-radius: 0 40px 40px 0; display: flex; align-items: center; justify-content: center; }
.yt-avatar { border-radius: 50%; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; }
.yt-avatar--img { overflow: hidden; background: #05070a; }
.yt-avatar--img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.yt-icon { color: #f1f1f1; }

/* category chips */
.yt-chips { display: flex; gap: 9px; padding: 10px 18px; overflow: hidden; border-bottom: 1px solid #1f1f1f; }
.yt-chip { font-size: 0.82rem; font-weight: 500; color: #f1f1f1; background: #272727; padding: 7px 12px; border-radius: 9px; white-space: nowrap; }
.yt-chip.is-active { background: #f1f1f1; color: #0f0f0f; }

/* ---------- HOME grid ---------- */
.yt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px 14px; padding: 18px; }
.yt-card__thumb { position: relative; aspect-ratio: 16/9; border-radius: 12px; overflow: hidden; background: #272727; }
.yt-card__thumb img { width: 100%; height: 100%; object-fit: cover; }
.yt-card__dur { position: absolute; right: 6px; bottom: 6px; background: rgba(0,0,0,0.8); color: #fff; font-size: 0.72rem; font-weight: 500; padding: 1px 4px; border-radius: 4px; }
.yt-card__meta { display: flex; gap: 12px; padding: 12px 2px 0; }
.yt-card__text { min-width: 0; }
.yt-card__title { font-size: 0.92rem; font-weight: 500; line-height: 1.35; color: #f1f1f1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.yt-card__chan, .yt-card__stats { font-size: 0.82rem; color: #aaa; margin-top: 4px; }
.yt-card__chan { display: flex; align-items: center; gap: 4px; }

/* "your" video highlight */
.yt-mine .yt-card__thumb, .yt-mine.yt-mcard .yt-mcard__thumb, .yt-mine.yt-side .yt-side__thumb { box-shadow: 0 0 0 2.5px var(--accent); }
.yt-tag-mine {
  position: absolute; top: 6px; left: 6px; z-index: 2; font-family: 'Poppins', sans-serif;
  font-size: 0.64rem; font-weight: 600; color: #04282b; background: var(--accent);
  padding: 3px 8px; border-radius: 6px; box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

/* placeholder when no thumbnail uploaded */
.yt-ph { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: #777; background: repeating-linear-gradient(45deg, #1e1e1e, #1e1e1e 10px, #232323 10px, #232323 20px); text-align: center; padding: 8px; }
.yt-ph span { font-size: 0.72rem; }

/* ---------- MOBILE phone ---------- */
.yt--mobile { background: transparent; border: none; }
.yt-phone {
  width: 330px; max-width: 100%; margin: 0 auto; background: #0f0f0f;
  border: 9px solid #1c1c1e; border-radius: 38px; overflow: hidden;
  box-shadow: 0 30px 80px -30px rgba(0,0,0,0.9);
}
.yt-mheader { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 8px; gap: 10px; }
.yt-mheader .yt-logo__img { height: 17px; }
.yt-mheader__right { display: flex; align-items: center; gap: 14px; flex: 0 0 auto; }
.yt-mchips { display: flex; gap: 8px; padding: 6px 14px 10px; overflow: hidden; }
.yt-mfeed { max-height: 560px; overflow-y: auto; }
.yt-mcard { padding-bottom: 12px; }
.yt-mcard__thumb { position: relative; aspect-ratio: 16/9; overflow: hidden; background: #272727; }
.yt-mcard__thumb img { width: 100%; height: 100%; object-fit: cover; }
.yt-mcard__dur { position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,0.8); color: #fff; font-size: 0.72rem; padding: 1px 4px; border-radius: 4px; }
.yt-mcard__row { display: flex; gap: 12px; padding: 12px 12px 0; }
.yt-mcard__text { min-width: 0; flex: 1; }
.yt-mcard__title { font-size: 0.92rem; font-weight: 500; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.yt-mcard__stats { font-size: 0.78rem; color: #aaa; margin-top: 4px; }
.yt-mcard__dots { color: #aaa; flex: 0 0 auto; }

/* ---------- WATCH / SIDEBAR ---------- */
.yt-watch { display: grid; grid-template-columns: 1fr 372px; gap: 24px; padding: 20px; align-items: start; }
.yt-player { position: relative; aspect-ratio: 16/9; border-radius: 12px; overflow: hidden; background: #000; }
.yt-player img { width: 100%; height: 100%; object-fit: cover; opacity: .92; }
.yt-player__play { position: absolute; inset: 0; margin: auto; width: 68px; height: 48px; }
.yt-player__bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255,255,255,0.25); }
.yt-player__bar i { display: block; height: 100%; width: 36%; background: #f00; }
.yt-watch__title { font-size: 1.15rem; font-weight: 600; line-height: 1.3; margin: 14px 0 10px; }
.yt-watch__row { display: flex; align-items: center; gap: 12px; }
.yt-watch__chan { min-width: 0; }
.yt-watch__chan b { font-size: 0.9rem; font-weight: 500; display: block; }
.yt-watch__chan span { font-size: 0.78rem; color: #aaa; }
.yt-sub { margin-left: auto; background: #f1f1f1; color: #0f0f0f; font-size: 0.85rem; font-weight: 500; padding: 9px 16px; border-radius: 999px; flex: 0 0 auto; }
.yt-side__head { font-size: 0.9rem; font-weight: 500; color: #aaa; margin-bottom: 12px; }
.yt-side { display: flex; gap: 8px; margin-bottom: 9px; }
.yt-side__thumb { position: relative; width: 168px; aspect-ratio: 16/9; border-radius: 9px; overflow: hidden; flex: 0 0 auto; background: #272727; }
.yt-side__thumb img { width: 100%; height: 100%; object-fit: cover; }
.yt-side__dur { position: absolute; right: 4px; bottom: 4px; background: rgba(0,0,0,0.8); color: #fff; font-size: 0.68rem; padding: 1px 4px; border-radius: 4px; }
.yt-side__text { min-width: 0; }
.yt-side__title { font-size: 0.82rem; font-weight: 500; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.yt-side__chan, .yt-side__stats { font-size: 0.74rem; color: #aaa; margin-top: 3px; }

@media (max-width: 880px) {
  .yt-watch { grid-template-columns: 1fr; }
}

/* ---------- responsive controls ---------- */
@media (max-width: 680px) {
  .tool__panel { grid-template-columns: 1fr; max-width: 460px; }
  .yt-header__right .yt-icon, .yt-search-wrap { display: none; }
  .yt-grid { grid-template-columns: 1fr 1fr; gap: 12px 10px; padding: 12px; }
  .yt-card__title { font-size: 0.82rem; }
}
@media (max-width: 460px) {
  .yt-grid { grid-template-columns: 1fr; }
}

/* phones: tighten the YouTube chrome so nothing is cramped */
@media (max-width: 560px) {
  .tool { padding-top: clamp(120px, 26vw, 150px); }
  .tool__views button { padding: 9px 15px; font-size: 0.82rem; }
  .yt { border-radius: 12px; }
  .yt-header { gap: 10px; padding: 8px 12px; height: 50px; }
  .yt-logo { font-size: 1.1rem; }
  .yt-chips { padding: 8px 12px; }
  .yt-grid { padding: 12px; }
  .yt-watch { padding: 14px; gap: 16px; }
  .yt-watch__title { font-size: 1.02rem; margin: 12px 0 8px; }
  .yt-sub { padding: 8px 14px; font-size: 0.8rem; }
  .yt-side__thumb { width: 132px; }
  .yt-side__title { font-size: 0.8rem; }
}
