/**
 * Estilos para a página de administração do Inov.AM Consortium Manager.
 */

/* Container principal da nossa página */
.icm-importer-wrap {
    max-width: 800px;
}

/* Estilo para a área de feedback */
#importer-feedback {
    margin-top: 20px;
    padding: 15px;
    border-left-width: 4px;
    border-left-style: solid;
    display: none; /* Começa escondido, será mostrado via JS */
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
}

/* Estilos para mensagens de sucesso */
#importer-feedback.success {
    background-color: #f7fff8;
    border-left-color: #4CAF50; /* Verde */
}

/* Estilos para mensagens de erro */
#importer-feedback.error {
    background-color: #fff7f7;
    border-left-color: #F44336; /* Vermelho */
}

/* Estilos para mensagens de progresso/aviso */
#importer-feedback.processing {
    background-color: #fffaf2;
    border-left-color: #FF9800; /* Laranja */
}

#importer-feedback p {
    margin: 0 0 10px;
    padding: 0;
    font-size: 14px;
}

#importer-feedback p:last-child {
    margin-bottom: 0;
}

/* Animação do spinner do WordPress */
#icm-importer-form .spinner {
    float: none;
    vertical-align: middle;
    margin-left: 10px;
    visibility: hidden; /* Começa escondido */
}

#icm-importer-form.is-importing .spinner {
    visibility: visible; /* Fica visível durante a importação */
}

/* Desativar o botão durante a importação para evitar cliques duplos */
#icm-importer-form.is-importing #submit {
    cursor: not-allowed;
    opacity: 0.7;
}
/* Estilos para os grupos de taxonomias e meta-dados */
.taxonomy-group {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.taxonomy-group strong {
    display: block;
    margin-bottom: 10px;
    font-size: 1.1em;
    color: #333;
}

.tags-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 8px; /* Espaçamento entre as tags */
}

/* Estilo base para todas as tags */
.tag-link {
    display: inline-block;
    padding: 6px 12px;
    font-size: 14px;
    line-height: 1;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s ease-in-out;
    background-color: #f0f0f0;
    color: #555;
    border: 1px solid #ddd;
}

/* Efeito ao passar o rato por cima */
.tag-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Cor específica para tags de tecnologia (taxonomia) */
.company-technologies .tag-link {
    background-color: #e3f2fd; /* Azul claro */
    color: #0d47a1; /* Azul escuro */
    border-color: #bbdefb;
}
.company-technologies .tag-link:hover {
    background-color: #bbdefb;
}

/* Cor específica para tags de meta-dados (PPS, Tipologia) */
.tag-meta {
    background-color: #e8f5e9; /* Verde claro */
    color: #1b5e20; /* Verde escuro */
    border-color: #c8e6c9;
}
.tag-meta:hover {
    background-color: #c8e6c9;
}.taxonomy-group {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.taxonomy-group strong {
    display: block;
    margin-bottom: 10px;
    font-size: 1.1em;
    color: #333;
}

.tags-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 8px; /* Espaçamento entre as tags */
}

/* Estilo base para todas as tags */
.tag-link {
    display: inline-block;
    padding: 6px 12px;
    font-size: 14px;
    line-height: 1;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s ease-in-out;
    background-color: #f0f0f0;
    color: #555;
    border: 1px solid #ddd;
}

/* Efeito ao passar o rato por cima */
.tag-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Cor específica para tags de tecnologia (taxonomia) */
.company-technologies .tag-link {
    background-color: #e3f2fd; /* Azul claro */
    color: #0d47a1; /* Azul escuro */
    border-color: #bbdefb;
}
.company-technologies .tag-link:hover {
    background-color: #bbdefb;
}

/* Cor específica para tags de meta-dados (PPS, Tipologia) */
.tag-meta {
    background-color: #e8f5e9; /* Verde claro */
    color: #1b5e20; /* Verde escuro */
    border-color: #c8e6c9;
}
.tag-meta:hover {
    background-color: #c8e6c9;
}

/* Container principal dos detalhes */
.company-taxonomies {
    margin-top: 30px;
}

/* Grupo de cada tipo de tag (Tecnologias, WP, PPS, etc.) */
.taxonomy-group {
    margin-bottom: 25px;
}

.taxonomy-group strong {
    display: block;
    margin-bottom: 12px;
    font-size: 1.2em;
    color: #2c3e50;
    padding-bottom: 5px;
    border-bottom: 2px solid #ecf0f1;
}

/* Wrapper que contém as tags para permitir quebra de linha */
.tags-wrapper {
    display: flex;
    flex-wrap: wrap;
    align-items: center; /* Alinha as tags e os separadores verticalmente */
    gap: 0 10px; /* Remove o espaçamento vertical, mantém o horizontal */
}

/* --- INÍCIO DA CORREÇÃO: LÓGICA DOS SEPARADORES --- */

/* Estilo para todos os itens (links ou não) dentro do wrapper */
.tags-wrapper > * {
    margin-bottom: 8px; /* Adiciona um espaçamento inferior para quebra de linha */
}

/* Adiciona um separador (vírgula) a seguir a cada item, exceto o último */
.tags-wrapper > *:not(:last-child)::after {
    content: ",";
    margin-left: 2px; /* Pequeno espaço entre a tag e a vírgula */
    color: #7f8c8d; /* Cor discreta para a vírgula */
}
/* --- FIM DA CORREÇÃO --- */


/* Estilo base para tags que SÃO links */
.tag-link {
    display: inline-block;
    padding: 8px 15px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.2s ease-in-out;
    border: 1px solid transparent;
}

.tag-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Estilo base para tags que NÃO SÃO links (como Tipologia) */
.tag-like {
    display: inline-block;
    padding: 8px 15px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    border-radius: 5px;
}

/* -- Cores Específicas por Tipo -- */

/* Tecnologias (Azul) */
.tag-technology {
    background-color: #eaf5ff;
    color: #2980b9;
    border-color: #d4eaf7;
}
.tag-technology:hover {
    background-color: #2980b9;
    color: #fff;
}

/* Work Packages (WP) (Verde) */
.tag-wp {
    background-color: #e8f6f3;
    color: #16a085;
    border-color: #d1f2eb;
}
.tag-wp.tag-link:hover {
    background-color: #16a085;
    color: #fff;
}

/* PPS (Roxo) */
.tag-pps {
    background-color: #f4ecf7;
    color: #8e44ad;
    border-color: #e8daef;
}
.tag-pps.tag-link:hover {
    background-color: #8e44ad;
    color: #fff;
}

/* Tipologia (Cinzento) */
.tag-typology {
    background-color: #f2f4f4;
    color: #7f8c8d;
    border: 1px solid #e5e8e8;
}

.tag-sector {
    background-color: #fff5e6;
    color: #f39c12;
    border-color: #fee9c5;
}
.tag-sector:hover {
    background-color: #f39c12;
    color: #fff;
}

.icm-importer-wrap { max-width: 800px; }
#importer-feedback { margin-top: 20px; padding: 15px; border-left-width: 4px; border-left-style: solid; display: none; box-shadow: 0 1px 1px rgba(0,0,0,.04); }
#importer-feedback.success { background-color: #f7fff8; border-left-color: #4CAF50; }
#importer-feedback.error { background-color: #fff7f7; border-left-color: #F44336; }
#importer-feedback.processing { background-color: #fffaf2; border-left-color: #FF9800; }
#importer-feedback p { margin: 0 0 10px; padding: 0; font-size: 14px; }
#importer-feedback p:last-child { margin-bottom: 0; }
#icm-importer-form .spinner { float: none; vertical-align: middle; margin-left: 10px; visibility: hidden; }
#icm-importer-form.is-importing .spinner { visibility: visible; }
#icm-importer-form.is-importing #submit { cursor: not-allowed; opacity: 0.7; }

/* --- Template single-company.php --- */

.company-taxonomies { margin-top: 30px; }
.taxonomy-group { margin-bottom: 25px; }
.taxonomy-group strong { display: block; margin-bottom: 12px; font-size: 1.2em; color: #2c3e50; padding-bottom: 5px; border-bottom: 2px solid #ecf0f1; }
.tags-wrapper { display: flex; flex-wrap: wrap; align-items: center; gap: 0 10px; }
.tags-wrapper > * { margin-bottom: 8px; }
.tags-wrapper > *:not(:last-child)::after { content: ","; margin-left: 2px; color: #7f8c8d; }

/* Estilo para tags que SÃO links */
.tag-link { display: inline-block; padding: 8px 15px; font-size: 14px; font-weight: 500; line-height: 1; text-decoration: none; border-radius: 5px; transition: all 0.2s ease-in-out; border: 1px solid transparent; }
.tag-link:hover { transform: translateY(-2px); box-shadow: 0 4px 8px rgba(0,0,0,0.1); }

/* Estilo para tags que NÃO SÃO links */
.tag-like { display: inline-block; padding: 8px 15px; font-size: 14px; font-weight: 500; line-height: 1; border-radius: 5px; }

/* Cores por Tipo */
.tag-sector { background-color: #fff5e6; color: #f39c12; border-color: #fee9c5; }
.tag-sector:hover { background-color: #f39c12; color: #fff; }
.tag-technology { background-color: #eaf5ff; color: #2980b9; border-color: #d4eaf7; }
.tag-technology:hover { background-color: #2980b9; color: #fff; }
.tag-wp { background-color: #e8f6f3; color: #16a085; border-color: #d1f2eb; }
.tag-wp.tag-link:hover { background-color: #16a085; color: #fff; }
.tag-pps { background-color: #f4ecf7; color: #8e44ad; border-color: #e8daef; }
.tag-pps.tag-link:hover { background-color: #8e44ad; color: #fff; }
.tag-typology { background-color: #f2f4f4; color: #7f8c8d; border: 1px solid #e5e8e8; }

/**
 * Estilos para a página de administração e para o template single-company.
 */

/* --- Página de Administração --- */
.icm-importer-wrap { max-width: 800px; }
#importer-feedback { margin-top: 20px; padding: 15px; border-left-width: 4px; border-left-style: solid; display: none; box-shadow: 0 1px 1px rgba(0,0,0,.04); }
#importer-feedback.success { background-color: #f7fff8; border-left-color: #4CAF50; }
#importer-feedback.error { background-color: #fff7f7; border-left-color: #F44336; }
#importer-feedback.processing { background-color: #fffaf2; border-left-color: #FF9800; }
#importer-feedback p { margin: 0 0 10px; padding: 0; font-size: 14px; }
#importer-feedback p:last-child { margin-bottom: 0; }
#icm-importer-form .spinner { float: none; vertical-align: middle; margin-left: 10px; visibility: hidden; }
#icm-importer-form.is-importing .spinner { visibility: visible; }
#icm-importer-form.is-importing #submit-import { cursor: not-allowed; opacity: 0.7; }

/* --- Template single-company.php --- */
.icm-company-profile { max-width: 960px; margin: 2em auto; padding: 2em; background-color: #fff; border: 1px solid #e0e0e0; border-radius: 8px; box-shadow: 0 5px 15px rgba(0,0,0,0.05); }
.icm-company-profile .entry-title { text-align: center; margin-bottom: 1.5em; font-size: 2.5em; color: #1a2533; }
.company-main-info { display: flex; flex-direction: column; align-items: center; gap: 20px; margin-bottom: 2em; padding-bottom: 2em; border-bottom: 1px solid #eee; text-align: center; }
.company-logo { width: 100%; max-width: 220px; margin-bottom: 1em; }
.company-logo img { width: 100%; height: auto; display: block; border-radius: 8px; background-color: #f9f9f9; padding: 10px; border: 1px solid #eee; transition: transform 0.3s ease, box-shadow 0.3s ease; }
.company-logo a:hover img { transform: scale(1.05); box-shadow: 0 8px 20px rgba(0,0,0,0.1); }
.company-details { width: 100%; }
.company-details p, .company-details div { margin-bottom: 0.8em; line-height: 1.6; }
.company-details strong { color: #333; }
@media (min-width: 768px) {
    .company-main-info { flex-direction: row; text-align: left; align-items: flex-start; gap: 40px; }
    .company-logo { flex: 0 0 200px; margin-bottom: 0; }
    .company-details { flex: 1; }
}
.company-taxonomies { margin-top: 30px; }
.taxonomy-group { margin-bottom: 25px; }
.taxonomy-group strong { display: block; margin-bottom: 12px; font-size: 1.2em; color: #2c3e50; padding-bottom: 5px; border-bottom: 2px solid #ecf0f1; }
.tags-wrapper { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.tags-wrapper > *:not(:last-child)::after { content: ","; margin-left: -2px; color: #7f8c8d; }
.tag-link, .tag-like { display: inline-block; padding: 8px 15px; font-size: 14px; font-weight: 500; border-radius: 5px; }
.tag-link { text-decoration: none; transition: all 0.2s ease-in-out; border: 1px solid transparent; }
.tag-link:hover { transform: translateY(-2px); box-shadow: 0 4px 8px rgba(0,0,0,0.1); }
.tag-sector { background-color: #fff5e6; color: #f39c12; border-color: #fee9c5; }
.tag-sector:hover { background-color: #f39c12; color: #fff; }
.tag-technology { background-color: #eaf5ff; color: #2980b9; border-color: #d4eaf7; }
.tag-technology:hover { background-color: #2980b9; color: #fff; }
.tag-wp { background-color: #e8f6f3; color: #16a085; border-color: #d1f2eb; }
.tag-wp.tag-link:hover { background-color: #16a085; color: #fff; }
.tag-pps { background-color: #f4ecf7; color: #8e44ad; border-color: #e8daef; }
.tag-pps.tag-link:hover { background-color: #8e44ad; color: #fff; }
.tag-typology { background-color: #f2f4f4; color: #7f8c8d; border: 1px solid #e5e8e8; }

/**
 * ===================================================================
 * ESTILOS PARA A PÁGINA DE ARQUIVO DE EMPRESAS (archive-empresas.php)
 * ===================================================================
 */
.icm-archive-main { max-width: 1200px; margin: 2em auto; padding: 0 2em; }
.icm-archive-main .page-header { text-align: center; margin-bottom: 2.5em; padding-bottom: 1.5em; border-bottom: 1px solid #e0e0e0; }
.icm-archive-main .page-title { font-size: 2.8em; color: #1a2533; font-weight: 700; margin: 0; }
.icm-archive-main .page-title span { color: #0056b3; }
.icm-archive-main .archive-description { font-size: 1.1em; color: #555; margin-top: 0.5em; max-width: 800px; margin-left: auto; margin-right: auto; }
#icm-filters-wrap { background-color: #f8f9fa; padding: 20px 25px; border-radius: 8px; margin-bottom: 3em; border: 1px solid #e9ecef; }
#icm-company-filters { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-end; }
.filter-group { flex: 1; min-width: 220px; }
.filter-group label { display: block; font-weight: 600; margin-bottom: 8px; color: #343a40; font-size: 14px; }
.filter-group select { width: 100%; padding: 12px 15px; border: 1px solid #ced4da; border-radius: 5px; background-color: #fff; font-size: 16px; transition: border-color 0.2s ease, box-shadow 0.2s ease; -webkit-appearance: none; appearance: none; background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M5%208l5%205%205-5z%22%20fill%3D%22%23555%22%2F%3E%3C%2Fsvg%3E'); background-repeat: no-repeat; background-position: right 15px center; background-size: 16px; cursor: pointer; }
.filter-group select:focus { outline: none; border-color: #007bff; box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15); }
.companies-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 30px; }
.company-card { background-color: #fff; border: 1px solid #e0e0e0; border-radius: 8px; overflow: hidden; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05); transition: transform 0.3s ease, box-shadow 0.3s ease; display: flex; flex-direction: column; }
.company-card:hover { transform: translateY(-8px); box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1); }
.card-link-wrapper { text-decoration: none; color: inherit; display: flex; flex-direction: column; height: 100%; }
.company-card-logo { width: 100%; height: 180px; display: flex; align-items: center; justify-content: center; background-color: #f9f9f9; padding: 15px; box-sizing: border-box; border-bottom: 1px solid #eee; }
.company-card-logo img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.company-card-logo .logo-placeholder { width: 80px; height: 80px; background-color: #0056b3; color: #fff; font-size: 3em; font-weight: bold; display: flex; align-items: center; justify-content: center; border-radius: 50%; }
.company-card-content { padding: 20px; display: flex; flex-direction: column; flex-grow: 1; }
.company-card-title { font-size: 1.25em; font-weight: 600; color: #1a2533; margin: 0 0 15px 0; line-height: 1.3; flex-grow: 1; }
/* ---- ATUALIZADO: Estilos para os novos pills ---- */
.company-card-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.wp-pill, .pps-pill { display: inline-block; font-size: 12px; font-weight: 500; padding: 5px 12px; border-radius: 15px; line-height: 1.4; }
.wp-pill { background-color: #e8f6f3; color: #16a085; }
.pps-pill { background-color: #f4ecf7; color: #8e44ad; }
/* ---- FIM DAS ATUALIZAÇÕES ---- */
#icm-companies-archive-container .loading-feedback, #icm-companies-archive-container .no-results { text-align: center; padding: 50px 20px; font-size: 1.2em; color: #777; }
@media (max-width: 768px) {
    .icm-archive-main { padding: 0 1em; margin-top: 1em; }
    .icm-archive-main .page-title { font-size: 2.2em; }
    #icm-company-filters { flex-direction: column; align-items: stretch; }
}

.company-card-sectors {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto; /* Alinha os setores na base do conteúdo */
}

.sector-pill {
    display: inline-block;
    background-color: #eaf5ff;
    color: #2980b9;
    font-size: 12px;
    font-weight: 500;
    padding: 5px 12px;
    border-radius: 15px;
    line-height: 1.4;
}

/* --- Estados de Carregamento e Sem Resultados --- */
#icm-companies-archive-container .loading-feedback,
#icm-companies-archive-container .no-results {
    text-align: center;
    padding: 50px 20px;
    font-size: 1.2em;
    color: #777;
}

/* --- Media Queries para Responsividade --- */
@media (max-width: 768px) {
    .icm-archive-main {
        padding: 0 1em; /* Reduz o padding em mobile */
        margin-top: 1em;
    }
    
    .icm-archive-main .page-title {
        font-size: 2.2em;
    }

    #icm-company-filters {
        flex-direction: column;
        align-items: stretch; /* Ocupa a largura total */
    }
}