/* ====== ADMIN WRAPPER ====== */
.sbc-admin-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 20px;
    padding: 10px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* ====== ADMIN – TABELA ====== */
.sbc-admin-table {
    width: 100%;
    min-width: 1000px;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* Cabeçalho */
.sbc-admin-table thead th {
    background: #f3f4f6;
    font-weight: 600;
    text-align: center;
    padding: 10px;
    white-space: nowrap;
    border-bottom: 2px solid #e1e4e8;
    color: #111827;
}

/* Zebra striping */
.sbc-admin-table tbody tr:nth-child(even) { background: #fafafa; }
.sbc-admin-table tbody tr:hover { background: #f1f5f9; }

/* Células */
.sbc-admin-table td {
    border-bottom: 1px solid #eef0f3;
    padding: 8px 10px;
    text-align: center;
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: background 0.2s ease;
}

/* ===== LARGURA DAS COLUNAS ===== */
.sbc-admin-table th:nth-child(1),
.sbc-admin-table td:nth-child(1) { width: 50px; }

.sbc-admin-table th:nth-child(2),
.sbc-admin-table td:nth-child(2) { width: 25%; text-align: left; }

.sbc-admin-table th:nth-child(3),
.sbc-admin-table td:nth-child(3) { width: 60px; }

.sbc-admin-table th:nth-child(4),
.sbc-admin-table td:nth-child(4) { width: 90px; }

.sbc-admin-table th:nth-child(5),
.sbc-admin-table td:nth-child(5) { width: 200px; text-align: left; }

.sbc-admin-table th:nth-child(6),
.sbc-admin-table td:nth-child(6),
.sbc-admin-table th:nth-child(7),
.sbc-admin-table td:nth-child(7) { width: 120px; }

.sbc-admin-table th:nth-child(8),
.sbc-admin-table td:nth-child(8),
.sbc-admin-table th:nth-child(9),
.sbc-admin-table td:nth-child(9) { width: 160px; }

/* ===== CAMPOS ===== */
.sbc-admin-table td input[type="url"] {
    width: 95%;
    padding: 6px 8px;
    font-size: 13px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    transition: border 0.2s ease, box-shadow 0.2s ease;
}
.sbc-admin-table td input[type="url"]:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59,130,246,0.2);
    outline: none;
}

.sbc-admin-table td input[type="number"] {
    width: 60px;
    text-align: center;
    padding: 6px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
}

/* ===== BOTÕES ===== */
.sbc-admin-table .button {
    margin: 0 3px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

/* Botão Salvar */
.sbc-admin-table .button.save { background: #3b82f6; color: #fff; }
.sbc-admin-table .button.save:hover { background: #2563eb; }

/* Botão Excluir */
.sbc-admin-table .button.delete { background: #ef4444; color: #fff; }
.sbc-admin-table .button.delete:hover { background: #dc2626; }

/* ===== SWITCH (Status) ===== */
.sbc-switch {
    position: relative;
    width: 42px;
    height: 22px;
    display: inline-block;
}
.sbc-switch input { opacity: 0; width: 0; height: 0; }
.sbc-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #d1d5db;
    border-radius: 22px;
    transition: .4s;
}
.sbc-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: .4s;
}
.sbc-switch input:checked + .sbc-slider { background-color: #3b82f6; }
.sbc-switch input:checked + .sbc-slider:before { transform: translateX(20px); }

/* ===== HISTÓRICO ===== */
.sbc-hist {
    font-family: monospace;
    font-size: 12px;
    line-height: 1.35em;
    max-height: 80px;
    overflow-y: auto;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 6px;
    color: #374151;
}
.sbc-hist::-webkit-scrollbar { width: 6px; }
.sbc-hist::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

/* ==================== SBC TV – FUNDO ==================== */
.sbc-tv-faixa {
    width: 100vw !important;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    background: #383838;
    padding: 40px 30px;
    box-sizing: border-box;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.4);
}

/* ==================== BLOCO CENTRAL ==================== */
.sbc-tv-bloco {
  max-width: 1467px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  align-items: stretch;
}

/* Vídeo grande */
.sbc-tv-grande iframe {
  width: 100%;
  height: 100%;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  object-fit: cover;
}

/* Miniaturas (4 vídeos) */
.sbc-tv-lado {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.sbc-tv-mini iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.sbc-tv-mini iframe:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}

/* ===================== RESPONSIVO — ALINHAMENTO EXATO ===================== */
/* 1366px (desktop padrão) — alinhamento perfeito entre vídeo grande e 4 miniaturas */
@media (min-width:1200px) and (max-width:1368px) {

  /* Fundo cinza total */
  .sbc-tv-faixa {
    width: 104vw !important;
    margin-left: calc(31% - 78vw) !important;
    margin-right: 0 !important;
    padding: 27px 0 !important;
    background: #2f2f2f !important;
  }

  /* Bloco principal — alinhamento preciso */
  .sbc-tv-bloco {
    max-width: 1280px !important;
    margin: 0 66px !important;
    padding: 0 2px !important;
    display: grid !important;
    grid-template-columns: 1fr 515px !important; /* ← ajuste fino: pixel-perfect em 1366px */
    column-gap: 8px !important;
    align-items: start !important;
  }

  /* Vídeo principal */
  .sbc-tv-grande {
    grid-column: 1 / 2 !important;
    width: 100% !important;
    margin: 0 !important;
  }

  .sbc-tv-grande iframe {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 9 !important;
    display: block !important;
    border-radius: 6px !important;
  }

  /* Grade lateral (4 vídeos — 2x2) */
  .sbc-tv-lado {
    grid-column: 2 / 3 !important;
    display: grid !important;
    grid-template-columns: repeat(2, 250px) !important;
    grid-auto-rows: 200px !important;
    gap: 10px !important;
    justify-content: end !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .sbc-tv-mini iframe {
    width: 100% !important;
    height: 103% !important;
    aspect-ratio: 16 / 9 !important;
    object-fit: cover;
    display: block;
    border-radius: 6px !important;
    position: relative;
    left: 0 !important;
  }
}

/* === CORREÇÃO FINAL – vídeo grande mais alto (1024–1199px) === */
@media (min-width:1024px) and (max-width:1199px) {
  .sbc-tv-faixa {
    width: 101vw !important;
    margin-left: 0 !important;
    padding: 28px 0 !important;
    background: #2f2f2f !important;
    display: flex !important;
    justify-content: center !important;
  }

  .sbc-tv-bloco {
    display: grid !important;
    grid-template-columns: 1.08fr 520px !important;
    align-items: start !important;
    justify-content: center !important;
    max-width: 1200px !important;
    margin: 0 66px !important;
    padding: 0 2px !important;
    gap: 20px !important;
    overflow: visible !important;
  }

  .sbc-tv-grande {
    position: relative !important;
    width: 100% !important;
    height: 600px !important;
    min-height: 600px !important;
    overflow: hidden !important;
  }

  .sbc-tv-grande iframe,
  .sbc-tv-grande iframe[height] {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    display: block !important;
  }

  .sbc-tv-lado {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }

  .sbc-tv-lado iframe {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 9 !important;
  }
}

/* 768–1023px — Tablet landscape */
@media (min-width:768px) and (max-width:1023px) {
  .sbc-tv-faixa {
    width: 100vw !important;
    margin-left: calc(50% - 50vw) !important;
    background: #2f2f2f !important;
    padding: 22px 0 !important;
  }

  .sbc-tv-bloco {
    max-width: 920px !important;
    margin: 0 auto !important;
    padding: 0 20px !important;
    grid-template-columns: 1fr !important;
    row-gap: 20px !important;
  }

  .sbc-tv-lado {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }
}

/* <768px — Celulares */
@media (max-width:767px) {
  .sbc-tv-faixa {
    width: 100vw !important;
    margin-left: calc(50% - 50vw) !important;
    background: #2f2f2f !important;
    padding: 18px 0 !important;
  }

  .sbc-tv-bloco {
    max-width: 640px !important;
    margin: 0 auto !important;
    padding: 0 16px !important;
    grid-template-columns: 1fr !important;
    row-gap: 16px !important;
  }

  .sbc-tv-lado {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
}
/* ===================== SBC TV – SIDEBAR ===================== */
.sbc-tv-sidebar,
#secondary .sbc-tv-sidebar,
.sidebar .sbc-tv-sidebar {
    position: relative;
    width: 114% !important;    /* aumenta um pouco mais para cobrir o recuo do tema */
    max-width: 114% !important;
    left: -7% !important;      /* puxa proporcionalmente para a esquerda */
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    overflow: visible !important;
}

/* Garante que o título e o vídeo fiquem alinhados */
.sbc-tv-sidebar h3 {
    color: #ffcc00;
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 12px !important;
    border-bottom: 3px solid #ffcc00;
    display: block;
    padding: 0 6px !important;      /* adiciona respiro lateral controlado */
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;              /* garante alinhamento da linha */
    width: 98% !important;         /* iguala ao vídeo */
    margin-left: 1% !important;
}

/* iframe segue alinhamento do h3 */
.sbc-tv-sidebar iframe {
    width: 98% !important;
    max-width: 98% !important;
    margin-left: 1% !important;
    height: auto !important;
    aspect-ratio: 16 / 9;
    display: block;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.35);
    background: #000;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}


/* ===== Hover ===== */
.sbc-tv-sidebar iframe:hover {
    transform: scale(1.04);
    box-shadow: 0 10px 25px rgba(255,204,0,0.4);
}

/* ===== Remove margens/paddings de containers ===== */
.widget_sbc_tv,
.elementor-widget-container,
#secondary {
    padding-left: 0 !important;
    padding-right: 0 !important;
    width: 100% !important;
    margin: 0 !important;
    background: transparent !important;
}

/* ===================== RESPONSIVIDADE ===================== */
@media (max-width: 1024px) {
    .sbc-tv-sidebar {
        width: 100% !important;
        left: 0 !important;
        padding: 14px !important;
    }

    .sbc-tv-sidebar iframe {
        aspect-ratio: 16 / 9;
        border-radius: 8px;
        box-shadow: none;
    }
}

@media (max-width: 768px) {
    .sbc-tv-sidebar iframe {
        width: 100vw !important;
        max-width: 100vw !important;
        margin-left: calc(-50vw + 50%) !important;
        border-radius: 0;
        box-shadow: none;
    }
}

@media (max-width: 480px) {
    .sbc-tv-sidebar {
        padding: 10px !important;
    }

    .sbc-tv-sidebar h3 {
        font-size: 16px !important;
    }

    .sbc-tv-sidebar iframe {
        width: 100% !important;
        border-radius: 8px !important;
    }
}
