/* ========================================
   PÁGINA INTERNA DOS EDITAIS
   ======================================== */

/* Container Principal */
.bc-single-concurso {
    max-width: 1400px;
    margin: 40px auto;
    padding: 0 20px;
}

/* Cabeçalho */
.bc-single-header {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.bc-single-title {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 10px 0;
    line-height: 1.3;
}

.bc-subtitle {
    font-size: 1.1rem;
    color: #7f8c8d;
    font-weight: 400;
    margin: 0;
}

.bc-single-header::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, #1976D2, #64B5F6);
    margin-top: 15px;
    border-radius: 2px;
}

/* Tabs de Navegação */
.bc-tabs-wrapper {
    background: #fff;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 0;
    overflow: hidden;
}

.bc-tabs {
    display: flex;
    border-bottom: 2px solid #e0e0e0;
    margin: 0;
    padding: 0;
}

.bc-tab {
    flex: 1;
    padding: 15px 20px;
    background: #f5f5f5;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: #7f8c8d;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.bc-tab:hover {
    background: #ebebeb;
    color: #2c3e50;
}

.bc-tab.active {
    background: #fff;
    color: #1976D2;
    border-bottom-color: #1976D2;
}

.bc-tab:focus {
    outline: 2px solid #1976D2;
    outline-offset: -2px;
}

.bc-tab-icon {
    font-size: 1.2rem;
}

/* Grid Principal: Conteúdo + Sidebar */
.bc-single-container {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 20px;
    align-items: start;
    margin-top: 20px;
}

/* Conteúdo Principal */
.bc-single-content {
    background: #fff;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    min-height: 500px;
}

.bc-tab-content {
    display: none;
}

.bc-tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bc-content-wrapper {
    padding: 30px;
}

/* Estilização do conteúdo WYSIWYG */
.bc-content-wrapper h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c3e50;
    margin-top: 25px;
    margin-bottom: 15px;
    border-left: 4px solid #1976D2;
    padding-left: 15px;
}

.bc-content-wrapper h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #34495e;
    margin-top: 20px;
    margin-bottom: 10px;
}

.bc-content-wrapper p {
    line-height: 1.7;
    color: #555;
    margin-bottom: 15px;
}

.bc-content-wrapper ul,
.bc-content-wrapper ol {
    margin-left: 20px;
    margin-bottom: 15px;
    line-height: 1.7;
}

.bc-content-wrapper li {
    margin-bottom: 8px;
    color: #555;
}

.bc-content-wrapper strong {
    font-weight: 600;
    color: #2c3e50;
}

/* Visualizador de PDF */
.bc-edital-wrapper {
    padding: 20px;
}

.bc-pdf-viewer {
    background: #f5f5f5;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.bc-pdf-viewer iframe {
    display: block;
    width: 100%;
    min-height: 800px;
    border: none;
}

.bc-no-edital {
    text-align: center;
    padding: 60px 20px;
    color: #7f8c8d;
}

.bc-no-edital p {
    font-size: 1.1rem;
    margin-bottom: 15px;
}

/* Sidebar com Box Resumo */
.bc-single-sidebar {
    position: sticky !important;
    top: 20px !important;
    max-width: 350px !important;
    width: 100% !important;
}

.bc-sidebar-box {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 20px;
    border-top: 4px solid #1976D2;
}

/* Items de Informação */
.bc-info-item {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.bc-info-item:last-of-type {
    border-bottom: none;
    margin-bottom: 20px;
    padding-bottom: 0;
}

.bc-info-item label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #7f8c8d;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.bc-info-item .bc-value {
    font-size: 0.95rem;
    color: #2c3e50;
    font-weight: 500;
}

/* Badge de Situação */
.bc-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bc-badge.situacao-inscricoes-abertas {
    background-color: #1976D2;
}

.bc-badge.situacao-previsto {
    background-color: #F9A825;
    color: #1a1a1a;
}

.bc-badge.situacao-autorizado {
    background-color: #6A1B9A;
}

.bc-badge.situacao-edital-publicado {
    background-color: #F57C00;
}

.bc-badge.situacao-em-andamento {
    background-color: #2E7D32;
}

.bc-badge.situacao-encerrado {
    background-color: #D32F2F;
}

/* Salário em Destaque */
.bc-salario {
    font-size: 1.2rem;
    font-weight: 700;
    color: #2E7D32;
}

/* Botões da Sidebar */
.bc-sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 15px;
}

.bc-btn {
    display: inline-block;
    padding: 10px 16px;
    border-radius: 6px;
    text-align: center;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.bc-btn-block {
    display: block;
    width: 100%;
}

.bc-btn-primary {
    background: #1976D2;
    color: #fff;
}

.bc-btn-primary:hover {
    background: #1565C0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.3);
    color: #fff;
}

.bc-btn-secondary {
    background: #fff;
    color: #1976D2;
    border: 2px solid #1976D2;
}

.bc-btn-secondary:hover {
    background: #1976D2;
    color: #fff;
}

.bc-btn-tertiary {
    background: #f5f5f5;
    color: #555;
    border: 2px solid #ddd;
}

.bc-btn-tertiary:hover {
    background: #e0e0e0;
    border-color: #bbb;
    color: #333;
}

/* Sobrescrever estilos do Astra */
.bc-single-concurso a.bc-btn {
    color: inherit;
}

.bc-single-concurso a.bc-btn:hover {
    color: inherit;
}

/* Loading do PDF */
.bc-pdf-loading {
    text-align: center;
    padding: 60px;
    color: #7f8c8d;
    font-size: 1.1rem;
    background: #f5f5f5;
    border-radius: 4px;
}

.bc-pdf-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #1976D2;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
    vertical-align: middle;
}

/* Responsividade Tablet */
@media (max-width: 1200px) {
    .bc-single-container {
        grid-template-columns: 1fr 300px;
    }
}

/* =====================================================
   RESPONSIVIDADE MOBILE - CORRIGIDO
   ===================================================== */

@media (max-width: 968px) {
    /* Resetar Grid para Layout Vertical */
    .bc-single-container {
        display: flex !important; /* Mudança de grid para flex */
        flex-direction: column !important;
        gap: 20px !important;
    }
    
    /* CORREÇÃO PRINCIPAL: Remover Sticky da Sidebar */
    .bc-single-sidebar {
        position: static !important; /* Era sticky, agora static */
        position: relative !important; /* Fallback para navegadores antigos */
        top: auto !important;
        order: -1 !important; /* Mantém sidebar no topo */
        max-width: 100% !important;
        width: 100% !important;
        z-index: 1 !important; /* Controle de empilhamento */
    }
    
    /* Garantir que Conteúdo Principal fique abaixo */
    .bc-single-content {
        position: relative !important;
        z-index: 2 !important; /* Prioridade visual maior */
        width: 100% !important;
        order: 1 !important;
    }
    
    /* Tabs Responsivas */
    .bc-tabs {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    .bc-tab {
        padding: 12px 10px !important;
        font-size: 0.9rem !important;
        white-space: nowrap !important;
        min-width: 100px !important; /* Evita quebra de texto */
    }
    
    /* Conteúdo Interno */
    .bc-content-wrapper {
        padding: 20px 15px !important;
    }
    
    /* PDF Viewer */
    .bc-pdf-viewer iframe {
        min-height: 600px !important;
        width: 100% !important;
    }
    
    /* Header */
    .bc-single-concurso {
        margin: 20px auto !important;
        padding: 0 10px !important;
    }
    
    .bc-single-title {
        font-size: 1.5rem !important;
        line-height: 1.2 !important;
    }
    
    /* Box da Sidebar - Evitar Overflow */
    .bc-sidebar-box {
        overflow: visible !important; /* Era hidden em algum lugar */
        padding: 20px 15px !important;
        margin-bottom: 20px !important;
    }
}

/* Extra Small Devices */
@media (max-width: 480px) {
    .bc-single-concurso {
        padding: 5px !important;
        margin: 10px auto !important;
    }
    
    .bc-single-header {
        padding: 15px !important;
    }
    
    .bc-single-title {
        font-size: 1.3rem !important;
    }
    
    .bc-subtitle {
        font-size: 0.95rem !important;
    }
    
    .bc-tab-icon {
        display: none !important;
    }
    
    .bc-sidebar-box {
        padding: 15px !important;
    }
    
    .bc-pdf-viewer iframe {
        min-height: 500px !important;
    }
    
    .bc-content-wrapper h2 {
        font-size: 1.2rem !important;
    }
    
    /* Botões Menores */
    .bc-btn {
        padding: 10px 12px !important;
        font-size: 0.85rem !important;
    }
}

/* =====================================================
   ANTI-OVERLAP - CAMADA DE SEGURANÇA
   ===================================================== */

/* Forçar elementos principais a respeitarem fluxo normal */
.bc-single-container > * {
    position: relative !important;
}

/* Garantir que sidebar não seja absolute/fixed em mobile */
@media (max-width: 968px) {
    .bc-single-sidebar,
    .bc-sidebar-box,
    .bc-info-item {
        position: static !important;
        float: none !important;
        clear: both !important;
    }
    
    /* Resetar transformações que possam causar overlap */
    .bc-single-container,
    .bc-single-content,
    .bc-single-sidebar {
        transform: none !important;
        will-change: auto !important;
    }
}

/* Debug Helper - Remova após confirmar correção */
@media (max-width: 968px) {
    .bc-single-sidebar {
        /* border: 2px solid red !important; */ /* Descomente para visualizar */
    }
    
    .bc-single-content {
        /* border: 2px solid blue !important; */ /* Descomente para visualizar */
    }
}