/**
 * Estilos customizados para página de Estrutura Organizacional
 */

/* Container principal do organograma */
.estrutura-container {
    background: #fff;
    border-radius: 3px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin: 20px 0;
    overflow: hidden;
    position: relative;
}

.estrutura-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: #17a2b8;
}

/* Controles do organograma */
.estrutura-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 3px;
    flex-wrap: wrap;
    gap: 10px;
}

.estrutura-controls h3 {
    margin: 0;
    color: #333;
    font-size: 1.3em;
    flex: 1;
    min-width: 200px;
}

.estrutura-controls-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.estrutura-controls .btn {
    padding: 8px 16px;
    border-radius: 3px;
    font-size: 0.9em;
    border: 1px solid #dee2e6;
    background: #fff;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s;
}

.estrutura-controls .btn:hover {
    background: #17a2b8;
    color: #fff;
    border-color: #17a2b8;
}

.estrutura-controls .btn.active {
    background: #17a2b8;
    color: #fff;
    border-color: #17a2b8;
}

/* Container do chart com scroll */
.estrutura-chart-wrapper {
    position: relative;
    overflow: auto;
    max-height: 80vh;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 3px;
    border: 1px solid #dee2e6;
    min-height: 400px;
}

.estrutura-chart-wrapper::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

.estrutura-chart-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.estrutura-chart-wrapper::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.estrutura-chart-wrapper::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Organograma melhorado */
#chart-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
    min-width: 100%;
    min-height: 100%;
}

.orgchart {
    background: transparent !important;
    padding: 0 !important;
}

/* Nós do organograma - estilização moderna */
.orgchart .node {
    border: 2px solid #dee2e6 !important;
    border-radius: 3px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
    transition: all 0.3s ease !important;
    background: #fff !important;
    padding: 0 !important;
    overflow: hidden;
}

.orgchart .node:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(0,123,255,0.3) !important;
    border-color: #17a2b8 !important;
    z-index: 10 !important;
}

.orgchart .node.focused {
    border-color: #17a2b8 !important;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.2) !important;
}

/* Título dos nós - design moderno */
.orgchart .node .title {
    background: #17a2b8 !important;
    color: #fff !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    padding: 10px 15px !important;
    border-radius: 3px 3px 0 0 !important;
    width: auto !important;
    min-width: 150px !important;
    max-width: 250px !important;
    height: auto !important;
    min-height: 40px !important;
    line-height: 1.4 !important;
    white-space: normal !important;
    word-break: break-word !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
}

.orgchart .node .content {
    padding: 8px 12px !important;
    background: #f8f9fa !important;
    border: none !important;
    border-top: 1px solid #dee2e6 !important;
    color: #495057 !important;
    font-size: 11px !important;
    width: auto !important;
    min-width: 150px !important;
    max-width: 250px !important;
    height: auto !important;
    min-height: 30px !important;
    line-height: 1.4 !important;
    white-space: normal !important;
    word-break: break-word !important;
    display: block !important;
    border-radius: 0 0 3px 3px !important;
}

/* Linhas de conexão - mais visíveis */
.orgchart .hierarchy::before {
    border-top: 3px solid #17a2b8 !important;
    opacity: 0.6;
}

.orgchart > ul > li > ul li > .node:not(.outsider)::before {
    background-color: #17a2b8 !important;
    width: 3px !important;
    opacity: 0.6;
}

/* Estado vazio */
.estrutura-empty {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.estrutura-empty i {
    font-size: 64px;
    color: #dee2e6;
    margin-bottom: 20px;
    display: block;
}

.estrutura-empty h3 {
    color: #495057;
    margin-bottom: 10px;
}

.estrutura-empty p {
    color: #6c757d;
    font-size: 1.1em;
}

/* Loading state */
.estrutura-loading {
    text-align: center;
    padding: 60px 20px;
}

.estrutura-loading .spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #17a2b8;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.estrutura-loading p {
    color: #6c757d;
    font-size: 1.1em;
}

/* Responsividade */
@media (max-width: 768px) {
    .estrutura-container {
        padding: 15px;
        margin: 10px 0;
    }
    
    .estrutura-controls {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .estrutura-controls h3 {
        margin-bottom: 10px;
        font-size: 1.1em;
    }
    
    .estrutura-controls-buttons {
        width: 100%;
        justify-content: center;
    }
    
    .estrutura-chart-wrapper {
        padding: 10px;
        max-height: 60vh;
    }
    
    .orgchart .node .title,
    .orgchart .node .content {
        min-width: 120px !important;
        max-width: 180px !important;
        font-size: 12px !important;
    }
}

/* Animações suaves */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.estrutura-container {
    animation: fadeInUp 0.5s ease-out;
}

/* Info box */
.estrutura-info {
    background: #e7f3ff;
    border-left: 4px solid #17a2b8;
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.estrutura-info i {
    color: #17a2b8;
    font-size: 1.2em;
}

.estrutura-info p {
    margin: 0;
    color: #17a2b8;
    font-size: 0.95em;
}

/* Texto Rico Descritivo */
.estrutura-texto-rico-exibicao {
    background: #fff;
    padding: 30px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-left: 4px solid #17a2b8;
}

.estrutura-texto-rico-exibicao .text-justify {
    line-height: 1.8;
    font-size: 1.05em;
    color: #333;
}

.estrutura-texto-rico-exibicao .text-justify p {
    margin-bottom: 15px;
}

.estrutura-texto-rico-exibicao .text-justify h1,
.estrutura-texto-rico-exibicao .text-justify h2,
.estrutura-texto-rico-exibicao .text-justify h3,
.estrutura-texto-rico-exibicao .text-justify h4,
.estrutura-texto-rico-exibicao .text-justify h5,
.estrutura-texto-rico-exibicao .text-justify h6 {
    color: #17a2b8;
    margin-top: 20px;
    margin-bottom: 10px;
}

.estrutura-texto-rico-exibicao .text-justify ul,
.estrutura-texto-rico-exibicao .text-justify ol {
    margin-left: 20px;
    margin-bottom: 15px;
}

.estrutura-texto-rico-exibicao .text-justify li {
    margin-bottom: 8px;
}

