/* ==========================================================================
   LISTAGEM DE BIOGRAFIAS - AS MOTORIZADAS PORTUGUESAS
   Ficheiro: /css/biografias.css
   ========================================================================== */

/* 1. SECÇÃO HERO (TOPO) */
.biografias-hero {
    background: linear-gradient(135deg, #1a3c5e 0%, #0d2238 100%);
    color: #ffffff;
    padding: 110px 0 55px 0;
    text-align: center;
}

.biografias-hero h1 {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 10px;
}

.biografias-hero p {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.8);
    max-width: 700px;
    margin: 0 auto;
}

/* 2. ESPAÇAMENTO GLOBAL (EVITA COLAGEM AO RODAPÉ) */
.biografias-main-container {
    padding-bottom: 100px;
    /* Distância confortável até ao rodapé */
}

/* 3. BARRA DE FILTROS (3 COLUNAS DE 1/3 CADA) */
.filter-bar-container {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.06);
    padding: 18px 22px;
    margin-top: -30px;
    position: relative;
    z-index: 10;
    border: 1px solid #edf0f4;
}

.filter-grid-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    /* Cada coluna ocupa rigorosamente 1/3 */
    gap: 15px;
    align-items: center;
}

.filter-col {
    width: 100%;
}

/* Grupos com Ícone (Input de Texto e Select) */
.input-icon-group,
.select-icon-group {
    position: relative;
    width: 100%;
}

.input-icon-group i,
.select-icon-group i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #888277;
    font-size: 0.9rem;
    z-index: 5;
    pointer-events: none;
}

/* Estilo do Campo de Pesquisa por Nome */
.input-icon-group input {
    padding-left: 42px;
    height: 48px;
    border-radius: 8px;
    border: 1px solid #dcd7cd;
    font-size: 0.95rem;
    width: 100%;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s ease;
}

.input-icon-group input:focus {
    border-color: #1a3c5e;
}

/* Estilo do Select2 (Filtro por Empresa - IDÊNTICO AO INPUT) */
.select-icon-group .select2-container {
    width: 100% !important;
}

.select-icon-group .select2-container--default .select2-selection--single {
    height: 48px;
    border-radius: 8px;
    border: 1px solid #dcd7cd;
    display: flex;
    align-items: center;
    padding-left: 42px;
    /* Espaço para o ícone */
    background-color: #ffffff;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}

.select-icon-group .select2-container--default.select2-container--open .select2-selection--single,
.select-icon-group .select2-container--default .select2-selection--single:focus {
    border-color: #1a3c5e;
}

.select-icon-group .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #495057;
    font-size: 0.95rem;
    padding-left: 0;
    line-height: 46px;
}

.select-icon-group .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 46px;
    right: 12px;
}

.select-icon-group .select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #6c757d;
}

/* Menu Dropdown de Opções do Select2 */
.select2-dropdown {
    border: 1px solid #dcd7cd;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    font-size: 0.95rem;
    overflow: hidden;
    z-index: 9999;
}

.select2-search--dropdown {
    padding: 8px 10px;
}

.select2-search--dropdown .select2-search__field {
    border: 1px solid #dcd7cd;
    border-radius: 6px;
    padding: 6px 10px;
    outline: none;
}

.select2-results__option {
    padding: 8px 12px;
}

.select2-results__option--highlighted[aria-selected] {
    background-color: #1a3c5e !important;
    color: #ffffff !important;
}

/* Botão Pesquisar (1/3) */
.btn-pesquisar {
    background: #1a3c5e;
    color: #ffffff;
    height: 48px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.95rem;
    width: 100%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.btn-pesquisar:hover {
    background: #0d2238;
    color: #ffffff;
    transform: translateY(-1px);
}

/* 4. CONTAGEM EXTERNA (FORA DA BARRA DE FILTROS) */
.filter-count-wrapper {
    margin: 14px 4px 22px 4px;
    font-size: 0.8rem;
    color: #888277;
    font-weight: 600;
}

/* 5. CARTÕES DA LISTAGEM (MAIOR ESPAÇAMENTO ENTRE ITENS) */
.socio-item {
    margin-bottom: 22px;
    /* Espaço aumentado entre cada linha */
}

.socio-card-link {
    text-decoration: none !important;
    color: inherit !important;
    display: block;
}

.socio-card-compact {
    background: #ffffff;
    border-radius: 10px;
    border: 1px solid #e8e3da;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
    padding: 18px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.25s ease;
}

.socio-card-link:hover .socio-card-compact {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(26, 60, 94, 0.09);
    border-color: #d4af37;
}

/* Lado Esquerdo do Cartão: Foto, Nome e Empresa */
.socio-left-side {
    display: flex;
    align-items: center;
    gap: 18px;
}

.socio-avatar {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #d4af37;
    flex-shrink: 0;
    background: #e9ecef;
}

.socio-avatar-placeholder {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: #1a3c5e;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 700;
    border: 2px solid #d4af37;
    flex-shrink: 0;
}

.socio-text-group h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1a3c5e;
    margin: 0 0 6px 0;
    line-height: 1.2;
}

.socio-badge-empresas {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f4f6f9;
    color: #555555;
    border: 1px solid #e2e6ea;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
}

.socio-badge-empresas i {
    color: #1a3c5e;
}

/* Lado Direito do Cartão: Seta de Ação */
.socio-right-side {
    display: flex;
    align-items: center;
}

.btn-arrow-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #f8f9fa;
    border: 1px solid #e3e6f0;
    color: #1a3c5e;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.25s ease;
}

.socio-card-link:hover .btn-arrow-circle {
    background: #1a3c5e;
    border-color: #1a3c5e;
    color: #ffffff;
    transform: translateX(4px);
}

/* 6. PAGINAÇÃO */
.pagination-wrapper {
    margin-top: 35px;
    display: flex;
    justify-content: center;
}

.pagination-custom {
    display: flex;
    gap: 6px;
    list-style: none;
    padding: 0;
}

.pagination-custom .page-btn {
    border: 1px solid #dcd7cd;
    background: #ffffff;
    color: #1a3c5e;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination-custom .page-btn:hover {
    background: #f4f6f9;
    border-color: #1a3c5e;
}

.pagination-custom .page-btn.active {
    background: #1a3c5e;
    color: #ffffff;
    border-color: #1a3c5e;
}

.pagination-custom .page-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* 7. RESPONSIVIDADE (MOBILE) */
@media (max-width: 768px) {
    .filter-grid-row {
        grid-template-columns: 1fr;
        /* Quebra em coluna única no telemóvel */
        gap: 12px;
    }

    .socio-card-compact {
        padding: 14px 16px;
    }

    .socio-avatar,
    .socio-avatar-placeholder {
        width: 55px;
        height: 55px;
        font-size: 1.2rem;
    }

    .socio-text-group h3 {
        font-size: 1.05rem;
    }
}