@import url('animaisOutros.css');
@import url('animaisFicha.css');
@import url('animaisImpressao.css');

.btn-detalhes {
    background: transparent;
    color: #007bff;
    border: none;
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    margin-left: 10px;
}

.btn-detalhes:hover {
    background: #0056b3;
}

.detalhes-ocultos {
    margin-top: 8px;
    padding: 10px;
    background: transparent;
    border-radius: 4px;
    border-left: 3px solid #007bff;
    display: block;
    width: 100%;
}

.detalhes-ocultos span {
    display: inline-block;
    margin-right: 10px;
}

.btn-acao.ficha {
    font-size: 24px;
    padding: 10px 14px;
    border-radius: 10px;
    margin: 0 4px;
}


.btn-acao.ficha i, .btn-acao.editar i, .btn-acao.excluir i {
    font-size: 30px;
}

td .btn-acao.editar i, td .btn-acao.excluir i {
    font-size: 18px;
}

.btn-acao.ficha:hover, .btn-acao.ficha i:hover {
    color: black;
}

.emoji{
    font-size: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}



/* Responsivo para botões de compartilhamento */
@media (max-width: 768px) {    
    .btn-compartilhar-pdf,
    .btn-compartilhar-whatsapp,
    .btn-compartilhar-email {
        font-size: 11px;
        padding: 6px 14px;
    }
    
    .ficha-actions {
        gap: 5px;
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .btn-compartilhar-pdf,
    .btn-compartilhar-whatsapp,
    .btn-compartilhar-email {
        font-size: 10px;
        padding: 5px 10px;
    }
}

/*
.tag-bovino { background: #8d6e63; }
.tag-caprino { background: #6d4c41; }
.tag-ovino { background: #a1887f; }
.tag-suino { background: #e91e63; }
.tag-avicola { background: #fdd835; }
.tag-equino { background: #795548; }
.tag-asininos { background: #9e9e9e; }
.tag-outros { background: #78909c; }*/


/* ============================================ */
/* ABAS / GUIAS DO MODAL - ESTILO ADMIN */
/* ============================================ */
.tabs-container {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #e5ddd4;
    padding-bottom: 0;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 0.7rem 1.8rem;
    border: none;
    background: transparent;
    color: #6f655a;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
    border-radius: 8px 8px 0 0;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.tab-btn i {
    font-size: 1rem;
    color: #8f8478;
    transition: color 0.2s;
}

.tab-btn:hover:not(:disabled) {
    color: #2d2a24;
    background: #f0ece6;
}

.tab-btn:hover:not(:disabled) i {
    color: #2d2a24;
}

.tab-btn.active {
    color: #2d2a24;
    border-bottom-color: #7d8f6e;
    background: #faf8f5;
}

.tab-btn.active i {
    color: #7d8f6e;
}

.tab-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.tab-btn:disabled i {
    opacity: 0.4;
}

.tab-content {
    display: none;
    animation: fadeInTab 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeInTab {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsivo */
@media (max-width: 768px) {
    .tabs-container {
        gap: 0.3rem;
        border-bottom-width: 1px;
    }
    
    .tab-btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.75rem;
        gap: 0.3rem;
        flex: 1;
        justify-content: center;
        min-width: 0;
        border-bottom-width: 2px;
    }
    
    .tab-btn i {
        font-size: 0.85rem;
    }
    
    .tab-btn .tab-label {
        display: none;
    }
    
    .tab-btn .tab-icon-only {
        display: inline;
    }
}

@media (max-width: 480px) {
    .tab-btn {
        padding: 0.4rem 0.5rem;
        font-size: 0.7rem;
        gap: 0.2rem;
    }
    
    .tab-btn i {
        font-size: 0.75rem;
    }
}


/* ===== ÁRVORE GENEALÓGICA - HORIZONTAL ===== */
.arvore-horizontal {
    display: flex;
    align-items: stretch;
    justify-content: center;
    padding: 20px 10px;
    background: #faf8f6;
    border-radius: 12px;
    overflow-x: auto;
    font-family: 'Segoe UI', Arial, sans-serif;
    gap: 0;
    min-height: 420px;
}

/* Colunas */
.arvore-coluna {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    flex: 0 0 auto;
    min-width: 100px;
}

/* Título da geração */
.arvore-titulo-geracao {
    font-size: 11px;
    font-weight: 700;
    color: #8a7a6a;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    background: #ede7e0;
    padding: 2px 14px;
    border-radius: 12px;
    white-space: nowrap;
    text-align: center;
}

/* Ramos (cada par de pais) */
.arvore-ramo {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 12px;
    background: white;
    border-radius: 10px;
    border: 2px solid #e0d6cc;
    min-width: 110px;
    position: relative;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    transition: all 0.2s ease;
    margin: 3px 0;
}

.arvore-ramo:hover {
    border-color: #b8a89a;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.arvore-ramo.principal {
    border-color: #6b9f6b;
    background: #f0f7f0;
    min-width: 130px;
}

.arvore-ramo.principal:hover {
    border-color: #4caf50;
}

/* Cada conjuge (pai ou mãe) */
.arvore-conjuge {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    justify-content: center;
    padding: 3px 0;
}

.arvore-conjuge + .arvore-conjuge {
    border-top: 1px dashed #e8e0d8;
    padding-top: 5px;
    margin-top: 3px;
}

/* Nome */
.arvore-nome {
    font-size: 13px;
    font-weight: 500;
    color: #3e2e1e;
    min-width: 70px;
    text-align: center;
    padding: 2px 8px;
    border-radius: 4px;
    background: #f5f2ef;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.3px;
    transition: all 0.3s ease;
}

.arvore-nome[data-preenchido="true"] {
    background: #e3f0fd;
    color: #0d47a1;
    font-weight: 600;
}

/* Sexo */
.arvore-sexo {
    font-size: 15px;
    font-weight: 700;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

.arvore-sexo.sexo-masc {
    color: #1a73e8;
}

.arvore-sexo.sexo-fem {
    color: #e91e63;
}

/* Label abaixo do ramo */
.arvore-label {
    font-size: 9px;
    color: #a09080;
    margin-top: 5px;
    text-align: center;
    border-top: 1px solid #f0ebe5;
    padding-top: 5px;
    width: 100%;
    letter-spacing: 0.3px;
}

/* ===== CONEXÕES ENTRE COLUNAS ===== */
.arvore-conexao {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 2px;
    flex: 0 0 24px;
    position: relative;
}

/* Linha horizontal (liga colunas) */
.arvore-linha-horizontal {
    width: 20px;
    height: 2px;
    background: #cbbfb3;
    border-radius: 2px;
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
}

/* Linha vertical para 2 ramos (Pais e Avós) */
.arvore-linha-vertical {
    width: 2px;
    height: 60px;
    background: #cbbfb3;
    border-radius: 2px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Linha vertical para 4 ramos (Bisavós) */
.arvore-linha-vertical-4 {
    width: 2px;
    height: 120px;
    background: #cbbfb3;
    border-radius: 2px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Linha vertical para 8 ramos (futuro) */
.arvore-linha-vertical-8 {
    width: 2px;
    height: 280px;
    background: #cbbfb3;
    border-radius: 2px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Conexão em T (para unir os dois ramos) */
.arvore-conexao::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 50%;
    background: #cbbfb3;
    transform: translateX(-50%);
}

.arvore-conexao::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 2px;
    height: 50%;
    background: #cbbfb3;
    transform: translateX(-50%);
}

/* ===== RESPONSIVO ===== */
@media (max-width: 1024px) {
    .arvore-horizontal {
        padding: 15px 8px;
        gap: 0;
        min-height: 380px;
    }
    
    .arvore-coluna {
        min-width: 80px;
    }
    
    .arvore-ramo {
        min-width: 80px;
        padding: 6px 8px;
        margin: 2px 0;
    }
    
    .arvore-ramo.principal {
        min-width: 100px;
    }
    
    .arvore-nome {
        font-size: 11px;
        min-width: 50px;
        padding: 1px 4px;
    }
    
    .arvore-sexo {
        font-size: 13px;
        width: 18px;
    }
    
    .arvore-titulo-geracao {
        font-size: 9px;
        padding: 1px 10px;
        margin-bottom: 8px;
    }
    
    .arvore-label {
        font-size: 8px;
    }
    
    .arvore-conexao {
        flex: 0 0 16px;
    }
    
    .arvore-linha-horizontal {
        width: 14px;
    }
    
    .arvore-linha-vertical {
        height: 45px;
    }
    
    .arvore-linha-vertical-4 {
        height: 90px;
    }
    
    .arvore-linha-vertical-8 {
        height: 210px;
    }
}

@media (max-width: 768px) {
    .arvore-horizontal {
        padding: 12px 4px;
        min-height: 320px;
        flex-wrap: nowrap;
    }
    
    .arvore-coluna {
        min-width: 70px;
        padding: 0 2px;
    }
    
    .arvore-ramo {
        min-width: 65px;
        padding: 4px 6px;
        border-width: 1.5px;
        margin: 2px 0;
    }
    
    .arvore-ramo.principal {
        min-width: 80px;
    }
    
    .arvore-nome {
        font-size: 9px;
        min-width: 35px;
        padding: 1px 3px;
    }
    
    .arvore-sexo {
        font-size: 11px;
        width: 15px;
    }
    
    .arvore-conjuge {
        gap: 3px;
        padding: 2px 0;
    }
    
    .arvore-conjuge + .arvore-conjuge {
        padding-top: 3px;
        margin-top: 2px;
    }
    
    .arvore-titulo-geracao {
        font-size: 8px;
        padding: 1px 8px;
        margin-bottom: 6px;
        letter-spacing: 0.5px;
    }
    
    .arvore-label {
        font-size: 7px;
        padding-top: 3px;
        margin-top: 3px;
    }
    
    .arvore-conexao {
        flex: 0 0 12px;
    }
    
    .arvore-linha-horizontal {
        width: 10px;
    }
    
    .arvore-linha-vertical {
        height: 35px;
    }
    
    .arvore-linha-vertical-4 {
        height: 70px;
    }
    
    .arvore-linha-vertical-8 {
        height: 160px;
    }
}

@media (max-width: 480px) {
    .arvore-horizontal {
        padding: 10px 2px;
        min-height: 280px;
        gap: 0;
        justify-content: flex-start;
    }
    
    .arvore-coluna {
        min-width: 55px;
        padding: 0 1px;
    }
    
    .arvore-ramo {
        min-width: 50px;
        padding: 3px 4px;
        border-width: 1px;
        border-radius: 6px;
        margin: 1px 0;
    }
    
    .arvore-ramo.principal {
        min-width: 65px;
    }
    
    .arvore-nome {
        font-size: 7px;
        min-width: 25px;
        padding: 1px 2px;
        letter-spacing: 0;
    }
    
    .arvore-sexo {
        font-size: 9px;
        width: 12px;
    }
    
    .arvore-conjuge {
        gap: 2px;
        padding: 1px 0;
    }
    
    .arvore-conjuge + .arvore-conjuge {
        padding-top: 2px;
        margin-top: 1px;
    }
    
    .arvore-titulo-geracao {
        font-size: 7px;
        padding: 1px 6px;
        margin-bottom: 4px;
        letter-spacing: 0.3px;
    }
    
    .arvore-label {
        font-size: 6px;
        padding-top: 2px;
        margin-top: 2px;
    }
    
    .arvore-conexao {
        flex: 0 0 8px;
    }
    
    .arvore-linha-horizontal {
        width: 6px;
    }
    
    .arvore-linha-vertical {
        height: 25px;
    }
    
    .arvore-linha-vertical-4 {
        height: 50px;
    }
    
    .arvore-linha-vertical-8 {
        height: 110px;
    }
}