/* Correções de responsividade aprimoradas */

/* === SEÇÃO DE COMPARTILHAMENTO SOCIAL === */

/* Container principal da seção social */
.social-share-section {
    overflow: hidden !important;
    padding: 1.25rem !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    border-radius: 0.75rem !important;
    position: relative;
}

/* === SOCIAL SHARE BUTTON === */
/* Estilo para o botão de compartilhamento único e centralizado */
.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    color: #fff;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    font-size: 1rem;
    font-weight: 600;
    min-width: 160px;
    max-width: 100%;
    letter-spacing: 0.02em;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.share-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.4);
}

.share-btn:active {
    transform: translateY(0);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

.share-btn .icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.5rem;
}

.share-btn .icon svg {
    width: 1.25rem;
    height: 1.25rem;
}

.share-btn .label {
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.3);
}

.share-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Responsividade para mobile pequeno */
@media (max-width: 480px) {
    .share-btn {
        min-width: 120px;
        height: 60px;
    }
    
    .share-btn .icon {
        height: 24px;
        width: 24px;
    }
    
    .share-btn .label {
        font-size: 0.6rem;
    }
}

/* === ESTILOS DOS BOTÕES DE COMPARTILHAMENTO === */

.social-share-section .group {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 6px 3px !important;
    border-radius: 8px !important;
    transition: all 0.3s ease !important;
    min-height: 50px !important;
    max-height: 55px !important;
    text-decoration: none !important;
    border: none !important;
    cursor: pointer !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
}

.social-share-section .group:hover {
    transform: translateY(-1px) !important;
}

.social-share-section .group svg {
    width: 16px !important;
    height: 16px !important;
    margin-bottom: 2px !important;
    flex-shrink: 0 !important;
}

.social-share-section .group span {
    font-size: 8px !important;
    font-weight: 500 !important;
    text-align: center !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100% !important;
    display: block !important;
}

/* Ajustes para tablet */
@media (min-width: 640px) {
    .social-share-section .group {
        padding: 7px 4px !important;
        min-height: 55px !important;
        max-height: 60px !important;
    }
    
    .social-share-section .group svg {
        width: 18px !important;
        height: 18px !important;
    }
    
    .social-share-section .group span {
        font-size: 9px !important;
    }
}

/* Ajustes para desktop */
@media (min-width: 768px) {
    .social-share-section .group {
        padding: 8px 5px !important;
        min-height: 58px !important;
        max-height: 63px !important;
    }
    
    .social-share-section .group svg {
        width: 19px !important;
        height: 19px !important;
        margin-bottom: 3px !important;
    }
    
    .social-share-section .group span {
        font-size: 9px !important;
    }
}

/* Ajustes para desktop grande */
@media (min-width: 1024px) {
    .social-share-section .group {
        padding: 10px 6px !important;
        min-height: 60px !important;
        max-height: 65px !important;
    }
    
    .social-share-section .group svg {
        width: 20px !important;
        height: 20px !important;
    }
    
    .social-share-section .group span {
        font-size: 10px !important;
    }
}

/* === SEÇÃO DE NAVEGAÇÃO === */

.navigation-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    gap: 10px;
}

.navigation-container .indice-btn {
    flex: 0 0 auto;
    min-width: 80px;
    text-align: center;
}

/* === ÍNDICE - GRID RESPONSIVO === */

.indice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    padding: 20px;
    max-width: 600px;
    margin: 0 auto;
}

/* === RESPONSIVIDADE MOBILE === */

@media (max-width: 768px) {
    /* Navegação em móveis */
    .navigation-container {
        flex-direction: row;
        padding: 8px 12px;
        gap: 8px;
    }
    
    .navigation-container button,
    .navigation-container .indice-btn {
        font-size: 14px;
        padding: 8px 12px;
        min-width: 70px;
    }
    
    /* Ajuste da navegação superior do post */
    .post-navigation {
        padding: 8px;
    }
    
    .post-navigation .flex {
        flex-direction: column;
        gap: 8px;
    }
    
    .post-navigation .flex-1 {
        flex: none;
        width: 100%;
        text-align: center;
    }
    
    .post-navigation .flex-shrink-0 {
        order: -1;
        width: 100%;
        text-align: center;
    }
    
    /* Índice em móveis */
    .indice-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 15px;
    }
    
    /* Centralização dos capítulos em mobile */
    #chapter-tabs {
        justify-content: center !important;
        gap: 8px;
    }
    
    .chapter-tab {
        flex: 0 0 auto;
        width: 130px !important; /* Largura fixa para todos */
        font-size: 14px !important;
        padding: 8px 16px !important;
    }
}

/* === RESPONSIVIDADE MOBILE PEQUENO === */

@media (max-width: 480px) {
    .navigation-container {
        padding: 6px 8px;
        gap: 4px;
    }
    
    .navigation-container button,
    .navigation-container .indice-btn {
        font-size: 12px;
        padding: 6px 8px;
        min-width: 50px;
    }
    
    /* Navegação do post em telas pequenas */
    .post-navigation .flex {
        gap: 6px;
    }
    
    .post-navigation .group .w-10 {
        width: 2rem !important;
        height: 2rem !important;
    }
    
    .post-navigation .group .w-5 {
        width: 1rem !important;
        height: 1rem !important;
    }
    
    .indice-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        padding: 12px;
    }
    
    /* Melhor layout para capítulos em telas muito pequenas */
    #chapter-tabs {
        gap: 6px;
    }
    
    .chapter-tab {
        width: 110px !important; /* Largura fixa para todos */
        font-size: 12px !important;
        padding: 6px 10px !important;
    }
}

/* === CORREÇÃO CRÍTICA PARA DESKTOP === */
/* Força os botões a ficarem dentro do container em desktop */
@media (min-width: 768px) {
    .social-share-section .bg-gray-800 {
        position: relative !important;
        overflow: hidden !important;
        contain: layout !important;
    }
    
    .social-share-section .social-share-grid {
        position: relative !important;
        z-index: 1 !important;
        contain: layout !important;
        transform: none !important;
    }
    
    .social-share-section .group {
        position: relative !important;
        transform: none !important;
        contain: layout style !important;
    }
    
    .social-share-section .group:hover {
        transform: translateY(-1px) !important;
        z-index: 2 !important;
    }
}

/* === REGRA DE EMERGÊNCIA - DESKTOP === */
/* Força absoluta contenção dos botões no desktop */
@media (min-width: 768px) {
    .max-w-4xl .social-share-section {
        width: 100% !important;
        max-width: 100% !important;
        overflow: hidden !important;
        clip-path: inset(0) !important;
    }
    
    .max-w-4xl .social-share-section .bg-gray-800 {
        width: 100% !important;
        max-width: 100% !important;
        overflow: hidden !important;
        position: relative !important;
        clip-path: inset(0) !important;
    }
    
    .max-w-4xl .social-share-section .social-share-grid {
        width: 100% !important;
        max-width: 360px !important;
        overflow: hidden !important;
        position: relative !important;
        margin: 0 auto !important;
        clip-path: inset(0) !important;
    }
    
    .max-w-4xl .social-share-section button {
        position: relative !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow: hidden !important;
        clip-path: inset(0) !important;
    }
}

/* === NEUTRALIZAÇÃO DE CLASSES TAILWIND PROBLEMÁTICAS === */
/* Remove transformações que podem causar overflow */
.social-share-section .group.transform {
    transform: none !important;
}

.social-share-section .group.transform:hover {
    transform: translateY(-1px) !important;
    scale: none !important;
}

/* Remove hover:scale que pode causar overflow */
.social-share-section .hover\:scale-105:hover {
    transform: translateY(-1px) !important;
    scale: 1 !important;
}

/* Força dimensões específicas para todos os botões */
.social-share-section button {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}
