/**
 * Estilos para o Plugin Vagas Gupy
 * Version: 5.0 - Layout em tabela
 */

.gupy-jobs-container {
    max-width: 100%;
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
    z-index: 99;
}

/* Barra de busca e filtros */
.gupy-filtros {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.gupy-busca {
    position: relative;
    flex: 1;
    min-width: 250px;
    max-width: 480px;
}

.gupy-busca input {
    width: 100%;
    padding: 12px 44px 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.95em;
    color: #2d3748;
    background: #fff;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.gupy-busca input::placeholder {
    color: #9ca3af;
}

.gupy-busca input:focus {
    border-color: #2d3748;
    box-shadow: 0 0 0 2px rgba(45, 55, 72, 0.1);
}

.gupy-search-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none;
}

.gupy-filtro-wrapper {
    position: relative;
}

.gupy-filtro-wrapper select {
    appearance: none;
    -webkit-appearance: none;
    padding: 12px 36px 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.95em;
    color: #2d3748;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat right 12px center;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    min-width: 160px;
}

.gupy-filtro-wrapper select:focus {
    border-color: #2d3748;
    box-shadow: 0 0 0 2px rgba(45, 55, 72, 0.1);
}

/* Mensagem sem resultados */
.gupy-no-results {
    text-align: center;
    padding: 32px 20px;
    color: #6b7280;
    font-size: 0.95em;
}

/* Tabela de vagas */
.gupy-vagas-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.gupy-vagas-table thead tr {
    background-color: #2d3748;
}

.gupy-vagas-table thead th {
    color: #fff;
    font-weight: 600;
    font-size: 0.9em;
    text-align: left;
    padding: 16px 20px;
    border: none;
    white-space: nowrap;
}

.gupy-vagas-table thead th:last-child {
    text-align: center;
}

.gupy-vagas-table tbody tr {
    border-bottom: 1px solid #e8ecf1;
    transition: background-color 0.2s ease;
}

.gupy-vagas-table tbody tr:last-child {
    border-bottom: none;
}

.gupy-vagas-table tbody tr:hover {
    background-color: #f7f9fc;
}

.gupy-vagas-table tbody td {
    padding: 18px 20px;
    font-size: 0.95em;
    color: #4a5568;
    vertical-align: middle;
    border: none;
}

.gupy-vagas-table td.vaga-nome {
    font-weight: 500;
    color: #2d3748;
}

.gupy-vagas-table td.vaga-modo,
.gupy-vagas-table td.vaga-tipo {
    color: #636e7f;
}

.gupy-vagas-table td.vaga-acao {
    text-align: center;
    white-space: nowrap;
}

/* Botão "Quero me candidatar" */
.btn-candidatar {
    display: inline-block;
    padding: 10px 20px;
    border: 2px solid #2d3748;
    border-radius: 6px;
    color: #2d3748;
    font-size: 0.85em;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-candidatar:hover {
    background-color: #2d3748;
    color: #fff;
}

/* Estados de erro e avisos */
.gupy-error,
.gupy-no-jobs {
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    font-weight: 500;
    text-align: center;
}

.gupy-error {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-left: 4px solid #dc3545;
}

.gupy-no-jobs {
    background: linear-gradient(135deg, #d1ecf1, #bee5eb);
    color: #0c5460;
    border: 1px solid #bee5eb;
    border-left: 4px solid #17a2b8;
}

.gupy-debug {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-left: 4px solid #ffc107;
    padding: 20px;
    margin: 30px 0;
    border-radius: 8px;
    max-height: 400px;
    overflow-y: auto;
}

.gupy-debug h4 {
    margin: 0 0 15px 0;
    color: #856404;
}

.gupy-debug pre {
    margin: 0;
    font-size: 11px;
    white-space: pre-wrap;
    background: rgba(0, 0, 0, 0.05);
    padding: 15px;
    border-radius: 4px;
    color: #495057;
}

/* Paginação */
.gupy-paginacao {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
    flex-wrap: wrap;
    z-index: 10;
    position: relative;
}

.gupy-pag-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    color: #2d3748;
    cursor: pointer;
    transition: all 0.2s ease;
}

.gupy-pag-btn:hover:not(:disabled) {
    border-color: #2d3748;
    background: #f7f9fc;
}

.gupy-pag-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.gupy-pag-numbers {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
}

.gupy-pag-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 0.9em;
    font-weight: 500;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.gupy-pag-num:hover {
    background: #e8ecf1;
}

.gupy-pag-num.active {
    background: #2d3748;
    color: #fff;
}

/* Responsive Design */
@media (max-width: 768px) {
    .gupy-filtros {
        flex-direction: column;
        gap: 12px;
    }

    .gupy-busca {
        max-width: 100%;
    }

    .gupy-filtro-wrapper {
        width: 100%;
    }

    .gupy-filtro-wrapper select {
        width: 100%;
    }


    .gupy-vagas-table,
    .gupy-vagas-table thead,
    .gupy-vagas-table tbody,
    .gupy-vagas-table th,
    .gupy-vagas-table td,
    .gupy-vagas-table tr {
        display: block;
    }

    .gupy-vagas-table thead {
        display: none;
    }

    .gupy-vagas-table tbody tr {
        margin-bottom: 16px;
        border: 1px solid #e8ecf1;
        border-radius: 8px;
        padding: 16px;
        background: #fff;
    }

    .gupy-vagas-table tbody td {
        padding: 8px 0;
        text-align: left;
        border: none;
    }

    .gupy-vagas-table tbody td.vaga-nome {
        font-size: 1.05em;
        font-weight: 600;
        padding-bottom: 12px;
    }

    .gupy-vagas-table tbody td.vaga-modo::before {
        content: 'Modo: ';
        font-weight: 600;
        color: #2d3748;
    }

    .gupy-vagas-table tbody td.vaga-tipo::before {
        content: 'Tipo: ';
        font-weight: 600;
        color: #2d3748;
    }

    .gupy-vagas-table td.vaga-acao {
        text-align: left;
        padding-top: 12px;
    }

    .btn-candidatar {
        display: block;
        text-align: center;
    }
}