/* =========================================================
   Ofertas de Empleo – Estilos del plugin
   ========================================================= */

/* ── Variables ─────────────────────────────────────────── */
:root {
    --oe-primary:      #0073aa;
    --oe-primary-dark: #005a87;
    --oe-danger:       #dc3545;
    --oe-danger-dark:  #b02a37;
    --oe-success-bg:   #d4edda;
    --oe-success-text: #155724;
    --oe-error-bg:     #f8d7da;
    --oe-error-text:   #721c24;
    --oe-border:       #dee2e6;
    --oe-radius:       8px;
    --oe-shadow:       0 1px 4px rgba(0,0,0,.07);
}

/* ── Contenedores principales ──────────────────────────── */
.oe-gestion-wrap,
.oe-listado-wrap {
    max-width: 860px;
    margin: 0 auto;
    padding: 8px 0;
    font-family: inherit;
    line-height: 1.6;
}

/* ── Mensajes de feedback ──────────────────────────────── */
.oe-message {
    padding: 13px 18px;
    border-radius: var(--oe-radius);
    margin-bottom: 22px;
    font-size: 15px;
}
.oe-success {
    background: var(--oe-success-bg);
    border: 1px solid #c3e6cb;
    color: var(--oe-success-text);
}
.oe-error {
    background: var(--oe-error-bg);
    border: 1px solid #f5c6cb;
    color: var(--oe-error-text);
}

/* ── Formulario de login ───────────────────────────────── */
.oe-login-wrap {
    max-width: 420px;
    margin: 40px auto;
    padding: 36px 32px;
    background: #fff;
    border: 1px solid var(--oe-border);
    border-radius: var(--oe-radius);
    box-shadow: 0 4px 18px rgba(0,0,0,.1);
}
.oe-login-wrap h2 {
    margin: 0 0 6px;
    font-size: 22px;
}
.oe-login-subtitle {
    margin: 0 0 24px;
    color: #666;
    font-size: 14px;
}

/* ── Campos de formulario ──────────────────────────────── */
.oe-form-row {
    display: flex;
    gap: 18px;
}
.oe-field {
    flex: 1;
    margin-bottom: 20px;
}
.oe-field-half {
    flex: 1;
}
.oe-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 14px;
    color: #2c2c2c;
}
.oe-required {
    color: #e03e3e;
}
.oe-field input[type="text"],
.oe-field input[type="email"],
.oe-field input[type="password"],
.oe-field input[type="date"],
.oe-field select,
.oe-field textarea {
    width: 100%;
    padding: 10px 13px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 15px;
    line-height: 1.5;
    box-sizing: border-box;
    transition: border-color .18s, box-shadow .18s;
    color: #1a1a1a;
    background: #fff;
}
.oe-field input:focus,
.oe-field select:focus,
.oe-field textarea:focus {
    outline: none;
    border-color: var(--oe-primary);
    box-shadow: 0 0 0 3px rgba(0,115,170,.15);
}
.oe-field textarea {
    resize: vertical;
    min-height: 160px;
}
.oe-field-help {
    font-size: 12px;
    color: #777;
    margin: 5px 0 0;
}

/* Input de archivo */
.oe-file-input-wrap {
    position: relative;
}
.oe-file-input-wrap input[type="file"] {
    width: 100%;
    padding: 9px 0;
    font-size: 14px;
    cursor: pointer;
}

/* Preview de archivos seleccionados */
.oe-file-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}
.oe-file-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #e9ecef;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 13px;
    color: #333;
}
.oe-file-tag .oe-file-size {
    color: #888;
    font-size: 11px;
}

/* ── Botones ───────────────────────────────────────────── */
.oe-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 22px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: background .18s, box-shadow .18s, transform .12s;
    line-height: 1.4;
    white-space: nowrap;
}
.oe-btn:hover {
    text-decoration: none;
    transform: translateY(-1px);
}
.oe-btn:active {
    transform: translateY(0);
}
.oe-btn-block {
    width: 100%;
}
.oe-btn-primary {
    background: var(--oe-primary);
    color: #fff;
}
.oe-btn-primary:hover {
    background: var(--oe-primary-dark);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0,115,170,.3);
}
.oe-btn-secondary {
    background: #f0f2f4;
    color: #444;
    border: 1px solid var(--oe-border);
}
.oe-btn-secondary:hover {
    background: #e2e6ea;
    color: #222;
}
.oe-btn-danger {
    background: var(--oe-danger);
    color: #fff;
}
.oe-btn-danger:hover {
    background: var(--oe-danger-dark);
    color: #fff;
}
.oe-btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

/* ── Cabecera admin ────────────────────────────────────── */
.oe-admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    padding-bottom: 18px;
    border-bottom: 2px solid var(--oe-border);
}
.oe-admin-header h2 {
    margin: 0;
    font-size: 24px;
}

/* ── Lista de ofertas existentes (admin) ───────────────── */
.oe-existing-offers {
    margin-bottom: 44px;
}
.oe-existing-offers h3 {
    margin-bottom: 14px;
    font-size: 18px;
}
.oe-admin-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.oe-admin-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    background: #f8f9fa;
    border: 1px solid var(--oe-border);
    border-radius: 6px;
    transition: box-shadow .15s;
}
.oe-admin-item:hover {
    box-shadow: var(--oe-shadow);
}
.oe-admin-item-info {
    flex: 1;
    font-size: 14px;
    line-height: 1.5;
}
.oe-admin-item-actions {
    flex-shrink: 0;
}
.oe-meta {
    color: #666;
    font-size: 13px;
}
.oe-empty {
    color: #888;
    font-style: italic;
    padding: 12px 0;
}

/* Badges */
.oe-badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    vertical-align: middle;
}
.oe-badge-published { background: #d4edda; color: #155724; }
.oe-badge-draft     { background: #fff3cd; color: #856404; }
.oe-badge-closed    { background: #f8d7da; color: var(--oe-error-text); }
.oe-badge-tipo      { background: #e2e8f0; color: #4a5568; margin-left: 0; }

/* ── Formulario nueva oferta ───────────────────────────── */
.oe-form-wrap {
    background: #fff;
    border: 1px solid var(--oe-border);
    border-radius: var(--oe-radius);
    padding: 30px 32px;
    box-shadow: var(--oe-shadow);
}
.oe-form-wrap h3 {
    margin: 0 0 26px;
    font-size: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid #eee;
}

/* ── Listado público ───────────────────────────────────── */
.oe-ofertas-grid {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.oe-oferta-card {
    background: #fff;
    border: 1px solid var(--oe-border);
    border-radius: var(--oe-radius);
    padding: 26px 28px;
    box-shadow: var(--oe-shadow);
    transition: box-shadow .2s, border-color .2s;
}
.oe-oferta-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,.1);
    border-color: #c8d0da;
}
.oe-oferta-card.oe-oferta-closed {
    opacity: .72;
    border-left: 4px solid var(--oe-danger);
}

.oe-oferta-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}
.oe-oferta-title {
    margin: 0;
    font-size: 21px;
    color: #1a1a1a;
    flex: 1;
}
.oe-oferta-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    margin-bottom: 18px;
    font-size: 14px;
    color: #555;
}
.oe-meta-empresa {
    font-weight: 700;
    color: var(--oe-primary);
}
.oe-meta-lugar {
    color: #555;
}
.oe-meta-fecha {
    color: #777;
}

/* Descripción */
.oe-oferta-description {
    margin-bottom: 18px;
    font-size: 15px;
    line-height: 1.75;
    color: #333;
}
.oe-oferta-description p {
    margin: 0 0 10px;
}
.oe-oferta-description p:last-child {
    margin-bottom: 0;
}

/* Documentos */
.oe-oferta-docs {
    margin-bottom: 18px;
    padding: 14px 16px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #eaecef;
}
.oe-docs-title {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 700;
    color: #555;
    text-transform: uppercase;
    letter-spacing: .4px;
}
.oe-docs-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.oe-doc-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: #fff;
    border: 1px solid var(--oe-border);
    border-radius: 5px;
    text-decoration: none;
    font-size: 13px;
    color: var(--oe-primary);
    transition: background .16s, box-shadow .16s;
}
.oe-doc-link::before {
    content: '📄';
    font-size: 14px;
}
.oe-doc-link.oe-doc-pdf::before  { content: '📕'; }
.oe-doc-link.oe-doc-docx::before,
.oe-doc-link.oe-doc-doc::before  { content: '📘'; }
.oe-doc-link:hover {
    background: #eaf3fb;
    box-shadow: 0 2px 6px rgba(0,115,170,.15);
    text-decoration: none;
}

/* Pie de la card */
.oe-oferta-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-top: 14px;
    border-top: 1px solid #f0f0f0;
    margin-top: 4px;
}
.oe-fecha-publicacion {
    font-size: 12px;
    color: #aaa;
}

/* ── Paginación ────────────────────────────────────────── */
.oe-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 36px;
}
.oe-page-current {
    cursor: default;
    pointer-events: none;
    opacity: .85;
}

/* Estado vacío */
.oe-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #888;
    font-size: 16px;
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 640px) {
    .oe-form-row {
        flex-direction: column;
        gap: 0;
    }
    .oe-form-wrap {
        padding: 20px 16px;
    }
    .oe-login-wrap {
        padding: 24px 18px;
        margin: 20px auto;
    }
    .oe-admin-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .oe-admin-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .oe-oferta-card {
        padding: 18px 16px;
    }
    .oe-oferta-footer {
        flex-direction: column;
        align-items: flex-start;
    }
}
