/* ===== CANAL CARDS (PÁGINA DE CANAIS) ===== */
.channel-card {
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    padding: 25px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    position: relative;
    z-index: 1;
}

/* ===== PÁGINAS INTERNAS DOS CANAIS ===== */

/* CSS específico para usar o sistema de cores gerado nas páginas de canal */
.section-header .canal-aquarismo .canal-linha-topo,
.section-header .canal-andarilho .canal-linha-topo,
.section-header .canal-kids .canal-linha-topo,
.section-header .canal-memories .canal-linha-topo,
.section-header .canal-parentalidade .canal-linha-topo,
.section-header .canal-dump .canal-linha-topo,
.section-header .canal-rabiscos .canal-linha-topo,
.section-header .canal-comprao .canal-linha-topo,
.section-header .canal-eletroinfo .canal-linha-topo,
.section-header .canal-terravision .canal-linha-topo {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 60px;
    border-radius: 3px;
}

/* Hero Section do Canal */
.hero-canal {
    background: linear-gradient(135deg, #1d44b8 0%, #2563eb 100%);
    color: white;
    padding: 80px 0 60px;
    position: relative;
    overflow: visible;
}

.hero-canal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="%23ffffff" opacity="0.05"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>') repeat;
    opacity: 0.3;
}

.hero-canal .container {
    position: relative;
    z-index: 2;
}

.hero-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

.hero-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.hero-icon {
    font-size: 4rem;
    display: block;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.hero-tools {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 99999;
}

.hero-tools-button {
    background: rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.3);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    font-size: 1rem;
}

.hero-tools-button:hover {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.5);
    transform: translateY(-2px);
}

.hero-tools-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  left: auto;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  min-width: 320px;
  width: max-content;
  padding: 0.5rem 0;
  z-index: 1001;
  border: 1px solid #e5e7eb;
}

.hero-tools-dropdown.align-left {
  right: auto;
  left: 0;
}

.tools-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tool-list-item {
  padding: 0;
}

.tool-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 24px;
  color: #222;
  text-decoration: none;
  font-size: 1rem;
  border: none;
  background: none;
  width: 100%;
  box-sizing: border-box;
  transition: background 0.2s;
  border-radius: 0;
  cursor: pointer;
}

.tool-link:hover, .tool-list-item.view-all .tool-link {
  background: #f3f6fa;
}

.tool-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
  width: 32px;
  text-align: center;
}

.tool-title {
  flex: 1;
  font-weight: 500;
  white-space: normal;
  word-break: break-word;
}

.tool-list-item.view-all .tool-link {
  color: #2563eb;
  font-weight: 600;
  border-top: 1px solid #e5e7eb;
  margin-top: 4px;
}

.hero-tools-dropdown.show {
    display: block;
    animation: dropdown-fade-in 0.2s ease-out;
}

@keyframes dropdown-fade-in {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hover para mostrar dropdown */
.hero-tools:hover .hero-tools-dropdown {
    display: block;
    animation: dropdown-fade-in 0.2s ease-out;
}

.tool-item {
    margin-bottom: 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.tool-item:last-child {
    margin-bottom: 0;
}

.tool-item:hover {
    background-color: #f8fafc;
    transform: translateX(5px);
}

.tool-item a {
    display: flex;
    align-items: center;
    padding: 12px;
    color: #333;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    gap: 12px;
}

.tool-item a:hover {
    background-color: transparent;
    color: #0ea5e9;
}

.tool-icon {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border-radius: 8px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.tool-item:hover .tool-icon {
    background: #e0f2fe;
}

.tool-info {
    flex: 1;
}

.tool-info h4 {
    margin: 0 0 4px 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.2;
}

.tool-info p {
    margin: 0;
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.3;
}

.tool-item.view-all {
    border-top: 1px solid #e2e8f0;
    padding-top: 12px;
    margin-top: 8px;
}

.tool-item.view-all a {
    font-weight: 600;
}

.tool-item.view-all:hover .tool-icon {
    background: #dbeafe;
}

.tool-item.view-all .tool-info h4 {
    color: #0ea5e9;
}



/* REMOVIDO: CSS estático substituído pelo sistema dinâmico em canais-generated.css */
/* Agora todos os backgrounds de canal são gerenciados pelo sistema dinâmico */

/* Main Content */
.main-content {
    padding: 60px 0;
    background: #f8fafc;
    position: relative;
    z-index: 1;
}

/* Section Headers com linha colorida */
.section-header {
    margin-bottom: 40px;
    position: relative;
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    padding-left: 20px;
    position: relative;
}

.linha-topo {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 60px;
    border-radius: 3px;
}

/* REMOVIDO: CSS estático substituído pelo sistema dinâmico em canais-generated.css */
/* Agora todas as cores das linhas são gerenciadas pelo sistema dinâmico */

/* Content Sections */
.content-section {
    margin-bottom: 80px;
}

/* Featured Video Section */
.featured-video-section {
    background: white;
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 60px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    position: relative;
}

.featured-star {
    position: absolute;
    top: 0px;
    right: 0px;
    font-size: 1.5rem;
}

.featured-video-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.video-player {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    background: #000;
    aspect-ratio: 16/9;
}

.video-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1e293b, #334155);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
}

.play-button {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.8;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.play-button:hover {
    opacity: 1;
}

.video-info h3 {
    font-size: 2rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 15px;
    line-height: 1.3;
}

.video-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    font-weight: 600;
    color: #64748b;
}

.video-description {
    color: #475569;
    line-height: 1.6;
    margin-bottom: 20px;
}

.video-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag {
    background: #e2e8f0;
    color: #475569;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Content Grid com Carrossel */
.content-grid {
    position: relative;
    margin-bottom: 40px;
}

.content-scroll-container {
    display: flex;
    gap: 25px;
    padding: 20px 0;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    cursor: grab; /* Cursor de arrastar */
}

.content-scroll-container.active {
    cursor: grabbing; /* Cursor quando está arrastando */
}

.content-scroll-container::-webkit-scrollbar {
    height: 8px;
}

.content-scroll-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.content-scroll-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.content-scroll-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Navigation Buttons */
.section-navigation {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    pointer-events: auto;
}

.section-navigation:hover {
    background: #1d44b8;
    color: white;
    border-color: #1d44b8;
    transform: translateY(-50%) scale(1.1);
}

.nav-prev {
    left: -60px;
}

.nav-next {
    right: -60px;
}

/* Content Cards */
.content-card {
    flex: 0 0 320px;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    z-index: 1;
    /* Usar onclick como no HERO funcional */
}

.content-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.content-card:active {
    transform: translateY(-4px);
}

.card-thumbnail {
    position: relative;
    height: 180px;
    overflow: hidden;
}

.card-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.content-card:hover .card-thumbnail img {
    transform: scale(1.05);
}

.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.7);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-card:hover .play-overlay {
    opacity: 1;
}

.pdf-overlay, .article-category, .video-duration, .pdf-pages {
    position: absolute;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

/* Estilos específicos para livros HTML */
.livro-html-overlay, .livro-html-pages {
    position: absolute;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.livro-html-overlay {
    top: 10px;
    left: 10px;
    background: rgba(34, 197, 94, 0.9); /* Verde para diferenciar de PDFs */
}

.livro-html-pages {
    bottom: 10px;
    right: 10px;
    background: rgba(0,0,0,0.8);
}

.card-content {
    padding: 25px;
}

.card-content h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 12px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-content p {
    color: #64748b;
    line-height: 1.5;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #94a3b8;
    font-weight: 600;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 10px;
}

.tag-small {
    background: #e2e8f0;
    color: #64748b;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Content Filters */
.content-filters {
    margin-bottom: 50px;
    text-align: center;
}

.filter-buttons {
    display: inline-flex;
    background: white;
    border-radius: 50px;
    padding: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    gap: 5px;
}

.filter-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 25px;
    background: transparent;
    color: #64748b;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.filter-btn:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.filter-btn.active {
    background: #1d44b8;
    color: white;
    box-shadow: 0 4px 12px rgba(29, 68, 184, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-canal {
        padding: 60px 0 20px;
    }

    .hero-header {
        flex-direction: row;
        gap: 15px;
    }
    
    .hero-title {
        font-size: clamp(1.5rem, 4vw, 2.2rem);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .hero-icon {
        font-size: 3rem;
    }
    
    .hero-content {
        padding-top: 15px;
    }
    
    .hero-tools {
        bottom: 0px;
        right: 15px;
    }
    
    .hero-tools-button {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .featured-video-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    /* Título do vídeo em destaque com margem para não tocar na estrela */
    .featured-video-section .video-info h3 {
        margin-right: 1.7rem;
    }
    
    .section-header h2 {
        font-size: 1.3rem; /* Reduzido de 2rem para 1.3rem (35% menor) */
    }
    
    /* Cards 35% menores para mobile */
    .content-card {
        flex: 0 0 160px; /* Reduzido de 250px para 160px (36% menor) */
    }
    
    .card-thumbnail {
        height: 115px; /* Reduzido de 180px para 115px (36% menor) */
    }
    
    .card-content {
        padding: 10px; /* Reduzido de 15px para 10px */
    }
    
    .card-content h3 {
        font-size: 0.85rem; /* Reduzido de 1.3rem para 0.85rem */
        margin-bottom: 6px;
        -webkit-line-clamp: 3;
    }
    
    .card-content p {
        font-size: 0.75rem; /* Reduzido para mobile */
        line-height: 1.3;
        margin-bottom: 8px;
        -webkit-line-clamp: 5;
    }
    
    .card-meta {
        font-size: 0.7rem; /* Reduzido para mobile */
        gap: 8px;
    }
    
    /* Gap menor entre cards e manter comportamento horizontal */
    .content-scroll-container {
        gap: 16px; /* Reduzido de 25px para 16px (36% menor) */
        padding: 15px 0; /* Reduzido de 20px para 15px */
        /* Garantir que mantenha o comportamento de carrossel horizontal */
        display: flex;
        overflow-x: auto;
        overflow-y: hidden;
    }
    
    .nav-prev {
        left: -50px; /* Movido mais para fora em mobile também */
    }
    
    .nav-next {
        right: -50px; /* Movido mais para fora em mobile também */
    }
    
    /* Botões de navegação mantidos visíveis no mobile */
    .section-navigation {
        width: 40px; /* Menor para mobile */
        height: 40px; /* Menor para mobile */
        font-size: 1.2rem; /* Menor para mobile */
    }
    
    .filter-buttons {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .filter-btn {
        padding: 6px 12px; /* Reduzido de 10px 20px */
        font-size: 0.8rem; /* Reduzido de 0.9rem */
    }
    
    .featured-video-section {
        background: transparent;
        padding: 0;
        margin: 0;
        box-shadow: none;
        margin-top: -120px; /* Encosta completamente no hero */
        margin-bottom: 20px;
    }

    .featured-video-section .section-header {
        display: none;
    }

    .featured-carousel-indicators {
        display: none !important;
    }

    /* Ocultar títulos das seções de conteúdo no mobile */
    #videos-section .section-header,
    #artigos-section .section-header,
    #pdfs-section .section-header {
        display: none;
    }

    /* Ocultar botões laterais de navegação no mobile */
    .section-navigation {
        display: none;
    }

    /* Adicionar ícones ilustrativos no canto superior esquerdo das content-grids */
    #videos-section .content-grid::before {
        content: "\f03d";
        font-family: 'Font Awesome 6 Free';
        font-weight: 900;
        position: absolute;
        top: 0px;
        left: -15px;
        font-size: 1.5rem;
        z-index: 10;
        background: rgba(255, 255, 255, 0.9);
        padding: 5px;
        border-radius: 50%;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }

    #artigos-section .content-grid::before {
        content: "\f15c";
        font-family: 'Font Awesome 6 Free';
        font-weight: 900;
        position: absolute;
        top: 0px;
        left: -15px;
        font-size: 1.5rem;
        z-index: 10;
        background: rgba(255, 255, 255, 0.9);
        padding: 5px;
        border-radius: 50%;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }

    #pdfs-section .content-grid::before {
        content: "\f02d";
        font-family: 'Font Awesome 6 Free';
        font-weight: 900;
        position: absolute;
        top: 0px;
        left: -15px;
        font-size: 1.5rem;
        z-index: 10;
        background: rgba(255, 255, 255, 0.9);
        padding: 5px;
        border-radius: 50%;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }

    /* Garantir que as content-grids tenham posição relativa para os ícones */
    .content-grid {
        position: relative;
    }

    .main-content {
        padding-top: 20px;
    }

    .video-info h3,
    .video-description,
    .video-meta,
    .video-tags {
        display: none;
    }
    .content-card.desktop { display: none !important; }
    .content-card.mobile { display: block !important; }
    .featured-title-mobile {
      display: block;
      font-size: 1.05rem;
      font-weight: 600;
      color: #1e293b;
      text-align: center;
      margin: 10px 0 0 0;
      line-height: 1.3;
      padding: 0 8px;
      word-break: break-word;
    }
    .featured-video-container + .featured-title-mobile {
      margin-top: 8px;
    }
    /* Esconde o título desktop no mobile (já está em display: none via .video-info h3) */
}

@media (max-width: 768px) {
    .content-filters {
        margin-bottom: 0 !important;
    }
    .ferramentas-mobile-container {
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        box-sizing: border-box;
        position: relative;
        left: 50%;
        right: 50%;
        transform: translateX(-50%);
    }
}

/* ===== Ajuste Desktop: ocultar cabeçalho 'Vídeos em Destaque' ===== */
@media (min-width: 769px) {
    .featured-video-section .section-header {
        display: none;
    }
}

/* Ajuste Canal: remover espaço extra no desktop sem afetar mobile */
@media (min-width: 769px) {
    /* Ajustar espaço inferior do hero e superior do carrossel */
    .hero-canal {
        padding-bottom: 60px !important; /* era 40px */
    }

    .hero-canal ~ .main-content {
        margin-top: 0; /* já existente */
        padding-top: 0; /* remove padding superior de 20px herdado */
    }

    .featured-video-section {
        margin-top: 20px; /* reduzido de 40px */
    }
}

@media (min-width: 769px) {
    /* Featured video section: remover caixa, economizar espaço */
    .featured-video-section {
        background: transparent;
        padding: 0;
        margin: 40px 0; /* ajuste conforme necessário */
        box-shadow: none;
        border: none;
    }

    /* Garantir wrapper relativo para posicionar indicadores */
    .featured-carousel-wrapper {
        position: relative;
    }

    /* Indicadores fixos no canto inferior direito do wrapper */
    .featured-carousel-indicators {
        position: absolute;
        bottom: 10px;
        right: 20px;
        display: flex;
        gap: 8px;
    }
}

/* ===== Ajuste Desktop: remover headers e adicionar ícones ilustrativos ===== */
@media (min-width: 769px) {
    /* Ocultar os títulos das seções de conteúdo */
    #videos-section .section-header,
    #artigos-section .section-header,
    #pdfs-section .section-header {
        display: none;
    }

    /* Ícones ilustrativos no canto superior esquerdo das content-grids */
    #videos-section .content-grid::before,
    #artigos-section .content-grid::before,
    #pdfs-section .content-grid::before {
        position: absolute;
        top: 10px;
        left: -50px;
        font-size: 1.5rem;
        z-index: 10;
        background: rgba(255, 255, 255, 0.9);
        padding: 5px;
        border-radius: 50%;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }

    #videos-section .content-grid::before { 
        content: "\f03d";
        font-family: 'Font Awesome 6 Free';
        font-weight: 900;
    }
    #artigos-section .content-grid::before { 
        content: "\f15c";
        font-family: 'Font Awesome 6 Free';
        font-weight: 900;
    }
    #pdfs-section .content-grid::before { 
        content: "\f02d";
        font-family: 'Font Awesome 6 Free';
        font-weight: 900;
    }
}

@media (min-width: 769px) {
  .featured-title-mobile {
    display: none !important;
  }
}

/* === Truncamento visual para descrição do vídeo em destaque no carrossel === */
.featured-video-section .video-description {
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
@media (max-width: 768px) {
    .featured-video-section .video-description {
        -webkit-line-clamp: 5;
    }
}