/* ============================================================
   YT Lite Tools — Styles
   Tipografía: Roboto | Acento: #FF2D20 | BG: #FBFBFC
   ============================================================ */

/* ---- Lucide SVGs globales ---- */
svg.lucide { stroke-width: 2px; display: inline-block; vertical-align: middle; }

/* ---- Reset base ---- */
.ytlite-widget *,
.ytl * { box-sizing: border-box;margin: 0 0.4rem;}

/* ---- Form widgets (todos los shortcodes) ---- */
.ytlite-widget {
  font-family: 'Roboto', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: #16181D;
  max-width: 780px;
  margin: 24px 0;
  -webkit-font-smoothing: antialiased;
}

.ytlite-label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 14px;
  color: #374151;
}

.ytlite-input-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  background: #fff;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid #ECECF0;
  box-shadow: 0 8px 30px -18px rgba(16,18,29,.2);
}

.ytlite-input {
  flex: 1 1 260px;
  padding: 10px 14px;
  border: 0;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 15px;
  color: #16181D;
}

.ytlite-btn {
  padding: 10px 22px;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s, opacity 0.18s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.ytlite-btn--primary { background: #FF2D20; color: #fff; }
.ytlite-btn--primary:hover { background: #E11D12; }
.ytlite-btn--secondary { background: #F3F4F6; color: #374151; border: 1px solid #E5E7EB; }
.ytlite-btn--secondary:hover { background: #E5E7EB; }
.ytlite-btn:disabled { opacity: .55; cursor: not-allowed; }

.ytlite-status { margin-top: 12px; min-height: 20px; font-size: 14px; color: #6B7280; }
.ytlite-status--error { color: #DC2626; font-weight: 600; }

.ytlite-results { margin-top: 20px; }

.ytlite-disclaimer {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  background: #FFF6F5;
  border: 1px solid #FFE2DE;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 13px;
  color: #8A4B45;
  line-height: 1.5;
}

/* ============================================================
   Canal — Panel profesional (.ytl)
   ============================================================ */

.ytl {
  font-family: 'Roboto', system-ui, sans-serif;
  color: #0D0D0D;
  -webkit-font-smoothing: antialiased;
  background: #FFF;
}

/* ---- Iconos Lucide: forzar tamaño y flex en SVG resultante ---- */
.ytl-info-card__icon svg,
.ytl-info-card__icon i   { width: 20px; height: 20px; color: #FF2D20; }

.ytl-hero-card__label svg,
.ytl-hero-card__label i  { width: 15px; height: 15px; color: #FF2D20; flex: 0 0 auto; }

.ytl-disclaimer {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-start !important;
  gap: 10px !important;
  margin-top: 14px;
  background: #FFF6F5 !important;
  border: 1px solid #FFE2DE !important;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 13px;
  color: #8A4B45;
  line-height: 1.5;
  box-sizing: border-box;
}

.ytl-disclaimer > svg {
  display: block;
  flex: 0 0 18px !important;
  width: 18px !important;
  height: 18px !important;
  min-width: 18px;
  margin-top: 1px;
}

.ytl-disclaimer > span {
  display: block;
  min-width: 0;
  flex: 1;
}

.ytl-tag svg,
.ytl-tag i               { width: 13px; height: 13px; color: #FF2D20; flex: 0 0 auto; }

.ytl-badge svg,
.ytl-badge i             { width: 13px; height: 13px; flex: 0 0 auto; }

.ytl-score__fill + .ytl-detail-table svg { width: 14px; height: 14px; }

/* ---- Banner ---- */
.ytl-banner {
  border-radius: 18px 18px 0 0;
  overflow: hidden;
  max-height: 200px;
}
.ytl-banner img { width: 100%; display: block; object-fit: cover; max-height: 200px; }

/* ---- Header card ---- */
.ytl-header-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  background: #fff;
  border: 1px solid #ECECF0;
  border-radius: 18px;
  padding: 22px 26px;
  box-shadow: 0 1px 2px rgba(16,18,29,.04);
  margin-bottom: 0;
}

.ytl-header-card--has-banner {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  border-top: none;
}

.ytl-header-card__left { display: flex; align-items: center; gap: 18px; }

.ytl-header__avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
  border: 2px solid #ECECF0;
}

.ytl-header__initials {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #EDEFF2;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 20px;
  color: #6B7280;
  flex: 0 0 auto;
}

.ytl-header-card__name-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ytl-header-card__name {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.ytl-header-card__meta { margin-top: 5px; color: #6B7280; font-size: 14px; }

.ytl-header-card__stats { display: flex; gap: 36px; align-items: center; }

.ytl-stat-block { text-align: right; }
.ytl-stat-block__num {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.ytl-stat-block__label {
  color: #818181;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-top: 2px;
}

.ytl-stat-divider { width: 1px; height: 40px; background: #EDEDF0; }

/* ---- Badges ---- */
.ytl-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.ytl-badge--green  { background: #E9F9EF; color: #15803D; }
.ytl-badge--yellow { background: #FEFCE8; color: #854D0E; }
.ytl-badge--red    { background: #FEE2E2; color: #991B1B; }

/* ---- Secciones ---- */
.ytl-section { margin-top: 44px; }

.ytl-section__head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }

.ytl-section__bar {
  width: 4px;
  height: 20px;
  border-radius: 2px;
  background: #FF2D20;
  flex: 0 0 auto;
}

.ytl-section__title {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.ytl-section__sub { margin: 0 0 18px 14px; color: #818181; font-size: 13px; }

/* ---- Info grid (3×3) ---- */
.ytl-info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 18px;
}

.ytl-info-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: #fff;
  border: 1px solid #ECECF0;
  border-radius: 14px;
  padding: 18px;
  transition: border-color .18s, box-shadow .18s;
}

.ytl-info-card:hover {
  border-color: #FFD2CC;
  box-shadow: 0 6px 20px -14px rgba(255,45,32,.35);
}

.ytl-info-card__icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #FFF1F0;
  color: #FF2D20;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.ytl-info-card__label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #818181;
}

.ytl-info-card__value {
  margin-top: 4px;
  font-size: 15px;
  font-weight: 600;
  color: #22252B;
  line-height: 1.35;
}

/* ---- Hero revenue cards ---- */
.ytl-hero-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 18px;
}

.ytl-hero-card {
position: relative;
    overflow: hidden;
    background: #f8f6f2;
    border: 1px solid #F6F1E7;
    border-radius: 16px;
    padding: 22px 22px 20px;
}

.ytl-hero-card__stripe {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 0px;
  background: #FF2D20;
}

.ytl-hero-card__label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #818181;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.ytl-hero-card__num {
  margin-top: 12px;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
}

.ytl-hero-card__range {
  margin-top: 6px;
  color: #818181;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

/* ---- Detail table ---- */
.ytl-detail-table {
  margin-top: 14px;
  background: #fff;
  border: 1px solid #ECECF0;
  border-radius: 16px;
  overflow: hidden;
}

.ytl-detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 22px;
  border-top: 1px solid #F3F3F5;
  background: #fff;
}

.ytl-detail-row:first-child { border-top: none; }
.ytl-detail-row--alt { background: #FBFBFC; }

.ytl-detail-row__label { color: #6B7280; font-size: 14px; font-weight: 500; }
.ytl-detail-row__value {
  color: #16181D;
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* ---- Category Revenue Matrix ---- */
.ytl-matrix {
  background: #fff;
  border: 1px solid #ECECF0;
  border-radius: 16px;
  overflow: hidden;
  margin-top: 18px;
}

.ytl-matrix__head {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  padding: 13px 22px;
  background: #FAFAFB;
  border-bottom: 1px solid #ECECF0;
}

.ytl-matrix__head span {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #818181;
}

.ytl-matrix__head span:not(:first-child) { text-align: right; }

.ytl-matrix__row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  align-items: center;
  padding: 13px 22px;
  border-top: 1px solid #F3F3F5;
  font-size: 14px;
  font-weight: 600;
  color: #22252B;
}

.ytl-matrix__row--alt { background: #FBFBFC; }

.ytl-matrix__row--active {
  background: #FF2D20 !important;
  color: #fff !important;
  font-weight: 600;
}

.ytl-matrix__row span:not(:first-child) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.ytl-matrix-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(255,255,255,.22);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .03em;
  margin-left: 8px;
}

/* ---- Notas del canal ---- */
.ytl-notes {
  background: #fff;
  border: 1px solid #ECECF0;
  border-radius: 16px;
  overflow: hidden;
  margin-top: 18px;
}

.ytl-note-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 16px;
  align-items: start;
  padding: 16px 22px;
  border-bottom: 1px solid #F3F3F5;
}

.ytl-note-row:last-child { border-bottom: none; }

.ytl-note-row__label { color: #818181; font-size: 13px; font-weight: 600; padding-top: 2px; }
.ytl-note-row__value { color: #22252B; font-size: 14px; font-weight: 600; }

.ytl-note-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}

.ytl-note-banner {
  width: 100%;
  max-width: 420px;
  border-radius: 10px;
  display: block;
}

.ytl-note-desc { font-size: 14px; color: #4B5563; line-height: 1.6; font-weight: 400; white-space: pre-line; }

/* ---- Tags ---- */
.ytl-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.ytl-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  background: #fff;
  border: 1px solid #ECECF0;
  border-radius: 999px;
  font-family: 'Roboto', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #4B5563;
  cursor: default;
  transition: border-color .18s, color .18s;
}

.ytl-tag:hover { border-color: #FFD2CC; color: #FF2D20; }
.ytl-tag i { color: #FF2D20; }

/* ---- Monetization score bar ---- */
.ytl-score { margin-bottom: 14px; }
.ytl-score__label { font-size: 13px; color: #6B7280; margin-bottom: 6px; }
.ytl-score__bar { height: 10px; background: #F3F4F6; border-radius: 99px; overflow: hidden; }
.ytl-score__fill { height: 100%; border-radius: 99px; transition: width .6s ease; }

/* ============================================================
   Vista de VIDEO — nuevo sistema .ytl
   ============================================================ */

/* Banner para video: muestra thumbnail en 16:9 completo */
.ytl-banner--video {
  max-height: none;
  border-radius: 18px 18px 0 0;
}

.ytl-banner--video img {
  max-height: none;
  aspect-ratio: 16/9;
  object-fit: cover;
}

/* Título de video: puede ser largo, fuente un poco menor */
.ytl-video-title {
  font-size: 18px !important;
  line-height: 1.4;
  font-weight: 800;
}

/* ============================================================
   Vista de VIDEO — estilos legacy (fallback)
   ============================================================ */

.ytlite-video-card {
  border: 1px solid #ECECF0;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  margin-bottom: 20px;
  font-family: 'Roboto', system-ui, sans-serif;
}

.ytlite-video-card__thumb {
  width: 100%;
  display: block;
  aspect-ratio: 16/9;
  object-fit: cover;
  background: #F3F4F6;
}

.ytlite-video-card__body { padding: 18px 22px; }
.ytlite-video-card__title { font-size: 18px; font-weight: 800; margin: 0 0 10px; line-height: 1.4; letter-spacing: -0.01em; }

.ytlite-video-card__channel {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  margin: 0 0 6px;
}

.ytlite-video-card__ch-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.ytlite-video-card__meta { font-size: 13px; color: #6B7280; margin: 0; }

/* ---- Stats table (vista de video + fallback) ---- */
.ytlite-stats-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid #ECECF0;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 16px;
  font-family: 'Roboto', system-ui, sans-serif;
}

.ytlite-stats-table th,
.ytlite-stats-table td { padding: 13px 18px; text-align: left; border-bottom: 1px solid #F3F3F5; }

.ytlite-stats-table thead th {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #818181;
  background: #FAFAFB;
}

.ytlite-stats-table th { font-weight: 600; color: #6B7280; font-size: 14px; }
.ytlite-stats-table td { font-weight: 600; font-size: 14px; color: #16181D; }
.ytlite-stats-table tr:last-child td, .ytlite-stats-table tr:last-child th { border-bottom: none; }

/* ---- Earnings cards (shortcode independiente) ---- */
.ytlite-earnings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.ytlite-earn-card {
  position: relative;
  background: #fff;
  border: 1px solid #ECECF0;
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  overflow: hidden;
}

.ytlite-earn-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: #FF2D20;
}

.ytlite-earn-card__period {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #818181;
  margin-bottom: 10px;
}

.ytlite-earn-card__mid { font-size: 24px; font-weight: 800; color: #16181D; letter-spacing: -0.02em; margin: 4px 0; }
.ytlite-earn-card__range { font-size: 12px; color: #818181; font-variant-numeric: tabular-nums; }

/* ---- Canal colapsable en vista de video ---- */
.ytlite-channel-details {
  margin-top: 20px;
  border: 1px solid #ECECF0;
  border-radius: 16px;
  overflow: hidden;
  font-family: 'Roboto', system-ui, sans-serif;
}

.ytlite-channel-details summary {
  padding: 14px 20px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  background: #FAFAFB;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #ECECF0;
}

.ytlite-channel-details summary::before {
  content: '▶';
  font-size: 10px;
  color: #FF2D20;
  transition: transform .2s;
}

.ytlite-channel-details[open] summary::before { transform: rotate(90deg); }

/* ---- Thumbnail downloader ---- */
.ytlite-thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.ytlite-thumb-item {
  border: 1px solid #ECECF0;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}

.ytlite-thumb-item img {
  width: 100%;
  display: block;
  aspect-ratio: 16/9;
  object-fit: cover;
  background: #F3F4F6;
}

.ytlite-thumb-item__footer {
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.ytlite-thumb-item__label { font-size: 12px; color: #6B7280; font-weight: 600; font-family: 'Roboto', system-ui, sans-serif; }
.ytlite-thumb-item__footer .ytlite-btn { font-size: 13px; padding: 6px 12px; }

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 640px) {
  .ytl-info-grid { grid-template-columns: repeat(2, 1fr); }
  .ytl-hero-cards { grid-template-columns: 1fr; }
  .ytl-header-card { flex-direction: column; align-items: flex-start; }
  .ytl-header-card__stats { justify-content: flex-start; }
  .ytl-note-row { grid-template-columns: 130px 1fr; }
}

@media (max-width: 460px) {
  .ytlite-input { flex: 1 1 60px;}
  .ytlite-input-row { flex-direction: column; }
  .ytlite-btn { width: 100%; justify-content: center; }
  .ytl-info-grid { grid-template-columns: 1fr; }
  .ytl-note-row { grid-template-columns: 1fr; }
  .ytl-note-row__label { padding-bottom: 4px; }
}
