/* ======================================
   HP-RH Mariano Romero - Frontend Styles
   ====================================== */

/* Variables de color */
:root {
    --hp-rh-primary: #2271b1;
    --hp-rh-primary-dark: #135e96;
    --hp-rh-secondary: #646970;
    --hp-rh-border: #dcdcde;
    --hp-rh-bg-light: #f6f7f7;
    --hp-rh-success: #00a32a;
    --hp-rh-warning: #dba617;
    --hp-rh-danger: #d63638;
    --hp-rh-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* =======================
   LISTADO DE VACANTES
   ======================= */

.hp-rh-vacantes-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Filtros */
.hp-rh-filtros {
    background: #fff;
    border: 1px solid var(--hp-rh-border);
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: var(--hp-rh-shadow);
}

.hp-rh-filtros-title {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 20px;
    color: #1d2327;
    font-weight: 600;
}

.hp-rh-filtros-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.hp-rh-filtro-group {
    display: flex;
    flex-direction: column;
}

.hp-rh-filtro-group label {
    font-weight: 600;
    margin-bottom: 6px;
    color: #1d2327;
    font-size: 14px;
}

.hp-rh-input,
.hp-rh-select {
    padding: 10px 12px;
    border: 1px solid var(--hp-rh-border);
    border-radius: 5px;
    font-size: 14px;
    transition: all 0.3s;
    background: #fff;
}

.hp-rh-input:focus,
.hp-rh-select:focus {
    outline: none;
    border-color: var(--hp-rh-primary);
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.1);
}

.hp-rh-filtro-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

/* Botones */
.hp-rh-btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s;
    line-height: 1.4;
}

.hp-rh-btn-primary {
    background: var(--hp-rh-primary);
    color: #fff;
}

.hp-rh-btn-primary:hover {
    background: var(--hp-rh-primary-dark);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 113, 177, 0.3);
}

.hp-rh-btn-secondary {
    background: #fff;
    color: var(--hp-rh-secondary);
    border: 1px solid var(--hp-rh-border);
}

.hp-rh-btn-secondary:hover {
    background: var(--hp-rh-bg-light);
    border-color: var(--hp-rh-secondary);
}

.hp-rh-btn-block {
    display: block;
    width: 100%;
}

/* Grid de vacantes */
.hp-rh-vacantes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

/* Tarjeta de vacante */
.hp-rh-vacante-card {
    background: #fff;
    border: 1px solid var(--hp-rh-border);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    box-shadow: var(--hp-rh-shadow);
}

.hp-rh-vacante-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    border-color: var(--hp-rh-primary);
}

.hp-rh-vacante-thumbnail {
    width: 100%;
    height: 180px;
    overflow: hidden;
}

.hp-rh-vacante-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.hp-rh-vacante-card:hover .hp-rh-vacante-thumbnail img {
    transform: scale(1.05);
}

.hp-rh-vacante-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.hp-rh-vacante-header {
    margin-bottom: 15px;
}

.hp-rh-vacante-title {
    margin: 0 0 8px;
    font-size: 18px;
    line-height: 1.4;
}

.hp-rh-vacante-title a {
    color: #1d2327;
    text-decoration: none;
    font-weight: 700;
    transition: color 0.3s;
}

.hp-rh-vacante-title a:hover {
    color: var(--hp-rh-primary);
}

.hp-rh-vacante-empresa {
    margin: 0;
    color: var(--hp-rh-secondary);
    font-size: 14px;
    font-weight: 500;
}

/* Meta información */
.hp-rh-vacante-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--hp-rh-border);
}

.hp-rh-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: var(--hp-rh-secondary);
}

.hp-rh-meta-item svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.hp-rh-meta-item.hp-rh-salario {
    color: var(--hp-rh-success);
    font-weight: 600;
}

/* Tags */
.hp-rh-vacante-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.hp-rh-tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
}

.hp-rh-tag-categoria {
    background: #e7f5ff;
    color: #0a4b78;
}

.hp-rh-tag-modalidad {
    background: #f3f0ff;
    color: #5b21b6;
}

/* Excerpt */
.hp-rh-vacante-excerpt {
    flex-grow: 1;
    color: var(--hp-rh-secondary);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 15px;
}

/* Footer de la tarjeta */
.hp-rh-vacante-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid var(--hp-rh-border);
}

.hp-rh-fecha-cierre {
    font-size: 12px;
    color: var(--hp-rh-warning);
    font-weight: 600;
}

/* Sin resultados */
.hp-rh-no-results {
    text-align: center;
    padding: 60px 20px;
    background: var(--hp-rh-bg-light);
    border-radius: 8px;
}

.hp-rh-no-results p {
    font-size: 16px;
    color: var(--hp-rh-secondary);
    margin: 0;
}

/* Loading */
.hp-rh-loading {
    text-align: center;
    padding: 40px;
}

.hp-rh-spinner {
    border: 4px solid var(--hp-rh-border);
    border-top: 4px solid var(--hp-rh-primary);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: hp-rh-spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes hp-rh-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Paginación */
.hp-rh-pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
}

.hp-rh-pagination a,
.hp-rh-pagination span {
    padding: 8px 14px;
    border: 1px solid var(--hp-rh-border);
    border-radius: 5px;
    text-decoration: none;
    color: var(--hp-rh-secondary);
    transition: all 0.3s;
}

.hp-rh-pagination a:hover {
    background: var(--hp-rh-primary);
    color: #fff;
    border-color: var(--hp-rh-primary);
}

.hp-rh-pagination .current {
    background: var(--hp-rh-primary);
    color: #fff;
    border-color: var(--hp-rh-primary);
}

/* =======================
   SINGLE DE VACANTE
   ======================= */

.hp-rh-vacante-single {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header del single */
.hp-rh-single-header {
    background: #fff;
    border: 1px solid var(--hp-rh-border);
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--hp-rh-shadow);
}

.hp-rh-single-title {
    margin: 0 0 10px;
    font-size: 32px;
    color: #1d2327;
    line-height: 1.3;
}

.hp-rh-single-empresa {
    font-size: 18px;
    color: var(--hp-rh-secondary);
    margin: 0 0 20px;
    font-weight: 500;
}

.hp-rh-single-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 20px;
    background: var(--hp-rh-bg-light);
    border-radius: 5px;
}

.hp-rh-single-meta .hp-rh-meta-item {
    font-size: 15px;
}

.hp-rh-single-thumbnail {
    margin-top: 20px;
    border-radius: 5px;
    overflow: hidden;
}

.hp-rh-single-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
}

/* Contenido del single */
.hp-rh-single-content {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
}

.hp-rh-single-main {
    background: #fff;
    border: 1px solid var(--hp-rh-border);
    border-radius: 8px;
    padding: 30px;
    box-shadow: var(--hp-rh-shadow);
}

.hp-rh-section {
    margin-bottom: 35px;
}

.hp-rh-section:last-child {
    margin-bottom: 0;
}

.hp-rh-section h2 {
    font-size: 24px;
    margin: 0 0 20px;
    color: #1d2327;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--hp-rh-primary);
}

.hp-rh-description {
    font-size: 16px;
    line-height: 1.8;
    color: #1d2327;
}

.hp-rh-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.hp-rh-list li {
    padding: 10px 0 10px 30px;
    position: relative;
    line-height: 1.6;
    color: var(--hp-rh-secondary);
}

.hp-rh-list li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--hp-rh-success);
    font-weight: bold;
    font-size: 18px;
}

.hp-rh-beneficios-list li:before {
    content: "★";
    color: var(--hp-rh-warning);
}

/* Habilidades */
.hp-rh-habilidades {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hp-rh-habilidad {
    display: inline-block;
    padding: 8px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

/* Sidebar */
.hp-rh-single-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.hp-rh-sidebar-card {
    background: #fff;
    border: 1px solid var(--hp-rh-border);
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--hp-rh-shadow);
}

.hp-rh-sidebar-card h3 {
    margin: 0 0 15px;
    font-size: 18px;
    color: #1d2327;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--hp-rh-border);
}

.hp-rh-sidebar-card p {
    margin: 0 0 12px;
    font-size: 14px;
    line-height: 1.6;
}

.hp-rh-sidebar-card p:last-child {
    margin-bottom: 0;
}

.hp-rh-salario-amount {
    font-size: 28px;
    font-weight: 700;
    color: var(--hp-rh-success);
    margin-bottom: 5px;
}

.hp-rh-salario-periodo {
    color: var(--hp-rh-secondary);
    font-size: 13px;
}

.hp-rh-contacto-card {
    /* El degradado se aplica inline desde el PHP para permitir personalización */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
}

.hp-rh-contacto-card h3 {
    color: #fff;
    border-bottom-color: rgba(255,255,255,0.3);
}

.hp-rh-contacto-card .hp-rh-btn-primary {
    background: #fff;
    color: var(--hp-rh-primary);
    margin-bottom: 15px;
}

.hp-rh-contacto-card .hp-rh-btn-primary:hover {
    background: #f0f0f1;
}

.hp-rh-contacto-card .hp-rh-btn-secondary {
    background: transparent;
    color: #fff;
    border-color: rgba(255,255,255,0.5);
}

.hp-rh-contacto-card .hp-rh-btn-secondary:hover {
    background: rgba(255,255,255,0.1);
    border-color: #fff;
}

.hp-rh-contacto-item {
    color: #fff;
}

.hp-rh-contacto-item a {
    color: #fff;
    text-decoration: underline;
}

.hp-rh-contacto-item a:hover {
    text-decoration: none;
}

/* =======================
   RESPONSIVE
   ======================= */

@media (max-width: 992px) {
    .hp-rh-single-content {
        grid-template-columns: 1fr;
    }
    
    .hp-rh-single-sidebar {
        order: 2;
    }
}

@media (max-width: 768px) {
    .hp-rh-vacantes-grid {
        grid-template-columns: 1fr;
    }
    
    .hp-rh-filtros-form {
        grid-template-columns: 1fr;
    }
    
    .hp-rh-filtro-actions {
        flex-direction: column;
    }
    
    .hp-rh-single-title {
        font-size: 24px;
    }
    
    .hp-rh-single-header {
        padding: 20px;
    }
    
    .hp-rh-single-main {
        padding: 20px;
    }
    
    .hp-rh-section h2 {
        font-size: 20px;
    }
    
    .hp-rh-vacante-footer {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .hp-rh-vacantes-wrapper,
    .hp-rh-vacante-single {
        padding: 10px;
    }
    
    .hp-rh-filtros {
        padding: 15px;
    }
    
    .hp-rh-vacante-meta {
        flex-direction: column;
        gap: 8px;
    }
    
    .hp-rh-single-meta {
        flex-direction: column;
        gap: 10px;
    }
}

/* =======================
   ACCESIBILIDAD
   ======================= */

.hp-rh-btn:focus,
.hp-rh-input:focus,
.hp-rh-select:focus {
    outline: 2px solid var(--hp-rh-primary);
    outline-offset: 2px;
}

/* Screen reader only */
.hp-rh-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border-width: 0;
}

/* Print styles */
@media print {
    .hp-rh-filtros,
    .hp-rh-pagination,
    .hp-rh-btn,
    .hp-rh-contacto-card .hp-rh-btn {
        display: none;
    }
    
    .hp-rh-vacante-card,
    .hp-rh-sidebar-card,
    .hp-rh-single-main {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
