/* Emprego CSS - Estilos específicos para a página de empregos */

/* Variáveis da página de emprego */
:root {
    --primary-color: var(--orange-main, #f66627);
    --primary-light: rgba(246, 102, 39, 0.1);
    --primary-dark: var(--orange-light, #fd7c29);
    --accent-color: var(--purple, #552b94);
    --accent-light: rgba(85, 43, 148, 0.1);
    --text-color: var(--text-dark, #333333);
    --light-bg: var(--grey-light, #f5f5f5);
    --primary-rgb: 246, 102, 39;
}

/* Header específico para a página de emprego */
.job-header {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: #fff;
    padding: 3rem 0;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

.job-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: repeating-linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.05),
        rgba(255, 255, 255, 0.05) 10px,
        rgba(255, 255, 255, 0.08) 10px,
        rgba(255, 255, 255, 0.08) 20px
    );
    z-index: 1;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 2;
}

.logo-small img {
    height: 60px;
    margin-right: 1.5rem;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.2));
    transition: transform 0.3s ease;
}

.logo-small:hover img {
    transform: scale(1.05);
}

.page-title {
    font-size: 2.8rem;
    margin: 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    font-family: var(--font-headers, 'Nunito', sans-serif);
    font-weight: 800;
    letter-spacing: 1px;
}

/* Seção de pesquisa e filtros */
.job-search-section {
    padding: 2.5rem 0;
    background-color: var(--light-bg);
    border-bottom: 1px solid rgba(246, 102, 39, 0.15);
    position: relative;
}

.job-search-section::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, 
                var(--primary-color) 0%,
                var(--accent-color) 50%,
                var(--primary-color) 100%);
    opacity: 0.7;
}

.search-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: flex-end;
    justify-content: center;
    max-width: 1000px;
    margin: 0 auto;
    background: #fff;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.region-filter {
    flex-grow: 1;
    min-width: 200px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 0.5rem;
}

.keyword-filter {
    flex-grow: 2;
    min-width: 250px;
    position: relative;
    display: flex;
    align-items: stretch; /* Alterado para stretch para garantir que os elementos tenham a mesma altura */
    gap: 0.5rem;
}

.region-filter label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--accent-color);
    font-family: var(--font-headers, 'Nunito', sans-serif);
    font-size: 1rem;
    text-align: left;
    width: 100%;
}

.region-filter select,
.keyword-filter input {
    width: 100%;
    padding: 0 1.2rem;
    border: 2px solid rgba(246, 102, 39, 0.2);
    border-radius: 6px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: #fff;
    color: var(--text-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    height: 45px; /* Altura fixa para garantir consistência */
    box-sizing: border-box;
    line-height: normal; /* Melhor compatibilidade entre navegadores */
    vertical-align: middle;
}

.region-filter select {
    background-image: linear-gradient(45deg, transparent 50%, var(--primary-color) 50%), 
                      linear-gradient(135deg, var(--primary-color) 50%, transparent 50%);
    background-position: calc(100% - 20px) calc(1em + 2px), 
                         calc(100% - 15px) calc(1em + 2px);
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-right: 2.5rem;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.region-filter select:focus,
.keyword-filter input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.2);
    transform: translateY(-2px);
}

/* Estilo para seleção ativa de região */
.active-selection {
    animation: pulse-select 0.5s ease;
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.3) !important;
}

@keyframes pulse-select {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.btn-search {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 1.8rem;
    border: 2px solid var(--primary-color); /* Adicionar borda para consistência visual */
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    background-color: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(246, 102, 39, 0.2);
    transition: all 0.3s ease;
    margin-left: 0.5rem;
    white-space: nowrap;
    min-width: 120px;
    height: 45px; /* Altura fixa igual à caixa de texto */
    font-family: var(--font-headers, 'Nunito', sans-serif);
    flex-shrink: 0;
    box-sizing: border-box;
}

.btn-search:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(246, 102, 39, 0.3);
}

.btn-search i {
    margin-right: 0.5rem;
}

/* Estilo para os cartões de empregos */
.job-listings-section {
    padding: 3.5rem 0;
    background-color: #fff;
    position: relative;
}

.job-listings-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(to right, var(--primary-color), var(--accent-color));
    opacity: 0.1;
}

.job-listings {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.8rem;
    margin-top: 2rem;
    position: relative;
    padding-top: 1rem;
    border-top: 1px dashed rgba(85, 43, 148, 0.2);
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* Esta classe será aplicada dinamicamente para transições suaves */
.job-listings.loading {
    opacity: 0;
    pointer-events: none; /* Impede cliques durante o carregamento */
}

.job-card {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    border-left: 4px solid var(--primary-color);
    position: relative;
    animation: fade-in-up 0.4s ease-out;
    animation-fill-mode: backwards;
}

.job-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(246, 102, 39, 0.15);
}

.job-card-header {
    padding: 1.5rem 1.5rem 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.job-title {
    font-size: 1.25rem;
    color: var(--primary-color);
    margin: 0;
    line-height: 1.4;
    flex-grow: 1;
    margin-right: 1rem;
    font-weight: 700;
    font-family: var(--font-headers, 'Nunito', sans-serif);
    text-shadow: 0 1px 1px rgba(246, 102, 39, 0.1);
}

.job-date {
    font-size: 0.85rem;
    color: #777;
    white-space: nowrap;
    background-color: rgba(85, 43, 148, 0.1);
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-weight: 500;
}

.job-card-body {
    padding: 1rem 1.5rem;
    flex-grow: 1;
}

.job-location {
    display: flex;
    align-items: center;
    margin-bottom: 0.7rem;
    color: #555;
    font-size: 0.95rem;
    padding: 0.5rem 0.8rem;
    background-color: var(--light-bg);
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.job-location:hover {
    background-color: rgba(var(--primary-rgb), 0.08);
}

.job-location i {
    color: var(--primary-color);
    margin-right: 0.7rem;
    min-width: 18px;
    text-align: center;
    font-size: 1rem;
}

/* Estilos para localização com mais destaque */
.location-text {
    font-weight: 600;
    color: var(--accent-color);
}

/* Cores por região */
.region-lisboa .job-location i { color: #e74c3c; }
.region-porto .job-location i { color: #3498db; }
.region-braga .job-location i { color: #2ecc71; }
.region-faro .job-location i { color: #f39c12; }
.region-coimbra .job-location i { color: #9b59b6; }
.region-aveiro .job-location i { color: #1abc9c; }
.region-setubal .job-location i { color: #d35400; }
.region-madeira .job-location i { color: #27ae60; }
.region-acores .job-location i { color: #2980b9; }

.job-description {
    margin-top: 1.2rem;
    font-size: 0.95rem;
    color: var(--text-color);
    line-height: 1.6;
    padding: 0.8rem 0;
    border-top: 1px dashed rgba(var(--primary-rgb), 0.2);
    min-height: 80px;
}

.job-card-footer {
    padding: 1rem 1.5rem 1.5rem;
    margin-top: auto;
}

.btn-view-job {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.7rem 1.2rem;
    border-radius: 4px;
    background-color: var(--primary-light);
    color: var(--primary-color);
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    font-family: var(--font-headers, 'Nunito', sans-serif);
}

.btn-view-job:hover {
    background-color: var(--primary-color);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(246, 102, 39, 0.2);
}

.btn-view-job i {
    margin-right: 0.5rem;
}

/* Indicador de carregamento */
.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 0;
    color: var(--primary-color);
    margin: 1.5rem auto;
    background-color: var(--light-bg);
    border-radius: 10px;
    border: 1px dashed rgba(var(--primary-rgb), 0.3);
    max-width: 600px;
    box-shadow: 0 4px 15px rgba(246, 102, 39, 0.1);
    transition: all 0.3s ease;
    animation: fade-in 0.5s ease;
}

.loading-indicator i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    text-shadow: 0 0 10px rgba(246, 102, 39, 0.3);
    animation: spin-pulse 1.5s infinite ease-in-out;
}

.loading-indicator span {
    font-family: var(--font-headers, 'Nunito', sans-serif);
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1.15rem;
}

@keyframes spin-pulse {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.1); }
    100% { transform: rotate(360deg) scale(1); }
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in-up {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fade-out {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-10px); }
}

/* Mensagem de sem resultados */
.no-results {
    text-align: center;
    padding: 3rem 2rem;
    background-color: var(--light-bg);
    border-radius: 10px;
    margin: 2rem auto;
    max-width: 600px;
    border: 1px dashed var(--accent-color);
    box-shadow: 0 4px 15px rgba(85, 43, 148, 0.1);
    animation: fade-in-up 0.4s ease-out;
}

.no-results i {
    font-size: 3.5rem;
    color: var(--accent-color);
    margin-bottom: 1rem;
    display: block;
    opacity: 0.7;
}

.no-results p {
    font-size: 1.2rem;
    color: var(--text-color);
    font-family: var(--font-headers, 'Nunito', sans-serif);
    font-weight: 600;
}

/* Melhorias no footer para a página de empregos */
footer {
    margin-top: 2rem;
    padding-top: 3rem;
    border-top: 1px solid rgba(246, 102, 39, 0.1);
}

footer .footer-content .links a {
    margin: 0 1rem;
    transition: color 0.3s ease;
}

footer .footer-content .links a:hover {
    color: var(--primary-color);
}

/* Animação para elementos de interface */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.btn-search:active {
    animation: pulse 0.3s ease;
}

/* Responsividade */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }

    .search-filters {
        flex-direction: column;
        gap: 1.2rem;
        padding: 1.2rem;
    }

    .region-filter, 
    .keyword-filter {
        width: 100%;
    }

    .keyword-filter {
        flex-wrap: wrap;
    }

    .region-filter select,
    .keyword-filter input,
    .btn-search {
        height: 50px; /* Altura ligeiramente maior em dispositivos móveis para facilitar o toque */
    }

    .btn-search {
        margin-left: 0;
        margin-top: 0.8rem;
        width: 100%;
    }

    .form-row {
        flex-direction: column;
    }
    
    .job-card-header {
        flex-direction: column;
    }
    
    .job-date {
        margin-top: 0.5rem;
    }
    
    .featured-jobs-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .job-listings {
        grid-template-columns: 1fr;
    }
}